Page MenuHomePhabricator

List unillustrated pages and their image suggestions (ImageMatchingAlgorithm only)
Closed, ResolvedPublic8 Estimated Story Points

Description

Narrative

Android

  • As a mobile reader (familiar with editing on my device)
    • When I am reading an article with no images
    • I want to see any image(s) that could be used to illustrate the article,
    • so that I can both gain a better understanding of the topic, as well as contribute to helping others who read the article in the future.

Structured Data

  • As a bot-writing contributor
    • I want a list of unillustrated pages and image suggestions per page
    • So that I can automate adding images to those pages

Acceptance Criteria

  • Given I have made a valid request, I expect to have a list of unillustrated articles, so that I know which articles need images. this is no longer in scope for this card. See https://phabricator.wikimedia.org/T272735
  • Given I have made a valid request, I expect to have 1-3 image suggestions per unillustrated article found from the ImageMatchingAlgorithm
  • Given I have made a valid request with pagination parameter "10", I expect to receive the same 10 results regardless of how many times I make the request

Hygiene

  • The service is deployed and reachable via curl
  • API Documentation is published and viewable
  • Tests related to ACs are written and pass

Example Spec

Request

https://api.wikimedia.org/image_suggestions/v1/en/wikipedia/pages

Response

{
  "project": enwiki
  "page" "Cat"
  [
  	{
	  "filename": "File:Striped_Cat.jpg",
          "source": "Wikidata",
          "confidence_rating":"high"
	},
  	{
	  "filename": "File:Spotted_Cat.jpg",
          "source": "Commons Category",
          "confidence_rating":"medium"
	},
  ]
},
{
  "project": enwiki
  "page" "Frog"
  [
  	{
	  "filename": "File:Green_Frog.jpg",
          "source": "Wikidata",
          "confidence_rating":"high"
	},
	{
	  "filename": "File:Yellow_Frog.jpg",
          "source": "Commons Category",
          "confidence_rating":"medium"
	}
  ]
}
  • 200 - Success
  • 400 - Bad Request (invalid path params)
  • 404 - Article not found/does not exist

Open Questions

  • What's the resource name?
  • Is the API pulling from a data store in which the algo outputs to? or just a flat file?
  • Does the datastore need to have "real" data or "mock" data?
  • Is a scaffolding of a service included in the scope of this card? aka "hello world"
  • How long/difficult is the deployment side of this?
  • Does the POC need to be in a production environment?
    • No, but it does have to be deployed in some lower-environment

Subtasks

Event Timeline

sdkim renamed this task from List Image Recommendation for a given article (ImageMatchingAlgorithm) to List Image Recommendation for a given article (ImageMatchingAlgorithm only).Jan 22 2021, 5:09 PM
sdkim added a project: Image-Suggestions.
sdkim updated the task description. (Show Details)
sdkim updated the task description. (Show Details)

Is the distinction between this task and T272734 so that we can compare results of both, and see how it affects users interaction with applying images? And if so, we would need some indicator in either the request params/header/some ruleset built in the API for knowing when to give which result. Maybe we're not there yet, just noting for future.

@nnikkhoui This was more for sequencing our work in a way that we can deliver value iteratively. Once this is task is done, clients can start using the algo only version of the API to provide feedback as we iterate on https://phabricator.wikimedia.org/T272734. Does that make sense?

AH yes okay yep that makes sense, this task is just to capture the first version then. Got it.

sdkim set the point value for this task to 8.Jan 28 2021, 8:33 PM

Just making a note of @Clarakosi's suggestion of hosting on Cloud VPS, more specifically probably ToolForge?

sdkim renamed this task from List Image Recommendation for a given article (ImageMatchingAlgorithm only) to List Image Suggestion for a given article (ImageMatchingAlgorithm only).Feb 3 2021, 5:27 PM
sdkim updated the task description. (Show Details)

Change 663667 had a related patch set uploaded (by BPirkle; owner: BPirkle):
[mediawiki/services/image-suggestion-api@master] Initial route tests

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

sdkim renamed this task from List Image Suggestion for a given article (ImageMatchingAlgorithm only) to List unillustrated pages and their image suggestions (ImageMatchingAlgorithm only).Feb 16 2021, 7:37 PM

Change 665161 had a related patch set uploaded (by BPirkle; owner: BPirkle):
[mediawiki/services/image-suggestion-api@master] Speculative modules to process and use .tsv file data

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

Change 665161 merged by jenkins-bot:
[mediawiki/services/image-suggestion-api@master] Speculative modules to process and use .tsv file data

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

Change 666242 had a related patch set uploaded (by Nikki Nikkhoui; owner: Nikki Nikkhoui):
[mediawiki/services/image-suggestion-api@master] Add test-fixture generation script

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

Change 666246 had a related patch set uploaded (by BPirkle; owner: BPirkle):
[mediawiki/services/image-suggestion-api@master] Aggregate .tsv file results by page title in the .json output

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

Change 666242 merged by jenkins-bot:
[mediawiki/services/image-suggestion-api@master] Add test-fixture generation script

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

Change 663667 merged by jenkins-bot:
[mediawiki/services/image-suggestion-api@master] Initial route tests

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

Change 666528 had a related patch set uploaded (by Nikki Nikkhoui; owner: Nikki Nikkhoui):
[mediawiki/services/image-suggestion-api@master] Additional /{lang}/{wiki}/pages changes

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

Change 666246 merged by jenkins-bot:
[mediawiki/services/image-suggestion-api@master] Aggregate .tsv file results by page title in the .json output

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

Change 666528 merged by jenkins-bot:
[mediawiki/services/image-suggestion-api@master] Additional /{lang}/{wiki}/pages changes

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

Change 667750 had a related patch set uploaded (by Nikki Nikkhoui; owner: Nikki Nikkhoui):
[mediawiki/services/image-suggestion-api@master] Add offset query param

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

Change 667750 merged by jenkins-bot:
[mediawiki/services/image-suggestion-api@master] Add offset query param

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

Change 667950 had a related patch set uploaded (by Nikki Nikkhoui; owner: Nikki Nikkhoui):
[mediawiki/services/image-suggestion-api@master] Refactor imageSuggestions::getPages()

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

Change 667950 merged by jenkins-bot:
[mediawiki/services/image-suggestion-api@master] Refactor imageSuggestions::getPages()

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

Change 668250 had a related patch set uploaded (by Nikki Nikkhoui; owner: Nikki Nikkhoui):
[mediawiki/services/image-suggestion-api@master] Set suggestions to empty array if no suggestions

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

Can we get in the result if the image in Infobox or not? this will help the bots to add the image in the Infobox if the image from Infobox in some wikis.

Can we get in the result if the image in Infobox or not? this will help the bots to add the image in the Infobox if the image from Infobox in some wikis.

When the API provides the list of unillustrated articles and their image matches, that list will only include articles that do not have images in the infobox. I think this satisfies your request, but please let me know if I'm misunderstanding.

However, if you request the list of image matches for a particular article from the API, it will not check whether that article is unillustrated (via the infobox or otherwise). This is an interesting feature request; I hope we can talk more about it when we meet next week!

Change 668250 merged by jenkins-bot:
[mediawiki/services/image-suggestion-api@master] Set suggestions to empty array if no suggestions

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

Change 668740 had a related patch set uploaded (by Nikki Nikkhoui; owner: Nikki Nikkhoui):
[mediawiki/services/image-suggestion-api@master] Add more wikis to allowed wikiID list

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

Change 668740 merged by jenkins-bot:
[mediawiki/services/image-suggestion-api@master] Add more wikis to allowed wikiID list

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

@nnikkhoui I assume that " Tests related to ACs are written and pass" is done. If so I will move this to done and resolve

sdkim updated the task description. (Show Details)