Rendering custom entities with displacy: creating a custom Doc ? #7239
-
Hello and thanks for the quality of this project ! I have a text string with a set of fixed custom named entities (person, location, ...) as shown in the example below text = "My name is John Smith and I live in Paris"
entities = [
("Employee", 11, 21), # John Smith
("Location", 36, 41), # Paris
] and I would like to display them using Displacy [1]. However, Thanks a lot for your help! EDIT: BTW I just noticed that the new spacy 3.0 version supports my use-case (we can input ents to Doc!) but it's currently a bit hard for me to upgrade everything. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The method on the Doc object isn't present in v2 but you can create custom spans and set the
|
Beta Was this translation helpful? Give feedback.
The method on the Doc object isn't present in v2 but you can create custom spans and set the
.ents
property.