recipe-t5-small
T5-small fine-tuned to turn a list of fridge ingredients into cooking steps.
- input:
generate a cooking recipe using these ingredients: egg, tomato, rice - output:
title: ... steps: ...(max 128 / 256 tokens) - data: Food.com RAW_recipes.csv, filtered to 3-15 ingredients and 3-12 steps
- training: 3 epochs, batch 16, fp16, Colab T4
| test n | BLEU-4 | ROUGE-L F1 | ingredient coverage | distinct-2 |
|---|---|---|---|---|
| 300 | 0.0909 | 0.2982 | 0.597 | 0.152 |
Usage
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("你的用户名/recipe-t5-small")
model = AutoModelForSeq2SeqLM.from_pretrained("你的用户名/recipe-t5-small")
ids = tok("generate a cooking recipe using these ingredients: egg, tomato, rice",
return_tensors="pt").input_ids
print(tok.decode(model.generate(ids, max_new_tokens=256, num_beams=4)[0],
skip_special_tokens=True))