Instructions to use KBayoud/pv-darija-ner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KBayoud/pv-darija-ner with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="KBayoud/pv-darija-ner")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("KBayoud/pv-darija-ner") model = AutoModelForTokenClassification.from_pretrained("KBayoud/pv-darija-ner", device_map="auto") - Notebooks
- Google Colab
- Kaggle
pv-darija-ner
Finds personal information (PII) in Moroccan Arabic (Darija) text. Multilingual Privacy Vault uses it on speech transcripts to find the PII it then removes from the audio.
Model
- BERT-base token classifier: 12 layers, 768 hidden, 64k WordPiece vocab, up to 512 tokens.
- Fine-tuned from
hananour/darija-ner(general Darija NER, trained on DarNERcorp) to tag PII instead. - The vault uses it on its own for Darija.
Labels
BIO tags (B-/I-) for 5 entity types, plus O for everything else:
| Entity | Meaning |
|---|---|
NAME |
Person name |
PHONE_NUMBER |
Phone number |
CIN |
National ID card number |
EMAIL |
Email address |
LOCATION |
Location |
Usage
Private repo: you need a Hugging Face token with access to it.
In the Privacy Vault repo (token in HF_TOKEN, hf.token or hf auth login):
uv run python scripts/download_models.py --languages darija
This puts the model in artifacts/dev/models/ner/darija-ner.
Directly with transformers:
from transformers import pipeline
ner = pipeline("token-classification", model="KBayoud/pv-darija-ner", token="hf_...")
ner("...")
- Downloads last month
- -
Model tree for KBayoud/pv-darija-ner
Base model
hananour/darija-ner