Page MenuHomePhabricator

[M] Create "assessment" filter in MediaSearch
Closed, ResolvedPublic

Description

As a user of MediaSearch, I want to be able to filter my images by their assessment, so that I can narrow my results to the most high quality images.

assessments.jpg (766×1 px, 307 KB)

From User:Christian Ferrer and User:Aristeas:

Hi, it could be a good idea to add a filter "Assessment" with 3 possible choices: Quality, Featured and Valued. In order to highlight, in one click, and within the results, the images that have {{Q|63348040}}, {{Q|63348069}} or {{Q|63348049}} in Structured Data.

I just would like to second this request – IMHO it is a very good idea. When search results include many many media, it can be very useful for the user to limit the results e.g. to Quality images.

Acceptance Criteria:

  • A new filter is created in all tabs on desktop and mobile web except Categories and Pages that allows the user to narrow down the choices by Quality, Featured, or Valued assessment. The default selection of this filter is "All images"
  • A user-friendly URL parameter is exposed to users of Special:MediaSearch to duplicate the effects of haswbstatement:Pxxx=Qxxx for assessment filters; something like &assessment=featured. haswbstatement will still be used behind the scenes in the actual API request.
  • Dropdown UI supports all allowed values of the Commons Quality Assessment property

*Note: The work to add the assessment information to Quickview has been broken out into its own task: T279565

Event Timeline

Really like this idea and could see it be especially useful while searching for image to place in an article.

Couple of rough ideas to start the conversation:

  • A dropdown/standard select, much like the rest of the filters. Defaults to all images and would only allow you to select one of the Assessment filters at a time.

01.jpg (766×1 px, 306 KB)

  • If we want something more advanced (more than one interaction) we would need to move to a dialog like we are with the namespace selector filter. Perhaps checkboxes could work here, where the default is all images but you can select which assessment(s) you want applied.

02.jpg (766×1 px, 174 KB)

@mwilliams It seems like a very good approach and a good summary. The first offering a selection matching the appearance of the other filters, the second being a little more flexible because it offers the possibility of combinations. There may be a rational way to have the advantage of both: when you open the dropdown/standard select you give a link, named e.g. "advanced" leading to the checkboxes.

@ChristianFerrer Thanks for your input, that could work, still figuring out how they would work together and to not make the "Advanced" link appear to be part of the select options while having an expected interaction once clicked on.

Screen Shot 2021-03-17 at 2.25.49 PM.png (564×882 px, 720 KB)

I imagine choosing one option or the other will cut down on the work needed to complete this task and am leaning in that direction. Looking forward to some engineering input on this ticket to see what we can accomplish in the available time we will have.

Another idea is that we could also include any assessments into the "quick view".

Screen Shot 2021-03-17 at 2.34.31 PM.png (1×832 px, 971 KB)
("⭐️Quality Image" is the new addition)

@mwilliams, to not make the "Advanced" link appear to be part of the select options, in addition to the separating horizontal line, as you did in your exemple, which is a good idea, you may put a little icon such as https://commons.wikimedia.org/wiki/File:OOjs_UI_icon_newWindow-ltr.svg. With the icon maybe that one does not need to underline "Advanced"

Regarding the "quick view", that seems also a good idea, but one need to define how display several values? i.e. some images have the 3 assessment, valued, featured and quality, e.g. https://commons.wikimedia.org/wiki/File:Alligator_Cr%C3%A2ne_et_Mandibule.jpg. So how to list them in the quick view, one line or 3 lines:
⭐️Valued image
⭐️Featured picture
⭐️Quality image
or
⭐️ Valued image / Featured picture/ Quality image
Personaly I prefer the 3 lines but I don't have a strong opinion.

@ChristianFerrer All good points, thanks. Going to bring this ticket up in an upcoming team meeting and see what parts of this we can accomplish and when. Here are some mockups of your ideas:

Screen Shot 2021-03-25 at 12.56.58 PM.png (1×788 px, 884 KB)
3 different lines

Screen Shot 2021-03-25 at 12.56.47 PM.png (1×752 px, 794 KB)
All in one line (Since it takes up less space and perhaps lessens the need to scroll, I'm leaning this way but either way is functional in my opinion)

Screen Shot 2021-03-25 at 1.06.36 PM.png (510×504 px, 294 KB)
Adding a newWindow icon

After chatting with the team, we decided on starting with the least complex solution to implement as we currently have limited time resources to dedicate to this. We hope to gain more insight on how this filter is being used before investing more time.

This will include a simple dropdown/select and adding the information to the "quick view".

quick_view_assessments.jpg (1×1 px, 417 KB)

assessments.jpg (766×1 px, 307 KB)

CBogen renamed this task from Create "assessment" filter in MediaSearch to [M] Create "assessment" filter in MediaSearch.Apr 7 2021, 4:23 PM

I'll start working on adding a dropdown filter for this feature shortly (adding the info about assessments into the quickview panel may take some additional work; don't think that data is included in what the extMetadata extension gives us currently).

In the meantime, it's actually possible to run these queries now, by prefixing your search term with haswbstatement:P[xxx]=Q[xxx].

The property you want is Commons Quality Assessment (P6731).

Allowable values are:

Here's an example search with the "featured image" filter applied:
https://commons.wikimedia.org/wiki/Special:MediaSearch?type=image&search=haswbstatement%3AP6731%3DQ63348069+desert

Adding a user-friendly UI will be a big improvement here, of course!

egardner reassigned this task from Seddon to Jseddon.
egardner updated the task description. (Show Details)
egardner added a subscriber: Seddon.

Change 681947 had a related patch set uploaded (by Seddon; author: Seddon):

[mediawiki/extensions/WikibaseMediaInfo@master] [WIP] Create "assessment" filter in MediaSearch

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

Change 685027 had a related patch set uploaded (by Seddon; author: Seddon):

[mediawiki/extensions/MediaSearch@master] WIP Assessment filter and assessment in QuickView

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

Ciao, would this filter allow to find just "contest winners" pics as well? TY.

@Elitre I also already thought about that, as there are potentially a lot of interesting images in various contest, e.g. Wiki Loves Monuments 2020 winners or even the in the Photo Challanges, e.g. Commons:Photo challenge/Previous/2020, however it seems that this kind of infos are not yet modeled in SDFC.

According to Carly, "the community would need to work on modeling those awarded pictures into SDC and transferring them to SDC via a bot. Once that's in place, the assessment filter should pick it up."
I hope this will happen at some point.

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

[operations/mediawiki-config@master] Add MediaSearch assessment filter map

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

Change 681947 abandoned by Seddon:

[mediawiki/extensions/WikibaseMediaInfo@master] [WIP] Create "assessment" filter in MediaSearch

Reason:

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

Change 685027 merged by jenkins-bot:

[mediawiki/extensions/MediaSearch@master] Assessment filter and assessment in QuickView

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

@egardner - what URL parameter should be used? &assessment=featured doesn't seem to be working.

@Etonkovidova – that is the correct param, but the patch was updated to include some config variables that likely need to be set on Beta and Production commons before this feature will work. I'll see about making sure this happens some time soon.

The config value that needs to be enabled is:

$wgMediaSearchAssessmentFilters = [
	'featured-image' => 'P6731=Q63348049',
	'quality-image' => 'P6731=Q63348069',
	'valued-image' => 'P6731=Q63348040',
	'picture-of-the-day' => 'P6731=Q6998859',
];

In the URL, this will correspond to the values needed for the assessment filter, so &assessment=featured-image, &assessment=picture-of-the-day, etc. will be the correct query strings.

Will update this ticket once the new config is deployed.

Change 693951 had a related patch set uploaded (by Eric Gardner; author: Eric Gardner):

[operations/mediawiki-config@master] Enable MediaSearch Assessment filter

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

Change 693951 merged by jenkins-bot:

[operations/mediawiki-config@master] Enable MediaSearch Assessment filter

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

Mentioned in SAL (#wikimedia-operations) [2021-05-27T23:21:16Z] <egardner@deploy1002> Synchronized wmf-config/InitialiseSettings.php: Config: [[gerrit:693951|Enable MediaSearch Assessment filter (T276257)]] (duration: 00m 57s)

Checked on commons wmf.7.

(1) @mwilliams - regarding the following spec: the Assessment filter is present for Images and Video filters. Audioand Other media do not have the Assessment filter. Is it a change in the specs or it'll be done in the future?

  • A new filter is created in all tabs on desktop and mobile web except Categories and Pages that allows the user to narrow down the choices by Quality, Featured, or Valued assessment. The default selection of this filter is "All images"

There are only couple of Audio and Other media files that are in Featured pictures (https://commons.wikimedia.org/wiki/Special:NewMediaSearch?type=audio&search=haswbstatement%3AP6731%3DQ63348049). Audio files are not present in Quality images, Valued images, and Picture of the day. Other media files will be present in Featured image and in Valued image (https://commons.wikimedia.org/wiki/Special:NewMediaSearch?type=other&search=haswbstatement%3AP6731%3DQ63348069).


@egardner - the results for Special:NewMediaSearch in (2) and (3) are exactly the same as Special:Search fetches, so the Assessment filter works as expected, but maybe Special:NewMediaSearch can be better?

(2) For Video "Picture of the day" assessment filter is present but nothing is returned (https://commons.wikimedia.org/wiki/Special:NewMediaSearch?type=video&search=haswbstatement%3AP6731%3DQ6998859) . However, there is an example of "Media of the day" - https://commons.wikimedia.org/wiki/Template:Potd/2017-01#21. Should Special:NewMediaSearch Assessment filter be more accommodating, i.e to include "Media of the day"?

(3) "Picture of the day" doesn't list this file - https://commons.wikimedia.org/wiki/File:Grey_squirrel_(Sciurus_carolinensis)_02.jpg (and Special:Search fetches exactly the same results). But the file is in the list of Pictures of the day - https://commons.wikimedia.org/wiki/Template:Potd/2017-01#21. The picture will be listed as "Featured picture", "Quality image", and "Valued image", but not "Picture of the day". " The QuickView also confirms that the picture is "Picture of the day":

Screen Shot 2021-06-04 at 5.46.24 PM.png (1×3 px, 3 MB)

I checked other files for "Picture of the day" - e.g. https://commons.wikimedia.org/wiki/Special:NewMediaSearch?type=image&search=windmill&assessment=picture-of-the-day and I don't see any reason why the squirrel file was not displayed.

@Etonkovidova the squirrel is not displayed because the relevant strustured data have not yet be added, such as e.g. there.

@Etonkovidova the squirrel is not displayed because the relevant strustured data have not yet be added, such as e.g. there.

Thanks! Yes the grey squirrel image doesn't list Picture of the day in its Structured data. Still, it may be confusing for users to see this picture as the Picture of the day in the QuickView (or on Template:Potd/2017-01 page) and not fetched whith "Picture of the day" filter

@Etonkovidova Good question! I had incorrectly assumed that these assessments would be for images and video only but if there are other file types receiving these assessments, it can't hurt to show the filter on all of the tabs. I don't think it's a blocker but something to consider when we have the time to update.

@egardner Does adding the filter to the other tabs since they have results make sense to you? Would that take a lot of time?

Moving back to Doing until the inconsistency on the tabs issue is resolved.

@mwilliams Adding the assessment filter to all tabs should be simple. There may be more searches that come back without results in these tabs but I don't see that as a problem.

Regarding the "media of the day" assessment, is that something we should handle as well? Is the community using a wikidata statement to represent this label?

Finally, as @ChristianFerrer mentioned above, these filters will only catch files that possess structured data statements corresponding to the assessment. If something has been labeled as "picture of the day" in the Wikitext file description but the corresponding statement has not been added, MediaSearch can't find it. If this is a recurring problem the community may want to consider writing a bot or otherwise automating the process of adding these statements to all images that should have them.

At the moment there aren't any assessment statements leveraged for Featured Media or Media of the Day or any of the old Featured Sounds statuses. Theoretically right now no audio files should appear and the two that do are in fact video files and not audio files.

Until that the situation with assessment statements changes no user should expect to see a "featured sound". And out of the 3d files with assessments, 9 of them are wikimedia logos but again since last year, these would be covered by "featured media".

When there is an expansion of the assessment statements, it might then be worthwhile revisiting this, including whether we want all filters to be provided to all tabs or explore providing additional context to end users due to the increased complexity which at the moment we haven't factored in from a user experience perspective.

Thanks for additional info!

I'd love for us to get the majority use case pushed to production so everyone can start using it. We can revisit some of these smaller cases later in new tickets when they have more useful coverage.

Change 689788 abandoned by Matthias Mullie:

[operations/mediawiki-config@master] Add MediaSearch assessment filter map

Reason:

This already made it in via another patch

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