eriktks/conll2003
Updated โข 45.4k โข 184
How to use mohammad748/distilbert-conll2003-ner with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("token-classification", model="mohammad748/distilbert-conll2003-ner") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained("mohammad748/distilbert-conll2003-ner")
model = AutoModelForTokenClassification.from_pretrained("mohammad748/distilbert-conll2003-ner", device_map="auto")This repository contains a fine-tuned DistilBERT model trained on the CoNLL-2003 dataset for Named Entity Recognition (NER). The model identifies and classifies named entities in English text.
The model recognizes four entity categories:
It uses the BIO tagging scheme to identify entity boundaries.
from transformers import pipeline
ner_pipeline = pipeline(
"ner",
model="mohammad748/distilbert-conll2003-ner",
aggregation_strategy="simple"
)
text = "Barack Obama was born in Hawaii."
results = ner_pipeline(text)
for entity in results:
print(entity)
The output includes the identified entities, their categories, confidence scores, and positions in the text.
Base model
distilbert/distilbert-base-uncased