Set kb_id to "" (empty string; id 0) instead of NIL for no prediction in entity_linker #9580
kinghuang
started this conversation in
New Features & Project Ideas
Replies: 1 comment 4 replies
-
Hi, I think our original reasoning was that there's a difference between "not set" and "no link possible". For instance, I myself am not represented in Wikidata, so any text including a reference to my name, should get a gold annotation |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When there is no prediction or an entity is discarded, the EntityLinker sets the kb_id to
NIL
, instead of an empty string. This means that there are two values for nokb_id
: an empty string (id 0) orNIL
.spaCy/spacy/pipeline/entity_linker.py
Line 105 in 5279c7c
spaCy/spacy/pipeline/entity_linker.py
Lines 331 to 332 in 5279c7c
I don't think the entity_linker should be using a special string,
NIL
, to represent nokb_id
. This complicates code, which can't depend onSpan.kb_id
orSpan.kb_id_
evaluating to a falsy value when there is nokb_id
. And, it differs from entity labels, where it is consistently an empty string for no label.Beta Was this translation helpful? Give feedback.
All reactions