Instructions to use Rishabh157/unified-multilingual-ner-mdeberta with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Rishabh157/unified-multilingual-ner-mdeberta with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="Rishabh157/unified-multilingual-ner-mdeberta")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("Rishabh157/unified-multilingual-ner-mdeberta") model = AutoModelForTokenClassification.from_pretrained("Rishabh157/unified-multilingual-ner-mdeberta", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Unified Multilingual NER (mDeBERTa-v3-base)
Unified Multilingual NER (mDeBERTa-v3-base)
This model is a fine-grained Multilingual Named Entity Recognition (NER) model fine-tuned on 1.53+ million sentences across three major benchmark suites:
Built on top of microsoft/mdeberta-v3-base, it supports 47 fine-grained entity categories (95 BIO logit tags) across 12+ languages.
Developed by Rishabh Kumar.
1. Model Description & Architecture
- Base Model:
microsoft/mdeberta-v3-base(278M parameters, 12 Transformer layers, 768 hidden size, 250k vocabulary) - Fine-Tuning Method: LoRA (Low-Rank Adaptation, r=64, α=64, target modules:
query_proj,key_proj,value_proj,intermediate.dense,output.dense) merged into standalone base weights. - Precision: FP16 (
torch.float16, ~530 MB footprint) - Task: Multilingual Token Classification / Named Entity Recognition
- Languages Supported (15): English (
en), Spanish (es), French (fr), German (de), Italian (it), Portuguese (pt), Swedish (sv), Dutch (nl), Polish (pl), Russian (ru), Farsi (fa), Bengali (bn), Hindi (hi), Ukrainian (uk), Chinese (zh), and multilingual mixed text.
2. Dataset Links & Entity Taxonomy
The model combines the taxonomy of three major Hugging Face NER datasets into a single unified classification head (47 × 2 + 1 = 95 BIO output logits):
A. WikiANN (3 Core Broad Categories)
- Languages Included (7): German (
de), English (en), Spanish (es), French (fr), Italian (it), Portuguese (pt), Swedish (sv) - Entity Classes:
PER(Person),LOC(Location),ORG(Organization)
B. MultiNERD (15 Multi-Domain Categories)
- Languages Included (10): German (
de), English (en), Spanish (es), French (fr), Italian (it), Dutch (nl), Polish (pl), Portuguese (pt), Russian (ru), Chinese (zh) - Standard:
PER,LOC,ORG,TIME - Specialized Domains:
ANIM(Animal species, breeds, fauna)PLANT(Plants, trees, botanical species, fungi)FOOD(Food, dishes, beverages, culinary items)DIS(Diseases, disorders, medical conditions)CEL(Celestial bodies, stars, planets, galaxies)EVE(Historical, sports, cultural events)INST(Public institutions, international bodies)MEDIA(Newspapers, networks, press outlets)MYTH(Mythological entities, deities, folklore)VEHI(Vehicles, ships, aircraft, spacecraft)BIO(Biological compounds, genes, proteins)
C. MultiCoNER 2023 (v2) (33 Fine-Grained Categories)
- Languages Included (13): Bangla (
BN), German (DE), English (EN), Spanish (ES), Farsi (FA), French (FR), Hindi (HI), Italian (IT), Portuguese (PT), Swedish (SV), Ukrainian (UK), Chinese (ZH), and Multilingual Mixed (MULTI) - Person Subtypes:
Artist,Athlete,Cleric,Politician,Scientist,SportsManager,OtherPER - Organization Subtypes:
AerospaceManufacturer,CarManufacturer,MusicalGRP,PrivateCorp,PublicCorp,SportsGRP - Location Subtypes:
Facility,HumanSettlement,Station,OtherLOC - Products & Creative Works:
ArtWork,MusicalWork,VisualWork,WrittenWork,Software,Clothing,Drink,Food,OtherPROD - Medical & Healthcare:
AnatomicalStructure,Disease,MedicalProcedure,Medication/Vaccine,Symptom
D. Complete Unified 47 Entity Category List
1. ANIM 13. Disease 25. Medication/Vaccine 37. Scientist
2. AerospaceManufacturer 14. Drink 26. MusicalGRP 38. Software
3. AnatomicalStructure 15. EVE 27. MusicalWork 39. SportsGRP
4. ArtWork 16. FOOD 28. ORG 40. SportsManager
5. Artist 17. Facility 29. OtherLOC 41. Station
6. Athlete 18. Food 30. OtherPER 42. Symptom
7. BIO 19. HumanSettlement 31. OtherPROD 43. TIME
8. CEL 20. INST 32. PER 44. VEHI
9. CarManufacturer 21. Cleric 33. PLANT 45. Vehicle
10. Cleric 22. MEDIA 34. Politician 46. VisualWork
11. Clothing 23. MYTH 35. PrivateCorp 47. WrittenWork
12. DIS 24. MedicalProcedure 36. PublicCorp
3. Training Results & Metrics
The model was fine-tuned for 5 epochs (~28.3 GPU hours on an NVIDIA L4 GPU) using AdamW (lr=2e-5, linear scheduler, effective batch size 16).
Final Validation Evaluation (Epoch 5 / 5)
| Metric | Score |
|---|---|
| Validation Entity F1 | 0.7693 |
| Validation Precision | 0.8449 |
| Validation Recall | 0.7061 |
| Validation Accuracy | 0.9587 |
| Validation Loss | 0.0276 |
Per-Epoch Progression
- Epoch 1: F1 = 0.7183 | Precision = 0.8016 | Recall = 0.6506 | Loss = 0.0372
- Epoch 2: F1 = 0.7322 | Precision = 0.8151 | Recall = 0.6645 | Loss = 0.0317
- Epoch 3: F1 = 0.7544 | Precision = 0.8346 | Recall = 0.6883 | Loss = 0.0293
- Epoch 4: F1 = 0.7669 | Precision = 0.8460 | Recall = 0.7013 | Loss = 0.0281
- Epoch 5: F1 = 0.7693 | Precision = 0.8449 | Recall = 0.7061 | Loss = 0.0276
Independent Test Benchmarks (32-Suite)
Evaluation across WikiANN, MultiNERD (10 languages + full), and MultiCoNER 2023 (13 languages + full):
| Dataset | Subset / Lang | Sentences | Precision | Recall | F1 Score | Accuracy |
|---|---|---|---|---|---|---|
combined |
combined |
536,661 | 0.6639 | 0.6298 | 0.6464 |
0.9313 |
multinerd |
🔹 multinerd_full |
167,993 | 0.8906 | 0.7298 | 0.8022 |
0.9646 |
multinerd |
🇬🇧 EN-English |
16,454 | 0.9097 | 0.8103 | 0.8571 |
0.9771 |
multinerd |
🇩🇪 DE-German |
15,762 | 0.9025 | 0.7874 | 0.8410 |
0.9761 |
multinerd |
🇷🇺 RU-Russian |
8,338 | 0.8211 | 0.7170 | 0.7656 |
0.9631 |
multinerd |
🇳🇱 NL-Dutch |
17,181 | 0.8313 | 0.6641 | 0.7384 |
0.9647 |
multinerd |
🇫🇷 FR-French |
17,695 | 0.7738 | 0.6725 | 0.7196 |
0.9668 |
multinerd |
🇵🇱 PL-Polish |
19,555 | 0.8046 | 0.6369 | 0.7110 |
0.9510 |
multinerd |
🇪🇸 ES-Spanish |
17,399 | 0.7893 | 0.6374 | 0.7053 |
0.9653 |
multinerd |
🇵🇹 PT-Portuguese |
17,815 | 0.7471 | 0.6083 | 0.6706 |
0.9585 |
multinerd |
🇮🇹 IT-Italian |
18,217 | 0.7424 | 0.5844 | 0.6540 |
0.9619 |
multinerd |
🇨🇳 ZH-Chinese |
19,577 | 0.3193 | 0.2353 | 0.2709 |
0.8184 |
wikiann |
🔹 wikiann_full |
70,000 | 0.6214 | 0.6199 | 0.6202 |
0.8099 |
wikiann |
sv (Swedish) |
10,000 | 0.7174 | 0.6662 | 0.6909 |
0.8843 |
wikiann |
de (German) |
10,000 | 0.6874 | 0.6352 | 0.6603 |
0.8938 |
wikiann |
it (Italian) |
10,000 | 0.6506 | 0.6459 | 0.6482 |
0.8362 |
wikiann |
es (Spanish) |
10,000 | 0.6076 | 0.6560 | 0.6309 |
0.7726 |
wikiann |
fr (French) |
10,000 | 0.6017 | 0.6080 | 0.6049 |
0.7581 |
wikiann |
pt (Portuguese) |
10,000 | 0.5613 | 0.5976 | 0.5789 |
0.7517 |
wikiann |
en (English) |
10,000 | 0.5238 | 0.5304 | 0.5271 |
0.7729 |
multiconer2023 |
🔹 multiconer2023_full |
1,991,359 | 0.5957 | 0.5923 | 0.5937 |
0.9160 |
multiconer2023 |
IT-Italian |
247,881 | 0.6566 | 0.6654 | 0.6609 |
0.9225 |
multiconer2023 |
SV-Swedish |
231,190 | 0.6468 | 0.6332 | 0.6400 |
0.9182 |
multiconer2023 |
UK-Ukrainian |
238,296 | 0.6123 | 0.5994 | 0.6058 |
0.9232 |
multiconer2023 |
FR-French |
249,786 | 0.6039 | 0.5971 | 0.6005 |
0.9122 |
multiconer2023 |
ES-Spanish |
246,900 | 0.5889 | 0.6060 | 0.5974 |
0.9212 |
multiconer2023 |
PT-Portuguese |
229,490 | 0.5928 | 0.5987 | 0.5957 |
0.9197 |
multiconer2023 |
MULTI-Multilingual |
358,668 | 0.5787 | 0.5840 | 0.5813 |
0.9118 |
multiconer2023 |
DE-German |
20,145 | 0.5625 | 0.5993 | 0.5803 |
0.9148 |
multiconer2023 |
EN-English |
249,980 | 0.5620 | 0.5818 | 0.5718 |
0.9078 |
multiconer2023 |
HI-Hindi |
18,399 | 0.5308 | 0.5575 | 0.5438 |
0.9312 |
multiconer2023 |
BN-Bangla |
19,859 | 0.5029 | 0.5275 | 0.5149 |
0.9079 |
multiconer2023 |
FA-Farsi |
219,168 | 0.5286 | 0.4606 | 0.4923 |
0.9072 |
multiconer2023 |
ZH-Chinese |
20,265 | 0.4129 | 0.4904 | 0.4483 |
0.8619 |
4. Inference Mechanism & Softmax Logit Decoding (95 Logit Classes)
During inference, for any input text, our fine-tuned model (microsoft/mdeberta-v3-base with merged LoRA parameters) passes subword token representations through its 12 Transformer layers to output a 95-dimensional logit vector per token. PyTorch applies a softmax function across all 95 output tags to compute normalized probability confidence scores:
P(tag_k | token_i) = exp(z_k) / Σ exp(z_j) for k ∈ {1, 2, ..., 95}
- Hard Argmax (Default Token Classification): Selects the single highest-probability tag (argmax).
- Soft Confidence Distribution: For ambiguous entity tokens (e.g. "Harvard"), the model distributes probability across related candidate classes (
B-INST: 72.4%,B-ORG: 21.1%,B-Facility: 5.3%), capturing semantic cross-taxonomy relationships.
5. Intended Use & Out-of-Scope Use
Intended Use
- Information extraction from multilingual text (news articles, Wikipedia, social media, web content)
- Downstream NLP pipelines requiring structured entity extraction across multiple languages
- Research in cross-lingual transfer learning, fine-grained NER, and multilingual NLP
- Knowledge graph construction from unstructured multilingual text
Out-of-Scope Use
- Domain-specific NER (e.g., legal, financial, or clinical NER) — may require additional fine-tuning on domain data
- Languages not listed in the supported 15-language set — the model was not trained on those languages
6. How to Use
Quick Inference via Hugging Face Pipeline
from transformers import pipeline
ner_pipeline = pipeline(
"token-classification",
model="Rishabh157/unified-multilingual-ner-mdeberta",
aggregation_strategy="simple"
)
text = "Barack Obama visited the United Nations headquarters in New York City."
entities = ner_pipeline(text)
for entity in entities:
print(f"{entity['word']:<25} | {entity['entity_group']:<15} | Score: {entity['score']:.4f}")
PyTorch & Transformers Direct Usage
import torch
from transformers import AutoTokenizer, AutoModelForTokenClassification
model_name = "Rishabh157/unified-multilingual-ner-mdeberta"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForTokenClassification.from_pretrained(model_name)
text = "Emmanuel Macron est le président de la République française à Paris."
inputs = tokenizer(text, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.argmax(outputs.logits, dim=2)
tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
labels = [model.config.id2label[p.item()] for p in predictions[0]]
for token, label in zip(tokens, labels):
if label != "O":
print(f"{token:<20} -> {label}")
7. Known Considerations & Future Improvements
- European Languages Lead Performance: The model achieves highest F1 scores on European languages (English, German, Dutch, Russian — F1
0.76–0.86on MultiNERD) due to richer training data availability. - East Asian & South Asian Languages: Chinese (
ZH), Farsi (FA), Bangla (BN), and Hindi (HI) show room for improvement and can benefit from additional fine-tuning on language-specific corpora. - Unified Taxonomy Design: The model unifies 47 entity types from three separate datasets into a single classification head. Some categories across datasets are semantically related (e.g.,
Foodfrom MultiCoNER andFOODfrom MultiNERD) and are treated as distinct classes to preserve dataset fidelity. - Continual Improvement: Performance on lower-resource languages can be improved by fine-tuning further on domain-specific or language-specific NER datasets.
8. Citation
If you use this model or dataset pipeline in your research, please cite:
@misc{kumar2026multilingualner,
author = {Rishabh Kumar},
title = {Unified Fine-Grained Multilingual NER with mDeBERTa-v3},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/Rishabh157/unified-multilingual-ner-mdeberta}}
}
- Downloads last month
- -
Model tree for Rishabh157/unified-multilingual-ner-mdeberta
Base model
microsoft/mdeberta-v3-base