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

EntityLinker predict function loops through ents instead of sents #4772

Closed
lilysikes opened this issue Dec 5, 2019 · 4 comments · Fixed by #4779
Closed

EntityLinker predict function loops through ents instead of sents #4772

lilysikes opened this issue Dec 5, 2019 · 4 comments · Fixed by #4779
Labels
bug Bugs and behaviour differing from documentation feat / nel Feature: Named Entity linking

Comments

@lilysikes
Copy link

lilysikes commented Dec 5, 2019

The predict function loops through ents twice instead of looping through the sents. The code should be

for sent in doc.sents:
                    sent_doc = sent.as_doc()
                    # currently, the context is the same for each entity in a sentence (should be refined)
                    sentence_encoding = self.model([sent_doc])[0]
                    xp = get_array_module(sentence_encoding)
                    sentence_encoding_t = sentence_encoding.T
                    sentence_norm = xp.linalg.norm(sentence_encoding_t) ...
@lilysikes lilysikes reopened this Dec 5, 2019
@adrianeboyd adrianeboyd added feat / nel Feature: Named Entity linking bug Bugs and behaviour differing from documentation labels Dec 6, 2019
@adrianeboyd
Copy link
Contributor

Thanks, that does look like a bug!

@svlandeg
Copy link
Member

svlandeg commented Dec 6, 2019

Oh wow, good catch, thanks !

@svlandeg svlandeg mentioned this issue Dec 6, 2019
3 tasks
@lilysikes
Copy link
Author

No problem!

@ines ines closed this as completed in #4779 Dec 6, 2019
@lock
Copy link

lock bot commented Jan 5, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs and behaviour differing from documentation feat / nel Feature: Named Entity linking
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants