This model fine-tuned for the Named Entity Recognition (NER) task on a mixed NER dataset collected from
ARMAN,
PEYMA, and
WikiANN that covered ten types of entities:
The following tables summarize the scores obtained by model overall and per each class.
You use this model with Transformers pipeline for NER.
1from transformers import AutoTokenizer
2from transformers import AutoModelForTokenClassification # for pytorch
3from transformers import TFAutoModelForTokenClassification # for tensorflow
4from transformers import pipeline
5
6
7model_name_or_path = "HooshvareLab/distilbert-fa-zwnj-base-ner"
8tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
9model = AutoModelForTokenClassification.from_pretrained(model_name_or_path) # Pytorch
10# model = TFAutoModelForTokenClassification.from_pretrained(model_name_or_path) # Tensorflow
11
12nlp = pipeline("ner", model=model, tokenizer=tokenizer)
13example = "در سال ۲۰۱۳ درگذشت و آندرتیکر و کین برای او مراسم یادبود گرفتند."
14
15ner_results = nlp(example)
16print(ner_results)
Post a Github issue on the
ParsNER Issues repo.