Instructions to use dslim/distilbert-NER with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dslim/distilbert-NER with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="dslim/distilbert-NER")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("dslim/distilbert-NER") model = AutoModelForTokenClassification.from_pretrained("dslim/distilbert-NER") - Inference
- Notebooks
- Google Colab
- Kaggle
Token labels appear incorrect?
#3
by ianroberts - opened
Your other models (bert-base / bert-large) have the nine token labels in the config listed as O, B/I-MISC, B/I-PER, B/I-ORG and B/I-LOC, but this distilbert model just has them as LABEL_0 to LABEL_8 (and from the look of the Inference API examples these are not in the same order as the bert models - LABEL_1 appears to match B-PER and LABEL_5 appears to be B-LOC).
Would you consider releasing an updated config with the correct B/I/O labels so the ner pipeline is able to aggregate tokens into chunks?
ianroberts changed discussion status to closed