Model Card for Model ID carolanderson/roberta-base-food-ner

Model Details

Model Description

Model for tagging mentions of food in the text of recipes. Trained by fine tuning RoBERTa base on a set of about 300 hand-labeled recipes derived from this dataset from Kaggle.. Achieves an F1 score 0f 0.96 on the custom validation set.

Model Sources

How to Get Started with the Model

Use the code below to get started with the model.

from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
model = AutoModelForTokenClassification.from_pretrained('carolanderson/roberta-base-food-ner')
tokenizer = AutoTokenizer.from_pretrained("roberta-base", add_prefix_space=True)
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
example = "Saute the onions in olive oil until browned."
results = nlp(example, aggregation_strategy="first")