Page MenuHomePhabricator

Build an API and/or a tool to surface section recommendations
Closed, ResolvedPublic

Description

Useful Links

Implementation details

The initial implementation will have two separate end points for each of category-based and language-based recommendations. Later, when we're able to combine the results from these two systems into one, an API endpoint will be created for the combined recommendations.

A/C (will change as things become clearer)

http://gapfinder.wmflabs.org/en.wikipedia.org/v1/section/article/Barack_Obama or http://gapfinder.wmflabs.org/en.wikipedia.org/v1/section/article/Barack_Obama/780287712

  • Create an end-point for article based recommendations for frwiki:

http://gapfinder.wmflabs.org/fr.wikipedia.org/v1/section/article/Barack_Obama

  • Create an end-point for translation based recommendations.
  • Create a gadget to surface section recommendations.

http://rec-wiki.wmflabs.org/wiki/Main_Page has the gadget. Login and enable it to test it.

Details

Related Gerrit Patches:
mediawiki/services/recommendation-api : masterWIP: Add support for category-based section recommendations

Related Objects

Event Timeline

leila triaged this task as High priority.Dec 15 2017, 9:43 PM
leila created this task.
bmansurov claimed this task.Jan 3 2018, 8:15 PM
bmansurov updated the task description. (Show Details)Jan 3 2018, 8:40 PM
bmansurov updated the task description. (Show Details)Jan 10 2018, 2:53 PM
bmansurov updated the task description. (Show Details)Jan 10 2018, 3:58 PM

Change 403938 had a related patch set uploaded (by Bmansurov; owner: Bmansurov):
[mediawiki/services/recommendation-api@master] WIP: Add support for category-based section recommendations

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

bmansurov moved this task from Staged to In Progress on the Research board.Jan 16 2018, 4:09 PM

@bmansurov these look good to me. Thanks.

@tizianopiccardi can you confirm that the relevance scores for the example recommendations is what you expect to see?

@tizianopiccardi can you confirm that the relevance scores for the example recommendations is what you expect to see?

Yes, the recommendations match with the dataset I generated.

leila added a comment.Jan 16 2018, 5:52 PM

@tizianopiccardi Thanks for confirming.

bmansurov updated the task description. (Show Details)Jan 16 2018, 6:40 PM
bmansurov updated the task description. (Show Details)Jan 19 2018, 12:19 AM

We have a gadget now. Follow these steps to see it in action:

  1. Create an account at http://rec-wiki.wmflabs.org
  2. Enable the 'gapfinder' gadget at http://rec-wiki.wmflabs.org/wiki/Special:Preferences#mw-prefsection-gadgets.
  3. Visit one of the articles below to see section recommendations (recommendations will appear just below the article title):

Note that it may take a little time before you see suggestions. Also, since this is the first iteration, we're only showing the recommendations in the read view. The next iteration will suggest these recommendations in the edit view. Also note that, only the top 5 recommended sections are being shown.

bmansurov updated the task description. (Show Details)Jan 19 2018, 10:53 PM
leila added a comment.Jan 20 2018, 1:13 AM

@bmansurov great great. :)

Shall we share a page somewhere where we can drop the issues and discuss how we can fix them? (etherpad or wiki both work). For example, in http://rec-wiki.wmflabs.org/wiki/Bring_You_Back , I'm not sure why Chart performance is recommended while the section is already in the article. Also, Tiziano may want to see what's going wrong in http://rec-wiki.wmflabs.org/wiki/Georgians, I'm guessing a bad category has made it to the pruned network.

bmansurov added a comment.EditedJan 20 2018, 2:22 AM

@leila an etherpad should be enough for now.

As for the "Bring You Back" article, I think the issue is with the code, not data. I'll look into it on Monday.

Yes, it'be great if @tizianopiccardi can look at Georgians. To briefly explain, the sections are coming from all categories of that article. Not sure which ones are ultimately responsible for the unfit sections.

I've updated the gadget to display section recommendations while editing an article. See http://rec-wiki.wmflabs.org/w/index.php?title=Mel_Blanc&action=edit, for example. Here's a screenshot:

leila added a subscriber: diego.Feb 2 2018, 11:12 PM

I've updated the gadget to display section recommendations while editing an article. See http://rec-wiki.wmflabs.org/w/index.php?title=Mel_Blanc&action=edit, for example.

Great. @bmansurov In terms of the design, are you planning to gradually move towards the ones at T160177 ? If yes, I can start talking with Pau to expand to those designs for us. We discussed a couple of things we want to have:

  • Context for the recommendation
  • A way for the user to report the recommendation

Here's a screenshot:

@diego check the above. It's a good example for why we need T183037. ;)

@leila yes, I'll try to follow the design mock ups.

French recommendations have been imported. The data is available via the API, e.g. http://gapfinder.wmflabs.org/fr.wikipedia.org/v1/section/category/Ville

bmansurov updated the task description. (Show Details)Feb 5 2018, 6:24 PM
bmansurov updated the task description. (Show Details)Feb 7 2018, 9:38 PM
diego added a comment.Feb 8 2018, 6:27 PM

quick comment: from this results http://gapfinder.wmflabs.org/fr.wikipedia.org/v1/section/article/Barack_Obama

Maybe there is an issue with encoding. The first recommendation is "Notes et ru00e9fu00e9rences", that already exist in the French article (https://fr.wikipedia.org/wiki/Barack_Obama#Notes_et_r%C3%A9f%C3%A9rences) . This might be an important issue for French and other languages. It would be good to see where this bug is coming from. @bmansurov @tizianopiccardi

@diego you're right. The service doesn't filter out existing recommendations because it doesn't take revid into account. Only gadget can show missing sections for now.

As for the encoding issue, we'll deal with it soon too.

The gadget has been updated. It's being shown next to the editor now.

bmansurov updated the task description. (Show Details)Feb 16 2018, 8:55 PM
bmansurov added a comment.EditedFeb 23 2018, 6:07 PM

@leila article based suggestions end point can return tens or hunderds of section suggestions depending on the number of categories an article belongs to. For example Barack Obama returns 140 suggestions. Do we want to limit the number of suggestions to, say top 25 by relevance score? We can do so by default and still let users query the full set of suggestions with an additoinal query parameter.

@bmansurov at the moment, it's best to let the API surface all of them by default. I expect some traffic to the API in the coming days/weeks for exploring the recommendations. After this initial phase, we should discuss what kind of surfacing functionality would make sense. I think the top n and the bottom m can be both interesting.

one question: would it be possible to break the lines so each recommendation is in one line? That can make the output of the API more readable for ppl?

@leila got it.

As for making the output easy to read, I could do it on the server side. I, however, suggest you use one of the extensions available for your browser. For example, JSONView is available for Chrome and Firefox. Let me know if it doesn't solve your problem.

leila added a comment.Mar 29 2018, 9:53 PM

@bmansurov We can call this task for the purposes of Q3 done. If you agree, please move it to Done.

bmansurov updated the task description. (Show Details)Mar 30 2018, 1:35 AM
bmansurov moved this task from In Progress to Done (current quarter) on the Research board.

Translation based section recommendations will be done in a separate task once the models are ready. See T190770 and T184212.

DarTar closed this task as Resolved.May 2 2018, 9:51 PM
DarTar edited projects, added Research-Archive; removed Research.
DarTar moved this task from Default to Q3-FY18 on the Research-Archive board.May 2 2018, 10:41 PM

Change 403938 abandoned by Bmansurov:
WIP: Add support for category-based section recommendations

Reason:
Our priorities have changed. We'll pick this patch up later if need be.

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