Instructions to use Sameer63343/ner-distilbert-ontonotes5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sameer63343/ner-distilbert-ontonotes5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="Sameer63343/ner-distilbert-ontonotes5")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("Sameer63343/ner-distilbert-ontonotes5") model = AutoModelForTokenClassification.from_pretrained("Sameer63343/ner-distilbert-ontonotes5", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Named Entity Recognition using DistilBERT
Model Description
This model is a fine-tuned DistilBERT model for Named Entity Recognition (NER).
It identifies entities in text, including people, organizations, locations, dates, money, events and other categories.
Base Model
distilbert/distilbert-base-cased
Dataset
OntoNotes 5.0
Dataset: https://huggingface.co/datasets/tner/ontonotes5
Training Configuration
- Architecture: DistilBERT
- Task: Token Classification
- Number of labels: 37
- Epochs: 2
- Learning rate: 2e-5
- Training batch size: 16
- Maximum sequence length: 256
- Optimizer: AdamW (Trainer default)
Test Results
| Metric | Score |
|---|---|
| Precision | 85.49% |
| Recall | 88.24% |
| F1-score | 86.84% |
| Token Accuracy | 97.99% |
Entity Labels
The model uses BIO tagging with 37 labels, representing 18 entity categories and the O label.
Usage
from transformers import pipeline
ner = pipeline( "token-classification", model="Sameer63343/ner-distilbert-ontonotes5", aggregation_strategy="simple" )
text = "Microsoft organized a conference in Islamabad."
results = ner(text)
for entity in results: print(entity)
Limitations
This model was trained on OntoNotes 5.0. Performance may vary on specialized documents and domains that differ from its training data.
- Downloads last month
- -