Wikipedia

class orangecontrib.text.wikipedia_api.WikipediaAPI(on_error=None)[source]

Wraps Wikipedia API.

Examples

>>> api = WikipediaAPI()
>>> corpus = api.search('en', ['Barack Obama', 'Hillary Clinton'])
__init__(on_error=None)[source]
search(lang, queries, articles_per_query=10, should_break=None, on_progress=None)[source]

Searches for articles.

Parameters
  • lang (str) – A language code in ISO 639-1 format.

  • queries (list of str) – A list of queries.

  • should_break (callback) – Callback for breaking the computation before the end. If it evaluates to True, downloading is stopped and document downloaded till now are returned in a Corpus.

  • on_progress (callable) – Callback for progress bar.