0

I am trying to find resource name from the text using pyspotlight.suppose the text is "Barack Obama is tall" ,then the program should return Barack Obama as dbpedia resource.But the program showing "equests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://github.com/dbpedia-spotlight/dbpedia-spotlightrest/" error.How to solve it.

import spotlight

annotations = spotlight.annotate('http://spotlight.dbpedia.org/rest/','Barack Obama is tall',confidence=0.4, support=20)

print(annotations)

File "word.py", line 2, in annotations = spotlight.annotate('http://spotlight.dbpedia.org/rest/','Barack Obama is tall',confidence=0.4, support=20)

File "/home/junlplab/.local/lib/python2.7/site-packages/spotlight/init.py", line 189, in annotate

pydict = _post_request(address, payload, filters, headers)

File "/home/junlplab/.local/lib/python2.7/site-packages/spotlight/init.py", line 51, in _post_request

response.raise_for_status()

File "/home/junlplab/.local/lib/python2.7/site-packages/requests/models.py", line 937, in raise_for_status raise HTTPError(http_error_msg, response=self)

requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://github.com/dbpedia-spotlight/dbpedia-spotlightrest/

1 Answers1

1

decreasing confidence and support may gives requested answer, try this:

annotations = spotlight.annotate('http://spotlight.dbpedia.org/rest/','Barack Obama is tall',confidence=0.0, support=0)
serious sam
  • 209
  • 1
  • 7
  • `annotations = spotlight.annotate('https://api.dbpedia-spotlight.org/en/annotate', 'Barack Obama is tall', confidence=0.4, support=20)` worked for me. – Superdooperhero Jan 06 '20 at 09:04