-
Notifications
You must be signed in to change notification settings - Fork 29
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
Unexpectedly (bad) predictions? #20
Comments
Hello! Thanks for your report. tl;dr: You can avoid these issues:
In more details now: As for your first comment, I've previously encountered issues that the model simply could not include the last token as an entity (#1), but since fixing that one, most of the models still tend not to include the last token as an entity, even if it's an obvious one like As for the second issue: The multilingual model was trained on English data exclusively, meaning that the multilingual behaviour must originate from the underlying XLM-RoBERTa-large encoder. This may be related to how When using a model in practice, you can also provide a list of words, e.g. I'll see if there are things I can do to improve the performance under these two circumstances.
|
Interesting! So, the pretrained models are then all intended for English NER, right? I'm going to try out cleaning/tokenising myself and then passing the processed input to the model. Thanks for the feedback 👍 |
The I just remembered, the spaCy integration automatically does this conversion to words. import spacy
# Load the spaCy model with the span_marker pipeline component
nlp = spacy.load("en_core_web_sm", exclude=["ner"])
nlp.add_pipe("span_marker",
config={"model": "tomaarsen/span-marker-xlm-roberta-base-fewnerd-fine-super"}
)
# Feed some text through the model to get a spacy Doc
text = "Ik woon in Amsterdam, in Nederland."
doc = nlp(text)
# And look at the entities
print([(entity, entity.label_) for entity in doc.ents])
"""
[(Amsterdam, 'location-GPE'), (Nederland, 'location-GPE')]
"""
from spacy import displacy
displacy.serve(doc, style="ent") |
I've narrowed this down to the |
I'll close this in favor of #23, as I've narrowed down the issue. The BERT-based models function as expected. |
I'm just trying out the pretrained models accompanying this repo via HF Spaces and I'm seeing some weird results.
Am I using the pretrained models wrong? Is it expecting different kinds of inputs?
I can elaborate and test more, but I figured I'd post this first. 😊
Thanks!
The text was updated successfully, but these errors were encountered: