Instructions to use pimsoje/recipe-ner-small-bert-bio with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pimsoje/recipe-ner-small-bert-bio with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="pimsoje/recipe-ner-small-bert-bio")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("pimsoje/recipe-ner-small-bert-bio") model = AutoModelForTokenClassification.from_pretrained("pimsoje/recipe-ner-small-bert-bio") - Notebooks
- Google Colab
- Kaggle
Recipe NER Small BERT
This repository contains a compact BERT-style token classification model trained from scratch on a BIO-annotated recipe corpus.
What the model predicts
NAMEโ ingredient namesQTYโ quantitiesUNITโ measurement unitsCOMMENTโ modifiers such as chopped / fresh / cannedINDEXandRANGE_ENDโ rare auxiliary labels from the source markup
Test metrics
- F1: 0.8828
- Precision: 0.8762
- Recall: 0.8895
- Accuracy: 0.8960
Usage
from transformers import pipeline
pipe = pipeline(
"token-classification",
model="recipe_ner_small_bert",
tokenizer="recipe_ner_small_bert",
aggregation_strategy="simple",
)
pipe("2 cups flour\n1 cup sugar\n1 tbsp olive oil")
- Downloads last month
- 7