egerber / spaCy-entity-linker

spaCy module for linking text to Wikidata items
MIT License
215 stars 32 forks source link

Unexpected keyword argument `max_depth` #19

Closed dennlinger closed 1 year ago

dennlinger commented 1 year ago

The below code snippet is responsible for a bug, causing a TypeError: get_chain() got an unexpected keyword argument 'max_depth', due to an incorrect call to self.get_chain().

https://github.com/egerber/spaCy-entity-linker/blob/9f68ae5d875ffe4c9f30ad25e1e901aa971ecfe7/spacy_entity_linker/EntityElement.py#L82-L86

It isn't immediately obvious to me what the correct code should be, but a fix should be relatively trivial if the expected behavior is known.

MartinoMensio commented 1 year ago

Hi @dennlinger , I added a fix to the get_chain method, I hope this solves the issue. I also added a test that is checking that. As I only recently became a maintainer of this package, could you check and see if this is effectively fixing your issue?

Martino

dennlinger commented 1 year ago

I only realized this when looking over the code (thanks PyCharm code highlights!), which is why I wasn't exactly sure what the intended use was :D
However, testing locally, it works now, thanks for the quick fix! :tada:

MartinoMensio commented 1 year ago

You're welcome! Your issues are very helpful to find untested code in this library! :)