Skip to content

Autodesc

Search results containing both manual and automated descriptions (highlighted in blue).

Search results containing both manual and automated descriptions (highlighted in blue).

Wikidata offers multilingual labels for items. Since many items will have the same label with, or even across, languages, one can also add a brief description for an item in each language, to quickly disambiguate between them. Such descriptions are helpful in searches, and essential when adding claims linking to other items. However, many items that share the same label have not been described by users yet, and most non-ambiguous items have no description either.

But many items already have claims describing their basic properties. So why leave the tedious task of describing all items in all languages to humans? A “well-claimed” item can, to some degree, be described by a machine, based on its claims. While such “machine description” is limited by both the algorithm used and the claims in the item, and automated descriptions will be misleading in some cases, they can be useful in most cases, and are easily corrected by entering a manual description.

For starters, I have created a JavaScript object I dub “autodesc” (for “automatic description”, not CAD development!). It generates automated descriptions for search results where no manual description is available. This happens “live”, even in the search dropdown box while you type. Automated descriptions are highlighted, so one can easily distinguish them from manual descriptions.

Dropdown autodesc

Automatic descriptions are added to the dropdown search box as well.

At the moment, the interface text is in English only, but it should work with all languages (limited by Wikidata item translations), albeit with some English text and strange grammar. The object is designed with multi-language support in mind, though.

Sadly, the “killer app”, that is, automatic description of items when editing claims, does not quite work yet, but it should not be a major technical hurdle.
UPDATE:I figured it out, this is now live!

If you have a Wikidata account, you can add this functionality by visiting your common.js page and adding the following line:

mw.loader.load('//en.wikipedia.org/w/index.php?title=MediaWiki:Wdsearch-autodesc.js&action=raw&ctype=text/javascript');

Needless to say, this is still experimental and may break at any point. I would love some help in developing it, and maybe the Wikidata devs might pick up the code, or at least the idea.

UPDATE: changed the URL to load from English Wikipedia instead – can be edited by the community, and scales much better under load than Labs