Page MenuHomePhabricator

[L] Send Image Suggestions notifications to experienced users
Closed, ResolvedPublic

Description

NOTE: T292310 covers the notification itself. This ticket covers writing a script to send the notifications.

Write a maint script in the new image suggestions notifications extension that sends image suggestions notifications to experienced users.

Image suggestions for unillustrated articles can be read from hdfs (see T299789, using commonswiki_file to get confidence scores) or Cassandra (T299885 ... possibly via an API)

Acceptance Criteria:

  • Each user who has not opted out of these notifications (see T292146) with >500 edits will get at most two notifications each time the script is run, where the notification
  • is about a image suggestion for an unillustrated article on the user's watchlist
  • where the confidence score of the suggestion is >=80% (see T281582 and T283865)
  • is not about an article that the user has previously received any image suggestion notification for
  • prioritising articles this user has edited in the last 30 days (see T292312), then ordered randomly
  • only one notification per article is generated per week Note: this scheduling is covered in T300024

Related Objects

Event Timeline

CBogen renamed this task from Create and send Image Suggestions notifications to Generate and send Image Suggestions notifications.Oct 1 2021, 7:04 PM
CBogen updated the task description. (Show Details)
Cparle renamed this task from Generate and send Image Suggestions notifications to Send Image Suggestions notifications to experienced users.Jan 25 2022, 12:10 PM
Cparle updated the task description. (Show Details)
Cparle added a subscriber: CBogen.

@SWakiyama and @CBogen I modified this task to make it clearer from a development perspective. I think the details are the same, but if you disagree please let me know. One thing I wasn't sure about from what we had - how many notifications do we want to send per user per week?

Cparle updated the task description. (Show Details)
CBogen renamed this task from Send Image Suggestions notifications to experienced users to [L] Send Image Suggestions notifications to experienced users.Feb 9 2022, 5:36 PM
CBogen updated the task description. (Show Details)

Some notes before working on implementation:

  • Ingest a list of article image pairs
    • Filter out values below confidence score.
    • Generate list of unique articles titles maybe?
  • Find and note watchers for each article. ( useful code for reference )
    • Generate unique users maybe?
    • Whilst doing this, perhaps fetch edit count and filter all users with less than 500 edits
  • Find the last time each user edited each watchlist time.
  • Load previous image suggestion notifications for each user and see if they were previously notified about this article?
  • As notification is triggered for each user add a notification count and if = 2 move skip onto the next set up.
  • Define notification
EchoEvent::create( [
	'type' => 'my-ext-topic-word',
	'title' => $title,
	'extra' => [
		'revid' => $revision->getId(),
		'source' => $source,
		'excerpt' => EchoDiscussionParser::getEditExcerpt( $revision, $this->getLanguage() ),
	],
	'agent' => $user,
] );

Change 777350 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/extensions/ImageSuggestions@main] [WIP] Maintenance script that sends image suggestions

https://gerrit.wikimedia.org/r/777350

Change 778213 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/extensions/ImageSuggestions@main] [WIP] Maintenance script that sends image suggestions

https://gerrit.wikimedia.org/r/778213

Change 778213 abandoned by Matthias Mullie:

[mediawiki/extensions/ImageSuggestions@main] [WIP] Maintenance script that sends image suggestions

Reason:

Nope

https://gerrit.wikimedia.org/r/778213

Change 778216 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/extensions/ImageSuggestions@master] [WIP] Maintenance script that sends image suggestions

https://gerrit.wikimedia.org/r/778216

Change 777350 abandoned by Matthias Mullie:

[mediawiki/extensions/ImageSuggestions@main] [WIP] Maintenance script that sends image suggestions

Reason:

Resubmitted to "master" branch here: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ImageSuggestions/+/778216

https://gerrit.wikimedia.org/r/777350

Note that as per T283865, we'll only be notifying users of suggestions with a confidence score of >=80%. I've updated the acceptance criteria to reflect that.

Change 778216 merged by jenkins-bot:

[mediawiki/extensions/ImageSuggestions@master] Maintenance script that sends image suggestions

https://gerrit.wikimedia.org/r/778216

Moving to blocked until the code has been deployed, at which point I'll do a few more tests.

Here's the command to run for each wiki, with the params set to above acceptance criteria (and T295369)

mwscript extensions/ImageSuggestions/maintenance/SendNotificationsForUnillustratedWatchedTitles.php --wiki=wiki --min-edit-count=500 --min-confidence=80 --max-notifications-per-user=2 --exclude-instance-of=Q5

Seddon changed the task status from Open to Stalled.Aug 3 2022, 4:33 PM
Seddon moved this task from Doing to Blocked on the Structured-Data-Backlog (Current Work) board.

Everything is complete except for T300024 which will be handled in that ticket.