CoolFace
Modelpublic

Rishabh157/spanmarker-multinerd-mdeberta

sourceHugging Faceapache-2.0updated 4d agoView on Hugging Face
0likes22downloads
Model Card

SpanMarker-mDeBERTa-v3-MultiNERD

Developed by: **Rishabh Kumar** Model Name: Rishabh157/spanmarker-multinerd-mdeberta Base Architecture: microsoft/mdeberta-v3-base

A state-of-the-art multilingual Named Entity Recognition (NER) model developed by Rishabh Kumar, built on `microsoft/mdeberta-v3-base` using the [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) framework.

This model is fine-tuned on the full MultiNERD dataset across 10 languages (English, German, Spanish, French, Italian, Dutch, Polish, Portuguese, Russian, and Chinese) covering 15 fine-grained entity types.

Unlike traditional sequence taggers that assign BIO labels token-by-token (which often suffer from boundary fragmentation), SpanMarker explicitly scores candidate phrase spans [Si, Ej] directly inside mDeBERTa's disentangled attention mechanism, yielding high boundary accuracy (87.31% Overall Precision and 92.71% Overall Accuracy).


Model Details

  • Developer / Creator: Rishabh Kumar (@Rishabh157)
  • Base Backbone: `microsoft/mdeberta-v3-base` (276M parameters)
  • Framework: SpanMarker (PL-Marker candidate span formulation)
  • Languages (10): English (en), German (de), Spanish (es), French (fr), Italian (it), Dutch (nl), Polish (pl), Portuguese (pt), Russian (ru), Chinese (zh)
  • Number of Entity Classes: 15 entity types (31 classification classes including labels + O)
  • Max Sequence Length (`model_max_length`): 384 tokens (empirically covers 100% of sentences across all 10 languages without truncation)
  • Max Entity Length (`entity_max_length`): 24 words (covers 99.993% of entity spans)
  • Marker Window Size (`marker_max_length`): 128 tokens

Evaluation Results

Evaluated on the official MultiNERD validation set (167,400 sentences across 10 languages):

Overall Metrics

MetricScore
Overall F173.35%
Overall Precision87.31%
Overall Recall63.24%
Overall Accuracy92.71%
Validation Loss0.0089

Per-Class Performance Breakdown

Entity ClassDescriptionPrecisionRecallF1 ScoreSupport (# Spans)
LOCLocation (cities, countries, geography)93.53%70.08%80.12%82,574
PERPerson (names, public figures)91.35%65.66%76.40%61,945
ORGOrganization (companies, institutions)89.47%66.54%76.32%15,560
ANIMAnimal (fauna, species)79.99%63.62%70.87%15,995
TIMETime / Eras / Historical periods80.43%62.78%70.52%31,701
EVEEvents (wars, sports, festivals)87.20%58.70%70.16%5,767
MYTHMythological entities78.25%52.01%62.48%1,819
VEHIVehicles (aircraft, cars, ships)77.56%51.85%62.15%540
MEDIAMedia (books, movies, albums)85.72%48.09%61.61%15,259
CELCelestial bodies (planets, stars)80.97%49.70%61.60%2,012
PLANTPlant / Flora species65.29%50.50%56.95%7,539
DISDisease / Medical conditions71.70%39.65%51.06%6,934
INSTInstruments / Tools75.42%37.27%49.89%609
FOODFood / Beverages63.71%38.62%48.09%6,703
BIOBiological entities60.94%23.35%33.77%167
Note on "Support (# Spans)": In Named Entity Recognition benchmarks, Support indicates the exact number of ground-truth entity spans belonging to that category in the evaluation set. It defines the sample size over which Recall and F1 are computed, providing transparency into entity frequency across the corpus.

Quickstart & Usage

1. Installation

bash
pip install span-marker transformers torch

2. Direct Inference

python
from span_marker import SpanMarkerModel

# Load the model
model = SpanMarkerModel.from_pretrained("Rishabh157/spanmarker-multinerd-mdeberta")

# Example 1: English
text_en = "AstraZeneca developed the Oxford vaccine for COVID-19 in London during 2020."
entities_en = model.predict(text_en)
print("English Entities:", entities_en)

# Example 2: German
text_de = "Alexander von Humboldt reiste nach Südamerika und erforschte den Orinoco."
entities_de = model.predict(text_de)
print("German Entities:", entities_de)

# Example 3: Chinese
text_zh = "北京大学和清华大学位于中国北京市海淀区。"
entities_zh = model.predict(text_zh)
print("Chinese Entities:", entities_zh)

Output Format

python
[
  {'span': 'AstraZeneca', 'label': 'ORG', 'score': 0.992, 'char_start_index': 0, 'char_end_index': 11},
  {'span': 'COVID-19', 'label': 'DIS', 'score': 0.985, 'char_start_index': 44, 'char_end_index': 52},
  {'span': 'London', 'label': 'LOC', 'score': 0.998, 'char_start_index': 56, 'char_end_index': 62},
  {'span': '2020', 'label': 'TIME', 'score': 0.941, 'char_start_index': 70, 'char_end_index': 74}
]

Training Details

  • Dataset Source: Babelscape/multinerd (1,339,200 training sentences, 167,400 validation sentences)
  • Effective Batch Size: 16 (per-device batch size 8 × gradient accumulation 2)
  • Optimizer: AdamW (betas=(0.9, 0.999), eps=1e-08, weight_decay=0.01)
  • Learning Rate: 3.0e-5 with Linear Decay
  • Warmup Ratio: 0.1 (first 13,545 steps)
  • Precision: FP16 mixed precision
  • Total Optimization Steps: 135,450 steps (1 full pass over 2,167,200 candidate span windows)

Author & Citation

This model was trained, evaluated, and published by Rishabh Kumar (@Rishabh157).

If you use this model or refer to this work, please cite:

bibtex
@misc{rishabhkumar2026_spanmarker_multinerd,
  author = {Rishabh Kumar},
  title = {SpanMarker Multilingual NER with mDeBERTa-v3 on MultiNERD},
  year = {2026},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/Rishabh157/spanmarker-multinerd-mdeberta}}
}