-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotating BILOU tags from another system #461
Comments
You should be able to do: doc.ents = [(label, start, end) for (label, start, end) in ents] Example --- label "best buy" as a retailer: nlp.entity.add_label(u'RETAILER')
retailer = nlp.strings[u'RETAILER')
doc = nlp(u'best buy is a pretty bad store')
doc.ents = [(retailer, 0, 2)]
span = doc[0:2]
best_buy = list(doc.ents)[0]
assert span.start == best_buy.start == 0
assert span.end == best_buy.end == 2 The API here isn't so polished. I'm surprised that the Here's some more detailed usage description:
Finally, here's the relevant code: https://github.com/spacy-io/spaCy/blob/master/spacy/tokens/doc.pyx#L178 |
@syllog1sm awesome, thanks for the information. |
@syllog1sm couple of follow ups.
Questions,
|
Thanks for the report — fixed.
Currently the |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I have a domain specific NER system that generates BILOU tags for a given sentence. What would be the best way to integrate this information into spacy?
In #187, there's an example of how to train the system on new data. But I'm not entirely sure if there's way to do something like,
The text was updated successfully, but these errors were encountered: