MartinoMensio/spacy-dbpedia-spotlight

Handling errors gracefully upon spotlight errors

tsaltena opened this issue · 2 comments

My local server is returning errors due to this issue:
dbpedia-spotlight/dbpedia-spotlight-model#26

I did not find time yet to investigate whether that XML issue can be addressed, but for a testing setup locally this is causing problems when I'm batch feeding documents to a spacy pipeline with dbpedia.

I wrapped the request in a quick try/except statement in an own fork, but perhaps this is something to address is this library directly?

https://github.com/tsaltena/spacy-dbpedia-spotlight/blob/25962ffe175d90ce21130e6de779beafa36b83e4/spacy_dbpedia_spotlight/entity_linker.py#L116

Hi @tsaltena !
Thank you very much for reporting this issue.
That's surely something that needs to be configurable, e.g. setting the error tolerance while instantiating the pipeline stage:

  • ignore_exceptions = True to ignore the exceptions and go on
  • ignore_exceptions = False to be interrupted by exceptions

This parameter could be set within the nlp.add_pipe function call in the config parameter.

I will update this issue when this is implemented

The above has been implemented in version 0.2.2.
As in the documentation, you can use the parameter raise_http_errors to set a error-tolerant mode.

Martino