Downloads · 30 days
1
6% of all-time downloads
MaharaniYassarDewanti079/Food_Recommendations
Food_Recommendations is a machine learning model from MaharaniYassarDewanti079. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a recipe recommendation system that suggests recipes based on user-provided keywords using TF-IDF vectorization and Word2Vec embeddings. It also evaluates recommendations with Precision@K and Recall@K to measu…
Downloads · 30 days
1
6% of all-time downloads
All-time downloads
16
Public
Repo size
8.4 MB
Likes
0
Public
Click a slice to open those files.
.bin8.2 MB · 97%
From the Hugging Face model README
This is a recipe recommendation system that suggests recipes based on user-provided keywords using TF-IDF vectorization and Word2Vec embeddings. It also evaluates recommendations with Precision@K and Recall@K to measure relevance and recommendation quality.
The model recommends recipes based on descriptive keywords like "spicy vegetarian" or "sweet dessert." This system leverages a combination of TF-IDF vectorization and Word2Vec embeddings to capture context in recipe descriptions, ingredients, and tags. A synonym dictionary further enhances keyword search relevance, capturing alternative expressions for key terms. Evaluation metrics include Precision@K and Recall@K, providing insight into recommendation accuracy.
To use this model locally, ensure you have Python 3.7+ and install the required packages:
pip install pandas numpy scikit-learn gensim
combined_text field combining these features.# Example usage
keywords = "sweet dessert"
recommendations = recommend_recipes(keywords, top_k=10)
print("Recommended Recipes:", recommendations)
precision, recall = precision_recall_at_k(recommendations, ["sweet", "dessert"], k=10)
print(f"Precision@K: {precision}, Recall@K: {recall}")
Run the Model
keywords = "sour lemon"
recommendations = recommend_recipes(keywords, top_k=10)
View Recommendations
print(recommendations[['name', 'description']])
Evaluate Recommendations
precision, recall = precision_recall_at_k(recommendations, ["sour", "lemon"], k=10)
print(f"Precision@K: {precision}, Recall@K: {recall}")
This model provides recipe recommendations based on descriptive keywords and evaluates their relevance using precision and recall.