YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
NewsNER-DistilBERT
A fine-tuned DistilBERT-based Named Entity Recognition (NER) model for extracting people, organizations, locations, and miscellaneous entities from English news text.
The model was fine-tuned on the CoNLL-2003 dataset and evaluated using entity-level precision, recall, and F1-score.
Model Overview
| Property | Details |
|---|---|
| Model | DistilBERT |
| Task | Named Entity Recognition |
| Domain | English News Articles |
| Base Model | distilbert-base-uncased |
| Dataset | CoNLL-2003 |
| Entity Types | PER, ORG, LOC, MISC |
| Evaluation | Entity-level |
| Overall F1 | 88.79% |
Entity Labels
The model recognizes four main entity categories:
- PER β Person
- ORG β Organization
- LOC β Location
- MISC β Miscellaneous entities
Training
The model was fine-tuned using the CoNLL-2003 Named Entity Recognition dataset.
The training pipeline includes:
- Tokenization using the DistilBERT tokenizer
- Alignment of word-level NER labels with tokenized inputs
- Fine-tuning DistilBERT for token classification
- Evaluation using entity-level precision, recall, and F1-score
- Comparison against traditional and spaCy-based baselines
The resulting model is designed to provide a lightweight Transformer-based alternative for practical NER inference.
Dataset
The model was trained and evaluated on the CoNLL-2003 dataset.
Dataset splits:
| Split | Samples |
|---|---|
| Train | 14,041 |
| Validation | 3,250 |
| Test | 3,453 |
The dataset contains news articles annotated with named entities including persons, organizations, locations, and miscellaneous entities.
Evaluation Results
The official entity-level evaluation on the test set achieved:
| Metric | Score |
|---|---|
| Precision | 87.92% |
| Recall | 89.68% |
| F1 | 88.79% |
Per-Entity Performance
| Entity | Precision | Recall | F1 |
|---|---|---|---|
| PER | 95.02% | 94.50% | 94.76% |
| ORG | 84.28% | 87.78% | 85.99% |
| LOC | 91.84% | 91.07% | 91.45% |
| MISC | 72.82% | 79.77% | 76.14% |
The strongest performance was achieved on PER and LOC entities, while MISC remains the most challenging category.
Baseline Comparison
The fine-tuned DistilBERT model was evaluated against several baselines:
| Approach | F1 |
|---|---|
| Rule-Based | 10.15% |
| spaCy Small | 56.22% |
| spaCy Medium | 57.19% |
| Fine-tuned DistilBERT | 88.79% |
This comparison demonstrates the improvement achieved by fine-tuning a Transformer-based model for the target NER task.
Example
Input
Apple CEO Tim Cook announced a new investment in India during a meeting in New Delhi. Microsoft also plans to expand its operations in London.
Extracted Entities
Apple β ORG
Tim Cook β PER
India β LOC
New Delhi β LOC
Microsoft β ORG
London β LOC
The deployed application also provides confidence scores for individual predictions.
How to Use
Install the required libraries:
pip install transformers torch
Load the model using the Hugging Face Transformers pipeline:
from transformers import pipeline
ner_pipeline = pipeline(
"token-classification",
model="AbdelrahmanAkl/NewsNER-DistilBERT",
aggregation_strategy="simple"
)
text = """
Apple CEO Tim Cook announced a new investment in India.
"""
results = ner_pipeline(text)
for entity in results:
print(
entity["word"],
entity["entity_group"],
entity["score"]
)
Intended Use
This model is intended for experimentation, research, education, and practical NLP applications involving English news text.
Potential applications include:
- News article analysis
- Information extraction
- Document processing
- Entity-based search
- Knowledge graph construction
- News analytics
- NLP preprocessing pipelines
Limitations
The model was trained on the CoNLL-2003 news domain and may not generalize equally well to other domains such as:
- Medical documents
- Legal documents
- Financial reports
- Social media
- Informal conversations
- Highly technical documents
Performance may also decrease on text containing entities, terminology, or writing styles that differ significantly from the training distribution.
The MISC category has lower performance than PER, ORG, and LOC and should therefore be treated with additional caution.
Ethical Considerations
Named Entity Recognition systems can be used to automatically extract information about people, organizations, and locations.
Users should consider:
- Privacy when processing sensitive documents
- Potential downstream errors
- Biases present in the training data
- The consequences of incorrect entity extraction
Predictions should be validated before being used in high-impact automated decision-making systems.
Project
This model is part of the NewsNER-AI project, a complete Named Entity Recognition application built around a fine-tuned Transformer model.
The project includes:
- Model fine-tuning
- Entity-level evaluation
- Baseline benchmarking
- Streamlit inference application
- Hugging Face model deployment
- Production-oriented documentation
Resources
GitHub Repository
https://github.com/AbdelrhmanAkl/News-NER-Entity-Recognition
Live Demo
https://news-ner-entity-recognition.streamlit.app/
Author
Abdelrahman Akl
AI Engineer | NLP | LLMs | RAG | Agentic AI
GitHub: https://github.com/AbdelrhmanAkl
If you use this model in a project, please consider referencing the original CoNLL-2003 dataset and the underlying DistilBERT architecture.
- Downloads last month
- 42