Use spancat with a Knowledge Base #12520
-
Hello, Is it possible to use spancat with a KB in order to identify label with an external ID ? Best regards, Alex. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi Alex! In order to assign a KB ID, you’ll need an entity linking module within your pipeline. You can use the EntityLinker component within spaCy, for more resources you can check out this video on Training a custom entity linking model or this talk about entity linking from spaCy IRL or this example project. To add the Entity Linker component to your pipeline with Spancat, you’ll have to save the entities into the |
Beta Was this translation helpful? Give feedback.
Hi Alex! In order to assign a KB ID, you’ll need an entity linking module within your pipeline. You can use the EntityLinker component within spaCy, for more resources you can check out this video on Training a custom entity linking model or this talk about entity linking from spaCy IRL or this example project.
To add the Entity Linker component to your pipeline with Spancat, you’ll have to save the entities into the
doc.ents
property. While NER models save directly todoc.ents
, Spancat automatically stores the output intodoc.spans
, but you should be able to copy the spans over to thedoc.ents
property if the spans are non-overlapping. You can then run the EntityLinker to link the spans …