CoolFace
Modelpublic

carolanderson/roberta-base-food-ner

sourceHugging Facemitupdated 3y agoView on Hugging Face
2likes42downloads
Model Card

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.

  • —Developed by: Carol Anderson
  • —Shared by: Carol Anderson
  • —Language(s) (NLP): English
  • —License: MIT
  • —Finetuned from model: roberta-base

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")