Downloads · 30 days
3
17% of all-time downloads
ashaduzzaman/bert-finetuned-ner
bert-finetuned-ner is a token classification model from ashaduzzaman. Use it when you need labels on individual words, such as names. The card lists the license as apache-2.0.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
3
17% of all-time downloads
All-time downloads
18
Public
Parameters
108M
1.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors431 MB · 100%
From the Hugging Face model README
This model is a Named Entity Recognition (NER) model built using PyTorch and fine-tuned on the CoNLL-2003 dataset. The model is designed to identify and classify named entities in text into categories such as persons (PER), organizations (ORG), locations (LOC), and miscellaneous entities (MISC).
Intended Uses:
Limitations:
To use this model, you can load it using the Hugging Face Transformers library. Below is an example of how to perform inference using the model:
from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("Ashaduzzaman/bert-finetuned-ner")
model = AutoModelForTokenClassification.from_pretrained("Ashaduzzaman/bert-finetuned-ner")
# Create a pipeline for NER
ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer)
# Example inference
text = "Hugging Face Inc. is based in New York City."
entities = ner_pipeline(text)
print(entities)
If the model isn't performing as expected, consider checking the following:
The model was trained on the CoNLL-2003 dataset, a widely used benchmark dataset for NER tasks. The dataset contains annotated text from news articles, with labels for persons, organizations, locations, and miscellaneous entities.
The model was fine-tuned using the pre-trained BERT model (bert-base-cased) with a token classification head for NER. The training process involved:
This model was evaluated on the CoNLL-2003 test set, with performance measured using standard NER metrics:
| Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 | Accuracy |
|---|---|---|---|---|---|---|---|
| 0.076 | 1.0 | 1756 | 0.0657 | 0.9076 | 0.9337 | 0.9204 | 0.9819 |
| 0.0359 | 2.0 | 3512 | 0.0693 | 0.9265 | 0.9418 | 0.9341 | 0.9847 |
| 0.0222 | 3.0 | 5268 | 0.0599 | 0.9347 | 0.9512 | 0.9429 | 0.9864 |