Closed manzoorali29 closed 2 years ago
Hi @manzoorali29 ,
To understand what is going on with your example, I would suggest you try the following and send me the logs when it fails:
# normal loading
import spacy
nlp = spacy.blank('en')
# when loading the pipeline, specify the debug option
nlp.add_pipe('dbpedia_spotlight', config={'debug': True})
# now try performing the entity recognition/linking and take a look at the logs
nlp('Is everything working ok?').ents
I think the problem could be one of the following:
It is for me difficult to understand where the problem could be if I don't know:
Could you provide me with a minimal working example? Include the lines of code that you use to set up the nlp object and an example of a document giving you the error.
Best, Martino
Thanks @MartinoMensio for the quick response. I have run your code and get the following output.
import spacy nlp = spacy.blank('en')
nlp.add_pipe('dbpedia_spotlight', config={'debug': True})
nlp('Is everything working ok?').ents
2022-09-28 07:41:03.374 | DEBUG | spacy_dbpedia_spotlight.entity_linker:dbpedia_spotlight_factory:52 - dbpedia_spotlight_factory: <spacy.lang.en.English object at 0x7fbe301ffc40>, language_code: None, dbpedia_rest_endpoint: None, process: annotate, confidence: None, support: None, types: None, sparql: None, policy: None, overwrite_ents: True 2022-09-28 07:41:03.374 | DEBUG | spacy_dbpedia_spotlight.entity_linker:dbpedia_spotlight_factory:57 - nlp.meta["lang"]=en 2022-09-28 07:41:03.377 | DEBUG | spacy_dbpedia_spotlight.entity_linker:call:103 - api_endpoint has been built as https://api.dbpedia-spotlight.org/en 2022-09-28 07:41:05.800 | ERROR | spacy_dbpedia_spotlight.entity_linker:call:130 - Endpoint https://api.dbpedia-spotlight.org/en unreachable, please check your connection. Document not updated. 2022-09-28 07:41:05.802 | DEBUG | spacy_dbpedia_spotlight.entity_linker:call:131 - HTTPSConnectionPool(host='api.dbpedia-spotlight.org', port=443): Max retries exceeded with url: /en/annotate (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fbdca209360>: Failed to establish a new connection: [Errno -2] Name or service not known')) Out[23]: ()
Hi @manzoorali29 ,
looking at your logs, I think you might have some DNS issues on your machine (Name or service not known
). Can you please check if you are able to load the swagger API from a web browser here https://www.dbpedia-spotlight.org/api ? On that page insert some example text and try to see if you get a response back (HTTP status code 200, as shown in the bottom of this image).
If you are unable to load the page, please try to check your DNS configuration or use a VPN. In this case, it is not a issue of this library but instead is on your network. Try changing your default DNS server: https://developers.google.com/speed/public-dns/docs/using and see if the issue is resolved.
If instead, you are able to load the page, it might be something else. Do you have the latest version of this library installed? (v0.2.1).
Best, Martino
Thanks @MartinoMensio Yes, true, it was an issue on my side.
I am unable to run spacy-dbpedia-spotlight with the following error message:
spacy_dbpedia_spotlight.entity_linker:call:130 - Endpoint https://api.dbpedia-spotlight.org/en unreachable, please check your connection. Document not updated.
A quick response will be appreciated. Thanks in advance.