Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling errors gracefully upon spotlight errors #7

Closed
tsaltena opened this issue Aug 12, 2021 · 2 comments
Closed

Handling errors gracefully upon spotlight errors #7

tsaltena opened this issue Aug 12, 2021 · 2 comments

Comments

@tsaltena
Copy link

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

@MartinoMensio
Copy link
Owner

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

@MartinoMensio
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants