Skip to content

Instantly share code, notes, and snippets.

@halfak
Created October 1, 2019 20:20
Show Gist options
  • Select an option

  • Save halfak/1da2fa804eaabe896078461c550ef3be to your computer and use it in GitHub Desktop.

Select an option

Save halfak/1da2fa804eaabe896078461c550ef3be to your computer and use it in GitHub Desktop.
>>> from ores import api
>>>
>>> ores_session = api.Session("https://ores.wikimedia.org", "Class project <jmorgan@wikimedia.org>")
>>>
>>> results = ores_session.score("enwiki", ["articlequality"], [1234, 5678, 91011])
>>>
>>> for score in results:
... print(score)
...
{'articlequality': {'score': {'prediction': 'B', 'probability': {'GA': 0.005565225912988614, 'Stub': 0.285072978841463, 'C': 0.1237249061020009, 'B': 0.2910788689339172, 'Start': 0.2859984921969326, 'FA': 0.008559528012697881}}}}
{'articlequality': {'score': {'prediction': 'Start', 'probability': {'GA': 0.005264197821210708, 'Stub': 0.40368617053424666, 'C': 0.021887833774629408, 'B': 0.029933164235917967, 'Start': 0.5352849001253548, 'FA': 0.0039437335086407645}}}}
{'articlequality': {'score': {'prediction': 'Stub', 'probability': {'GA': 0.0033975128938096197, 'Stub': 0.8980284163392759, 'C': 0.01216786960110309, 'B': 0.01579141569356552, 'Start': 0.06809640787450176, 'FA': 0.0025183775977442226}}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment