Skip to content

Instantly share code, notes, and snippets.

@niazangels
Last active April 24, 2017 08:04
Show Gist options
  • Save niazangels/9f76409e3ed4bfd50a9805f47188c1e3 to your computer and use it in GitHub Desktop.
Save niazangels/9f76409e3ed4bfd50a9805f47188c1e3 to your computer and use it in GitHub Desktop.
Explosion NER api
import requests
import json
url = "https://api.explosion.ai/displacy/ent/"
HEADER = {'Content-type': 'text/plain'}
while True:
data = {'text':raw_input(), 'model':'en'}
data = json.dumps(data)
print data
r = requests.post(url, data=data, headers=HEADER)
print r.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment