🚀 BERT-base_NER-ar
BERT-base_NER-ar is a fine - tuned BERT multilingual base model for Arabic Named Entity Recognition (NER). It leverages the "wikiann" dataset, offering case - sensitive NER capabilities and cross - lingual exploration potential.
🚀 Quick Start
Basic Usage
from transformers import AutoModelForTokenClassification, AutoTokenizer
import torch
model = AutoModelForTokenClassification.from_pretrained("ayoubkirouane/BERT-base_NER-ar")
tokenizer = AutoTokenizer.from_pretrained("ayoubkirouane/BERT-base_NER-ar")
text = "عاصمة فلسطين هي القدس الشريف."
tokens = tokenizer.tokenize(tokenizer.decode(tokenizer.encode(text)))
input_ids = tokenizer.convert_tokens_to_ids(tokens)
with torch.no_grad():
outputs = model(torch.tensor([input_ids]))
predicted_labels = outputs[0].argmax(dim=2).cpu().numpy()[0]
predicted_labels = [model.config.id2label[label_id] for label_id in predicted_labels]
for token, label in zip(tokens, predicted_labels):
print(f"Token: {token}, Label: {label}")
✨ Features
- Case - Sensitive NER: Capable of distinguishing between different letter cases, enhancing recognition accuracy.
- Multilingual Support: Can be used for NER in multiple languages supported by the "wikiann" dataset.
- Cross - Lingual Exploration: Allows for zero - shot cross - lingual NER tasks.
📦 Installation
No specific installation steps are provided in the original document.
📚 Documentation
Model Description
BERT-base_NER-ar is a fine - tuned BERT multilingual base model for Named Entity Recognition (NER) in Arabic. The base model was pretrained on a diverse set of languages and fine - tuned specifically for the task of NER using the "wikiann" dataset. This model is case - sensitive, distinguishing between different letter cases, such as "english" and "English."
Dataset
The model was fine - tuned on the wikiann dataset, which is a multilingual named entity recognition dataset. It contains Wikipedia articles annotated with three types of named entities: LOC (location), PER (person), and ORG (organization). The annotations are in the IOB2 format. The dataset supports 176 of the 282 languages from the original WikiANN corpus.
Supported Tasks and Leaderboards
The primary supported task for this model is named entity recognition (NER) in Arabic. However, it can also be used to explore the zero - shot cross - lingual capabilities of multilingual models, allowing for NER in various languages.
Use Cases
- Arabic Named Entity Recognition: BERT-base_NER-ar can be used to extract named entities (such as names of people, locations, and organizations) from Arabic text. This is valuable for information retrieval, text summarization, and content analysis in Arabic language applications.
- Multilingual NER: The model's multilingual capabilities enable it to perform NER in other languages supported by the "wikiann" dataset, making it versatile for cross - lingual NER tasks.
Limitations
- Language Limitation: While the model supports multiple languages, it may not perform equally well in all of them. Performance could vary depending on the quality and quantity of training data available for specific languages.
- Fine - Tuning Data: The model's performance is dependent on the quality and representativeness of the fine - tuning data (the "wikiann" dataset in this case). If the dataset is limited or biased, it may affect the model's performance.
🔧 Technical Details
The model is based on a fine - tuned BERT multilingual base model. The base model was pre - trained on a diverse set of languages and then fine - tuned for the NER task using the "wikiann" dataset. The case - sensitivity of the model is an important feature, which helps in more accurate entity recognition.
📄 License
No license information is provided in the original document.