Spaces:
Sleeping
Sleeping
OmPrakashSingh1704
commited on
Commit
•
3b410a1
1
Parent(s):
8df26cd
Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,7 @@ def get_recommendations(user_description, count_vectorizer, count_matrix):
|
|
51 |
user_description = preprocess_text(user_description)
|
52 |
user_vector = count_vectorizer.transform([user_description])
|
53 |
cosine_similarities = cosine_similarity(user_vector, count_matrix).flatten()
|
54 |
-
similar_indices = cosine_similarities.argsort()[::-1]
|
55 |
return similar_indices
|
56 |
|
57 |
def create_detailed_prompt(user_direction, exclusions, serving_size, difficulty):
|
@@ -254,7 +254,7 @@ if st.session_state.recipe is not None:
|
|
254 |
with col01:
|
255 |
cont = st.container(border=True, height=500)
|
256 |
for i in recipe["ingredients"]:
|
257 |
-
cont.selectbox(i['name'],options=items_dict.iloc[get_recommendations(i['name'],cv,vectors)]["
|
258 |
with col02:
|
259 |
cont = st.container(border=True, height=500)
|
260 |
cont.write(instructions)
|
|
|
51 |
user_description = preprocess_text(user_description)
|
52 |
user_vector = count_vectorizer.transform([user_description])
|
53 |
cosine_similarities = cosine_similarity(user_vector, count_matrix).flatten()
|
54 |
+
similar_indices = cosine_similarities.argsort()[::-1][:5]
|
55 |
return similar_indices
|
56 |
|
57 |
def create_detailed_prompt(user_direction, exclusions, serving_size, difficulty):
|
|
|
254 |
with col01:
|
255 |
cont = st.container(border=True, height=500)
|
256 |
for i in recipe["ingredients"]:
|
257 |
+
cont.selectbox(i['name'],options=items_dict.iloc[get_recommendations(i['name'],cv,vectors)]["PRODUCT_NAME"].values)
|
258 |
with col02:
|
259 |
cont = st.container(border=True, height=500)
|
260 |
cont.write(instructions)
|