-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Basic framework and APIs for entity linker #3459
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ines
added
enhancement
Feature requests and improvements
feat / ner
Feature: Named Entity Recognizer
feat / pipeline
Feature: Processing pipeline and components
labels
Mar 22, 2019
ines
reviewed
Mar 22, 2019
ibeltagy
reviewed
Mar 25, 2019
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
Feature requests and improvements
feat / ner
Feature: Named Entity Recognizer
feat / pipeline
Feature: Processing pipeline and components
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is the first to start adressing Issue #3339 to implement Entity Linking functionality in spaCy. While most functionality is still "dummy", any feedback on the code structuring & API's is welcome before continuing with the next bit of work. I'd expect some of this code to still change quite a bit when we actually start implementing non-dummy algorithms.
Description
Basic architecture and APIs for Entity Linking functionality:
spans and their underlying tokens get a
kb_id
andent_kb_id
field respectivelyadded a pipe called
el
tonlp
, referring to an instance ofEntityLinker
The current implementation of
EntityLinker
simply selects the candidate entity with highest prior probability.kb.pxd
andkb.pyd
hold the knowledge base (based on @honnibal's notes)Candidate
is an object generated from the candidate_generator and used as input to the actualEntityLinker
vocab
) and then to Entry index (using_entry_index
). The entry index then points to an_EntryC
struct (ID, name, features, ...) in the_entries
vectorvocab
) and then to Alias index (using_alias_index
). The alias index then points to an_AliasC
struct (entry candidates + prior probs) in the_aliases_table
vectoradded some unit tests to check the above behaviour
kb_id
in spanexamples/pipeline/dummy_entity_linking.py
: Shows how the current functionality worksOpen questions
get_candidates
is sort of inbetween the internal KB structure and the actual implementation of the Entity Linker --> not sure where to put it. Currently part ofkb.pyx
. Different algorithms should be able to overwrite its behaviour but then again that may also influence the actual storage in KB (e.g. case invariance: "Douglas", "DOUGLAS" and "douglas" all mapping to the same entries/candidates). Something to think about :-)should we always assume there is a
vocab
fromnlp
, or should we have it as optional argument and create a new one if none was given?Issues not yet addressed
Types of change
New feature
Checklist