Recommendation API/zh
本頁面已經過時,但如果獲得更新,它仍將有所幫助。請幫助校正、增加并修訂文字以反映現狀。 |
The Wikimedia Recommendation API is an open-access HTTP API, currently under development, that will provide personalized recommendations for a variety of use-cases. The initial use-case for this API is ContentTranslation where it recommends articles to translate from one language to another by using traffic trends, activity logs, and other signals to identify gaps in coverage and to match those to editors based on interest. The API is intended to be flexible enough to serve as a basis for new features by third-party developers or researchers.
聯絡我們
聯絡我們的最佳方式是在Libera Chat IRC上的#wikimedia-research頻道。
Consumers
The Translation Recommendation Type is being used by ContentTranslation as part of their "Suggestions" feature.
Type Endpoints
類型 | RESTBase | Production | Cloud VPS | Experimental | ||||
---|---|---|---|---|---|---|---|---|
API | GapFinder | API | GapFinder | API | GapFinder | API | GapFinder | |
翻譯 | ||||||||
Missing Sections | ||||||||
相關條目 |
Service overview
Recommendation API
the service that we’re trying to productionize
- Provides endpoints for all the Recommendation Types and the Recommendation Tool
- These can live independently of each other
Recommendation Type
an endpoint of the Recommendation API that provides a type of recommendation
Translation
- Recommend articles for translation that exist in a source language wiki but are absent from a target language wiki
- 規格:https://recommend.wmflabs.org/types/translation/spec
- Ex query: /types/translation/v1/articles?source=en&target=de&seed=Apple
- Returns articles that exist in enwiki but are missing from dewiki that are related to the article “Apple”
- Currently uses morelike search, Pageview API, and Wikidata queries to provide recommendations
- Build list of candidate articles
- Use morelike if a seed is provided, else most popular articles based on Pageview API
- Apply filters to prune candidate articles
- Build list of candidate articles
- Currently can use the experimental Related Articles Recommendation Type for building the list of candidate articles in place of morelike
Related Articles
- experimental
- Waiting for results from study
- Recommend articles that are related to a seed article in a given language
- 規格:https://recommend-related-articles.wmflabs.org/types/related_articles/spec
- Ex query: /types/related_articles/v1/articles?source=en&seed=Apple
- Returns articles that are related to “Apple” that exist in enwiki
- Ex query: /types/related_articles/v1/items?seed=Q89
- Returns wikidata items that are related to Q89
- Uses Wikidata queries
- Uses computed matrix file
- Size: measured in Gigabytes
- Computed offline approx. every month
- Needs less than a day to build
Missing Sections
- experimental
- Recommend articles and sections to add to them
- 程式碼:https://github.com/schana/recommendation-missing-sections
- 規格:https://recommend-experimental.wmflabs.org/types/missing_sections/spec
- Ex query: /types/missing_sections/v1/articles
- Returns articles and sections that could be added to them
- Ex query: /types/missing_sections/v1/articles?seed=Apple
- Returns articles related to "Apple" and sections that could be added to them
Recommendation Tool
the UI component that can exercise the API
- GapFinder
- Tool that helps editors fill content gaps in Wikipedia
- Currently uses the Translation Recommendation Type
- Code lives in the main Recommendation API repo
- There is a different version in development to support different recommendation types
Current service
- Lives in Cloud VPS
- Python 3.4
Future service
- Based on ServiceTemplateNode
- https://github.com/wikimedia/mediawiki-services-recommendation-api
- Deployment task: phab:T165760
- Sequence Diagram
Our intentions for productization
To support the current use case of ContentTranslation, we want to productionize the Recommendation API providing only the Translation Recommendation Type endpoint at this time, without relying on any experimental functionality (that is, don’t use the Related Articles Recommendation Type in place of morelike). Without needing the Related Articles Recommendation Type, the Recommendation API will mostly consist of I/O bound calls to mw/pageview/wikidata endpoints. The Recommendation API should have a publicly accessible endpoint.
Beyond this initial use case, more Recommendation Types can be added to the Recommendation API as they’re vetted. These may have varying technical requirements and will likely require further collaboration before production infrastructure can support them. For example, the Related Article Recommendation Type needs a large computed matrix file.