-
-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Hi,
Thanks for your efforts developing the model.
I am trying to load the NER model, but I am getting strange results as an output. Do you have any thoughts for why that's the case?
- Code:
from transformers import pipeline
from transformers import AutoTokenizer, AutoModelForTokenClassification
NER_model_name = "SinaLab/ArabicWojood-FlatNER"
tokenizer = AutoTokenizer.from_pretrained(NER_model_name)
model = AutoModelForTokenClassification.from_pretrained(NER_model_name)
ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer)
def get_ne(text):
output = ner_pipeline(text)
return {"text": text, "entities": output}
get_ne("أنا اسمي محمد")
- Output:
{'text': 'أنا اسمي محمد',
'entities': [{'entity': 'B-FAC',
'score': 0.111766666,
'index': 1,
'word': 'انا',
'start': 0,
'end': 3},
{'entity': 'B-FAC',
'score': 0.08029653,
'index': 2,
'word': 'اسمي',
'start': 4,
'end': 8},
{'entity': 'B-FAC',
'score': 0.072174296,
'index': 3,
'word': 'محمد',
'start': 9,
'end': 13}]}
Metadata
Metadata
Assignees
Labels
No labels