File size: 1,439 Bytes
e920765
a427ef7
e920765
a427ef7
 
e920765
a427ef7
 
 
5856eff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
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}]]