NER_ARMAN_parsbert
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.
Usage
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}]]
- Downloads last month
- 47
Inference API (serverless) has been turned off for this model.