The model is fine-tuned on the CoNLL2003 dataset, a well-known benchmark for NER. This dataset provides a solid foundation for the model to generalize on general English text.
Below is an example of how to use the model with the Hugging Face Transformers library:
from transformers import pipeline
ner = pipeline(task="token-classification", model="IsmaelMousa/modernbert-ner-conll2003", aggregation_strategy="max")
results = ner("Hi, I'm Ismael Mousa from Palestine working for NVIDIA inc.")
for entity in results:
for key, value in entity.items():
if key == "entity_group":
print(f"{entity['word']} => {entity[key]}")
Results:
Ismael Mousa => PER
Palestine => LOC
NVIDIA => ORG