Downloads · 30 days
13
3% of all-time downloads
amanpatkar/distilbert-finetuned-ner
distilbert-finetuned-ner is a token classification model from amanpatkar. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as mit.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
13
3% of all-time downloads
All-time downloads
502
Public
Parameters
65.2M
522 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors261 MB · 99%
From the Hugging Face model README
This model is a fine-tuned version of distilbert-base-cased on the conll2003 dataset. It achieves the following results on the evaluation set:
The distilbert-finetuned-ner model is designed for Named Entity Recognition (NER) tasks. It is based on the DistilBERT architecture, which is a smaller, faster, and lighter version of BERT. DistilBERT retains 97% of BERT's language understanding while being 60% faster and 40% smaller, making it efficient for deployment in production systems.
You can use this model with Transformers pipeline for NER.
from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline
tokenizer = AutoTokenizer.from_pretrained("amanpatkar/distilbert-finetuned-ner")
model = AutoModelForTokenClassification.from_pretrained("amanpatkar/distilbert-finetuned-ner")
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
example = "My name is Aman Patkar and I live in Gurugram, India."
ner_results = nlp(example)
print(ner_results)
The model is fine-tuned on the CoNLL-2003 dataset, a widely-used dataset for training and evaluating NER systems. The dataset includes four types of named entities: Persons (PER), Organizations (ORG), Locations (LOC), and Miscellaneous (MISC).
| Abbreviation | Description |
|---|---|
| O | Outside of a named entity |
| B-MISC | Beginning of a miscellaneous entity right after another miscellaneous entity |
| I-MISC | Miscellaneous entity |
| B-PER | Beginning of a person’s name right after another person’s name |
| I-PER | Person’s name |
| B-ORG | Beginning of an organization right after another organization |
| I-ORG | organization |
| B-LOC | Beginning of a location right after another location |
| I-LOC | Location |
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 | Accuracy |
|---|---|---|---|---|---|---|---|
| 0.0908 | 1.0 | 1756 | 0.0887 | 1.0 | 1.0 | 1.0 | 1.0 |
| 0.0467 | 2.0 | 3512 | 0.0713 | 1.0 | 1.0 | 1.0 | 1.0 |
| 0.0276 | 3.0 | 5268 | 0.0711 | 1.0 | 1.0 | 1.0 | 1.0 |