Skip to content

Instantly share code, notes, and snippets.

@raulgarreta
Created August 28, 2015 02:26
Show Gist options
  • Save raulgarreta/36d66e908a964b6547d4 to your computer and use it in GitHub Desktop.
Save raulgarreta/36d66e908a964b6547d4 to your computer and use it in GitHub Desktop.
import requests
import json
data = {
'text_list': ["This is a text to try language detection.",
"This is some more text"]
}
response = requests.post(
"https://api.monkeylearn.com/v2/classifiers/cl_oJNMkt2V/classify/",
data=json.dumps(data),
headers={'Authorization': 'Token <YOUR TOKEN GOES HERE>',
'Content-Type': 'application/json'})
print json.loads(response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment