'Adding a tag to an entity in spaCy's displaCy named entity visualizer

Is there a way to use spaCy's displaCy Named Entity Visualizer and add an additional term after the entity's type? Our application tries to link each entity mention to a Wikidata item. We'd like to include a Wikidata QID after the type if one is found.



Solution 1:[1]

No, the Named Entity Visualizer doesn't support that.

It's a pretty recent feature but I believe the span visualizer can do what you want. You should save your WikiData IDs using the kb_id property on spans, similar to how the Entity Linker works, and then you can add links directly.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 polm23