NER-Moroccan-Darija
This is a Named Entity Recognition (NER) model trained on Moroccan Darija text using a BERT-based model and CRF. It was trained to recognize various entities such as locations, organizations, people, and miscellaneous categories in Moroccan Darija.
Model Details
- Model Architecture: BERT + CRF
- Language: Moroccan Darija
- Task: Named Entity Recognition (NER)
- Number of Entities: (Specify the number of unique tags you used)
Model Usage
You can use this model for Named Entity Recognition (NER) in Moroccan Darija text. Here's an example of how to use it:
from transformers import AutoTokenizer, AutoModelForTokenClassification
from torch.nn import functional as F
# Load the model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("mohannad-tazi/NER-Moroccan-Darija")
model = AutoModelForTokenClassification.from_pretrained("mohannad-tazi/NER-Moroccan-Darija")
# Input sentence
sentence = "ุฃุฑูุฏ ู
ุนุฑูุฉ ุญุงูุฉ ุงูุทูุณ ูู ุงูุฏุงุฑ ุงูุจูุถุงุก"
# Tokenize the input text
inputs = tokenizer(sentence, return_tensors="pt")
# Perform the prediction
outputs = model(**inputs).logits
# Get predicted token class IDs
predictions = torch.argmax(outputs, dim=-1)
# Decode the predictions to labels
labels = [model.config.id2label[pred.item()] for pred in predictions[0]]
print(f"Predicted labels: {labels}")
- Downloads last month
- 26
Model tree for mohannad-tazi/NER-Moroccan-Darija
Base model
aubmindlab/bert-base-arabertv02