0

I have an entity extraction tasks which needs KBs like wikidata, freebase, DBpedia. Given the huge size of them, it is hard to download and extract entities from them. Is there a python client which can make API calls to get the extractions through them with unstructured text as input?

Amogh Mishra
  • 1,088
  • 1
  • 16
  • 25

1 Answers1

1

For DBPedia at least, you can use DBPedia Spotlight, something like that:

spotlight_url = 'http://api.dbpedia-spotlight.org/en/annotate?'
params = dict(text="Barack Obama was a president", confidence='0.2', support='10')
headers = {'Accept':'application/json'}
resp = requests_retry_session().get(url=spotlight_url, params=params,headers=headers)
results = resp.json()

If you were to do loads of queries, you'd have a local install of the knowledge base in a triplestore and a local install of Spotlight too.

firefly
  • 51
  • 4