Downloads · 30 days
25
38% of all-time downloads
PardisSzah/Persian_NER_parsbert
Persian_NER_parsbert is a token classification model from PardisSzah. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as mit.
This model is fine-tuned for Named Entity Recognition task. It has been fine-tuned on ARMAN Dataset, using the pretrained model bert-base-parsbert-ner-uncased.
Downloads · 30 days
25
38% of all-time downloads
All-time downloads
65
Public
Parameters
162M
649 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors649 MB · 99%
From the Hugging Face model README
This model is fine-tuned for Named Entity Recognition task. It has been fine-tuned on ARMAN Dataset, using the pretrained model bert-base-parsbert-ner-uncased.
def predict(input_text):
nlp = pipeline("ner", model="PardisSzah/Persian_NER_parsbert")
output_predictions = []
for sequence in input_text:
result = nlp(sequence)
output_predictions.append(result)
return output_predictions
text = [
"علی اکبری در روز شنبه به دیدن مادرش مریم حسنی رفت و بعد به بیمارستان ارتش سر زد"
]
output = predict(text)
print(output)
# output: [[{'entity': 'B-person', 'score': 0.9998951, 'index': 1, 'word': 'علی', 'start': 0, 'end': 3}, {'entity': 'I-person', 'score': 0.9999027, 'index': 2, 'word': 'اکبری', 'start': 4, 'end': 9}, {'entity': 'B-person', 'score': 0.9998709, 'index': 9, 'word': 'مریم', 'start': 36, 'end': 40}, {'entity': 'I-person', 'score': 0.9996691, 'index': 10, 'word': 'حسنی', 'start': 41, 'end': 45}, {'entity': 'B-facility', 'score': 0.9561743, 'index': 15, 'word': 'بیمارستان', 'start': 59, 'end': 68}, {'entity': 'I-facility', 'score': 0.9976502, 'index': 16, 'word': 'ارتش', 'start': 69, 'end': 73}]]