Update app.py
Browse files
app.py
CHANGED
|
@@ -1088,10 +1088,18 @@ def recommend_content_based(user_profile, top_n=5):
|
|
| 1088 |
balanced_recommendations.append((item, score))
|
| 1089 |
hobby_limits[item_main_hobby] -= 1
|
| 1090 |
|
| 1091 |
-
# ์ถ์ฒ ๊ฐ์๊ฐ ์ถฉ๋ถ
|
| 1092 |
if len(balanced_recommendations) >= top_n:
|
| 1093 |
break
|
| 1094 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1095 |
return balanced_recommendations
|
| 1096 |
|
| 1097 |
|
|
|
|
| 1088 |
balanced_recommendations.append((item, score))
|
| 1089 |
hobby_limits[item_main_hobby] -= 1
|
| 1090 |
|
| 1091 |
+
# ์ถ์ฒ ๊ฐ์๊ฐ ์ถฉ๋ถํ ์ฑ์์ง ๋๊น์ง ๊ณ์ ์ถ์ฒ
|
| 1092 |
if len(balanced_recommendations) >= top_n:
|
| 1093 |
break
|
| 1094 |
|
| 1095 |
+
# ์ถ์ฒ ๊ฐ์๊ฐ ๋ถ์กฑํ๋ค๋ฉด, ๋๋จธ์ง ์ถ์ฒ์ ์ถ๊ฐ
|
| 1096 |
+
if len(balanced_recommendations) < top_n:
|
| 1097 |
+
for item, score in scored:
|
| 1098 |
+
if len(balanced_recommendations) < top_n:
|
| 1099 |
+
balanced_recommendations.append((item, score))
|
| 1100 |
+
else:
|
| 1101 |
+
break
|
| 1102 |
+
|
| 1103 |
return balanced_recommendations
|
| 1104 |
|
| 1105 |
|