Views
No views yet

gliner_arabic-v2.1 is a specialized Named Entity Recognition (NER) model designed for processing Arabic text with high accuracy and robustness. Built on top of the urchade/gliner_large-v2 base model, this version has been fine-tuned to excel in identifying a wide range of entities in Arabic, making it suitable for applications requiring rich entity extraction in Arabic-language datasets. The model also supports English to a limited extent, enabling cross-lingual use cases.ar) with auxiliary support for English (en).NAMAA-Space/gliner_arabic-v2.1ar), English (en)urchade/gliner_multi-v2.1gliner_arabic-v2.1 model is ideal for:gliner_arabic-v2.1 model, you need to have the gliner library installed. You can install it via pip:pip install glinerurchAde/gliner_large-v2 base model.1from gliner import GLiNER
2
3# Load the model
4model = GLiNER.from_pretrained("NAMAA-Space/gliner_arabic-v2.1")
5
6# Example text (Arabic)
7text = "غزة، مدينة يصمد شعبها الفلسطيني المحاصر بقلوب كالصخر، يواجهون الإبادة الجماعية من الكيان الصهيوني برعاية أمريكية وخذلان العالم أجمع، حيث يقاوم أهلها، بقيادة يحيى السنوار ومحمد الضيف، مع فصائل حماس تحت القصف والحصار والموت منذ 7 أكتوبر 2023، وسط صمت الأمم المتحدة والاتحاد الأوروبي، بينما تجري مفاوضات في القاهرة بوساطة مصر وقطر."
8labels = ["شخص", "منظمة", "تاريخ", "موقع"]
9
10# Perform entity prediction
11entities = model.predict_entities(text, labels, threshold=0.5)
12
13# Display predicted entities and their labels
14for entity in entities:
15 print(f"Entity: {entity['text']} | Label: {entity['label']} | Score: {entity['score']:.3f}")Entity: غزة | Label: موقع | Score: 0.797
Entity: الكيان الصهيوني | Label: منظمة | Score: 0.783
Entity: يحيى السنوار | Label: شخص | Score: 0.917
Entity: فصائل حماس | Label: منظمة | Score: 0.551
Entity: حماس | Label: منظمة | Score: 0.588
Entity: 7 أكتوبر 2023 | Label: تاريخ | Score: 0.837
Entity: الأمم المتحدة | Label: منظمة | Score: 0.823
Entity: القاهرة | Label: موقع | Score: 0.773
Entity: مصر | Label: موقع | Score: 0.588urchade/gliner_large-v2 model and the GLiNER framework. We thank the open-source community for their contributions to Arabic NLP