Downloads · 30 days
5
0% of all-time downloads
shogun-the-great/finetuned-distilbert-connllp
finetuned-distilbert-connllp is a token classification model from shogun-the-great. Use it when you need labels on individual words, such as names. It is set up for transformers.
This model is a fine-tuned version of DistilBERT-Base-Cased for Named Entity Recognition (NER) using the CoNLL-PP dataset. The model identifies entities in text such as locations, organizations, persons, etc.
Downloads · 30 days
5
0% of all-time downloads
All-time downloads
1.3K
Public
Parameters
65.2M
261 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors261 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of DistilBERT-Base-Cased for Named Entity Recognition (NER) using the CoNLL-PP dataset. The model identifies entities in text such as locations, organizations, persons, etc.
distilbert-base-casedThis model can be directly used for Named Entity Recognition tasks to extract entities such as locations, organizations, and persons from text. Typical use cases include:
This model can be further fine-tuned for specific tasks requiring NER in specific domains like medical, legal, etc.
This model might not perform well for:
The model’s predictions are influenced by the dataset used during fine-tuning. If the dataset contains biases, they may be reflected in the predictions.
You can load the fine-tuned model directly from the Hugging Face Hub:
from transformers import AutoTokenizer, AutoModelForTokenClassification
# Load the tokenizer and model from Hugging Face Hub
model_name = "shogun-the-great/finetuned-distilbert-connllp"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForTokenClassification.from_pretrained(model_name)
# Example usage for NER
text = "Barack Obama was born in Hawaii."
inputs = tokenizer(text, return_tensors="pt", truncation=True, is_split_into_words=True)
outputs = model(**inputs)
# Get the predicted labels for each token
predictions = outputs.logits.argmax(dim=-1)
tokens = inputs.tokens()
# Convert predictions to entity names
predicted_tags = [model.config.id2label[prediction.item()] for prediction in predictions[0]]
for token, tag in zip(tokens, predicted_tags):
print(f"{token}: {tag}")