Downloads · 30 days
12
25% of all-time downloads
rasyosef/distilbert-finetuned-ner
distilbert-finetuned-ner is a token classification model from rasyosef. 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.
This is a fine-tuned version of the distilbert-base-cased model on the CoNLL-2003 dataset and is ready to use for named entity recognition (NER).
Downloads · 30 days
12
25% of all-time downloads
All-time downloads
48
Public
Parameters
65.2M
782 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors261 MB · 100%
From the Hugging Face model README
This is a fine-tuned version of the distilbert-base-cased model on the CoNLL-2003 dataset and is ready to use for named entity recognition (NER).
It achieves the following results on the evaluation set:
Train Loss: 0.031400Validation Loss: 0.070702Validation Accuracy: 0.983061Precision: 0.912730Recall: 0.936385F1: 0.924406Accuracy: 0.983061You can use this model directly with a pipeline for token classification:
from transformers import pipeline
checkpoint = "rasyosef/distilbert-finetuned-ner"
token_classifier = pipeline("token-classification", model=checkpoint, aggregation_strategy="simple")
token_classifier("My name is Tony Stark and I work at Stark Industries in Los Angeles.")
Output:
[{'entity_group': 'PER',
'score': 0.99873567,
'word': 'Tony Stark',
'start': 11,
'end': 21},
{'entity_group': 'ORG',
'score': 0.998356,
'word': 'Stark Industries',
'start': 36,
'end': 52},
{'entity_group': 'LOC',
'score': 0.9982861,
'word': 'Los Angeles',
'start': 56,
'end': 67}]