Adding Metadata to NER #8935
wjbmattingly
started this conversation in
Help: Best practices
Replies: 1 comment 1 reply
-
Spans are Cython objects so you can't add attributes directly to them without recompiling, so I suspect you were using user attributes (via the underscore). The docs have an example that uses lat/long, using user attributes. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What is the best way to implement the addition of metadata to a span?
I remember in spaCy 2 there was a way to add additional items, such as label_, lat_ long_, but I cannot remember how I implemented that and I cannot seem to find the solution in the spaCy 3 docs at the moment. I have tried a few keyword searches in the forum but cannot find it there either.
Right now, I am using set_extension, but I seem to recall being able to set it up so that I could iterate over the entities and grab items such as ent.label_ as well as ent.latitude_, ent.longitude_ etc., rather than having to do ._.extension_name
Am I misremembering something here?
Just a nudge to the section of the docs is all I need here.
Thanks everyone!
Beta Was this translation helpful? Give feedback.
All reactions