# Python 3
# Get a score from the Revscoring Goodfaith model for the revision 12345 of English Wikipedia.
import json
import requests
use_auth = False
inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-goodfaith:predict'
if use_auth:
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)'
}
else:
headers = {}
data = {"rev_id": 12345 }
response = requests.post(inference_url, headers=headers, data=json.dumps(data))
print(response.json())