marefa-ner / README.md
marefa's picture
Update README.md
f19418d
|
raw
history blame
3.37 kB
metadata
language: ar
datasets:
  - Marefa-NER

Tebyan تبيـان

Marefa Arabic Named Entity Recognition Model

نموذج المعرفة لتصنيف أجزاء النص

Model description

Marefa-NER is a Large Arabic NER model built on a completely new dataset and targets to extract up to 9 different types of entities

Person, Location, Organization, Nationality, Job, Product, Event, Time, Art-Work

نموذج المعرفة لتصنيف أجزاء النص. نموذج جديد كليا من حيث البيانات المستخدمة في تدريب النموذج. كذلك يستهدف النموذج تصنيف حتى 9 أنواع مختلفة من أجزاء النص

شخص - مكان - منظمة - جنسية - وظيفة - منتج - حدث - توقيت - عمل إبداعي

How to use كيف تستخدم النموذج

Install transformers AND nltk

$ pip3 install transformers==4.3.0 nltk==3.5

If you are using Google Colab, please restart your runtime after installing the packages.


# we need to install NLTK punkt to be used for word tokenization
import nltk
nltk.download('punkt')
from nltk.tokenize import word_tokenize

from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline

# ===== import the model
m_name = "marefa-nlp/marefa-ner"
tokenizer = AutoTokenizer.from_pretrained(m_name)
model = AutoModelForTokenClassification.from_pretrained(m_name)

# ===== build the NER pipeline
nlp = pipeline("ner", model=model, tokenizer=tokenizer, grouped_entities=True)

# ===== extract the entities from a sample text
example = 'قاد عمر المختار القوات في ليبيا ضد الجيش الإيطالي'
# clean the text
example = " ".join(word_tokenize(example))
# feed to the NER model to parse
ner_results = nlp(example)

# ===== print the ner_results
for ent in ner_results:
  print(ent["word"], '->' ,ent['entity_group'], " # score:", "%.2f" % ent['score'])
  
#####
# عمر المختار -> person  # score: 1.00
# ليبيا -> location  # score: 0.99
# الجيش الإيطالي -> organization  # score: 0.99
####

Acknowledgment شكر و تقدير

قام بإعداد البيانات التي تم تدريب النموذج عليها, مجموعة من المتطوعين الذين قضوا ساعات يقومون بتنقيح البيانات و مراجعتها

  • على سيد عبد الحفيظ - إشراف
  • نرمين محمد عطيه
  • احمد علي عبدربه
  • عمر بن عبد العزيز سليمان
  • محمد ابراهيم الجمال
  • عبدالرحمن سلامه خلف
  • إبراهيم كمال محمد سليمان
  • حسن مصطفى حسن
  • أحمد فتحي سيد
  • عثمان مندو
  • عارف الشريف
  • أميرة محمد محمود
  • حسن سعيد حسن
  • عبد العزيز علي البغدادي
  • واثق عبدالملك الشويطر
  • عمرو رمضان عقل الحفناوي
  • حسام الدين أحمد على
  • أسامه أحمد محمد محمد
  • حاتم محمد المفتي
  • عبد الله دردير
  • أدهم البغدادي
  • أحمد صبري
  • عبدالوهاب محمد محمد
  • أحمد محمد عوض