Durban University of Technology Recipe Generator
Model Details
Description
This model is a fine-tuned version of bloom560m aimed at recipe generation for a given set of ingredients. Its focus is on the creation of healthier, diabetic-friendly recipes with the set of ingredients that someone has on hand.
This model further differentiates itself by prioritising common kitchen measurements (e.g. 1 cup, 1 teaspoon) and the metric system (e.g. 500g, 100ml) over US customary or imperial measurement systems.
During model training, unfamiliar recipes were tested by the Department of Food and Nutrition, with feedback incorporated to enhance the model's performance.
Usage Example
import json
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
tokenizer = AutoTokenizer.from_pretrained("Ashikan/dut-recipe-generator")
model = AutoModelForCausalLM.from_pretrained("Ashikan/dut-recipe-generator")
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
input_ingredients = ["mushrooms", "cabbage", "soy sauce", "sesame seeds", "honey"]
input_text = '{"prompt": ' + json.dumps(input_ingredients)
output = pipe(input_text, max_length=1024, temperature=0.2, do_sample=True, truncation=True)[0]["generated_text"]
#JSON formatted output with "title", "ingredients" and "method" nodes available
print(output)
Application Example
You may test out the model on HuggingFace spaces here: https://huggingface.co/spaces/Ashikan/dut-recipe-generator
Training Data
This model was first trained on a heavily filtered and processed version of the existing Recipe NLG dataset. Pre-processing involved the removal of invalid recipes, conversion of units such as degrees Fahrenheit to degrees Celsius and the filtering out of recipes completely written in US customary or imperial measurements.
After the initial training, the model was then trained on a new recipe dataset written by the Durban University of Technology. This dataset was tailored to feature healthier, diabetic-friendly recipes with a focus on ease of preparation and nutritional content. These recipes can be found within the Dut Diabetic Friendly Recipes dataset.
Citation Information
Prof Ashika Naicker*, Mr Shaylin Chetty, Ms Riashnie Thaver*, Ms. Anjellah Reddy*, Dr. Evonne Shanita Singh*, Dr. Imana Pal*, Dr. Lisebo Mothepu*.
*Durban University of Technology, Faculty of Applied Sciences, Department of Food and Nutrition, Durban, South Africa
- Downloads last month
- 839