NER_ARMAN_parsbert / README.md
PardisSzah's picture
Update README.md
cbbeb92 verified
---
language: fa
license: mit
pipeline_tag: token-classification
inference: false
---
# 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](https://huggingface.co/HooshvareLab/bert-base-parsbert-ner-uncased).
## Usage
```python
def predict(input_text):
nlp = pipeline("ner", model="PardisSzah/NER_ARMAN_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}]]