Spaces:
Running
Running
Commit
Browse files- Pages/Recommender App.py +100 -53
Pages/Recommender App.py
CHANGED
@@ -91,19 +91,26 @@ def top_animes():
|
|
91 |
style_for_page = """
|
92 |
<style>
|
93 |
div.st-emotion-cache-1v0mbdj.e115fcil1>img {
|
94 |
-
border-radius:
|
95 |
}
|
96 |
-
|
97 |
-
border-radius: 15px;
|
98 |
text-align: center;
|
99 |
}
|
100 |
-
|
101 |
font-weight: 600;
|
|
|
|
|
|
|
|
|
102 |
}
|
103 |
-
|
104 |
-
scale: 1.
|
105 |
transition-duration: 0.3s;
|
106 |
}
|
|
|
|
|
|
|
|
|
107 |
</style>
|
108 |
"""
|
109 |
st.markdown(style_for_page, unsafe_allow_html=True)
|
@@ -113,16 +120,16 @@ def top_animes():
|
|
113 |
with st.container():
|
114 |
col0, col1, col2, col3 = st.columns(4)
|
115 |
with col0:
|
116 |
-
st.write("[top8.iloc[0].title](top8.iloc[0].
|
117 |
st.image(top8.iloc[0].poster, use_column_width=True)
|
118 |
with col1:
|
119 |
-
st.write("")
|
120 |
st.image(top8.iloc[1].poster, use_column_width=True)
|
121 |
with col2:
|
122 |
-
st.write("")
|
123 |
st.image(top8.iloc[2].poster, use_column_width=True)
|
124 |
with col3:
|
125 |
-
st.write("")
|
126 |
st.image(top8.iloc[3].poster, use_column_width=True)
|
127 |
|
128 |
st.divider()
|
@@ -130,16 +137,16 @@ def top_animes():
|
|
130 |
with st.container():
|
131 |
col4, col5, col6, col7 = st.columns(4)
|
132 |
with col4:
|
133 |
-
st.write("")
|
134 |
st.image(top8.iloc[4].poster, use_column_width=True)
|
135 |
with col5:
|
136 |
-
st.write("")
|
137 |
st.image(top8.iloc[5].poster, use_column_width=True)
|
138 |
with col6:
|
139 |
-
st.write("")
|
140 |
st.image(top8.iloc[6].poster, use_column_width=True)
|
141 |
with col7:
|
142 |
-
st.write("")
|
143 |
st.image(top8.iloc[7].poster, use_column_width=True)
|
144 |
|
145 |
|
@@ -148,19 +155,26 @@ def top_animes_genres(genre_select):
|
|
148 |
style_for_page = """
|
149 |
<style>
|
150 |
div.st-emotion-cache-1v0mbdj.e115fcil1>img {
|
151 |
-
border-radius:
|
152 |
}
|
153 |
-
|
154 |
-
border-radius: 15px;
|
155 |
text-align: center;
|
156 |
}
|
157 |
-
|
158 |
font-weight: 600;
|
159 |
-
|
160 |
-
|
161 |
-
|
|
|
|
|
|
|
|
|
162 |
transition-duration: 0.3s;
|
163 |
}
|
|
|
|
|
|
|
|
|
164 |
</style>
|
165 |
"""
|
166 |
st.markdown(style_for_page, unsafe_allow_html=True)
|
@@ -170,25 +184,33 @@ def top_animes_genres(genre_select):
|
|
170 |
].sort_values("score", ascending=False)[:8]
|
171 |
col0, col1, col2, col3 = st.columns(4)
|
172 |
with col0:
|
173 |
-
st.write("
|
|
|
174 |
with col1:
|
175 |
-
st.write("
|
|
|
176 |
with col2:
|
177 |
-
st.write("
|
|
|
178 |
with col3:
|
179 |
-
st.write("
|
|
|
180 |
|
181 |
st.divider()
|
182 |
|
183 |
col4, col5, col6, col7 = st.columns(4)
|
184 |
with col4:
|
185 |
-
st.write("
|
|
|
186 |
with col5:
|
187 |
-
st.write("
|
|
|
188 |
with col6:
|
189 |
-
st.write("
|
|
|
190 |
with col7:
|
191 |
-
st.write("
|
|
|
192 |
|
193 |
|
194 |
# Function to display the top 8 animes with user given anime name for all genres
|
@@ -196,19 +218,26 @@ def top_animes_custom(anime_select):
|
|
196 |
style_for_page = """
|
197 |
<style>
|
198 |
div.st-emotion-cache-1v0mbdj.e115fcil1>img {
|
199 |
-
border-radius:
|
200 |
}
|
201 |
-
|
202 |
-
border-radius: 15px;
|
203 |
text-align: center;
|
204 |
}
|
205 |
-
|
206 |
font-weight: 600;
|
207 |
-
|
208 |
-
|
209 |
-
|
|
|
|
|
|
|
|
|
210 |
transition-duration: 0.3s;
|
211 |
}
|
|
|
|
|
|
|
|
|
212 |
</style>
|
213 |
"""
|
214 |
st.markdown(style_for_page, unsafe_allow_html=True)
|
@@ -221,16 +250,16 @@ def top_animes_custom(anime_select):
|
|
221 |
with st.container():
|
222 |
col0, col1, col2, col3 = st.columns(4)
|
223 |
with col0:
|
224 |
-
st.write("")
|
225 |
st.image(recommended_anime_posters[0], use_column_width=True)
|
226 |
with col1:
|
227 |
-
st.write("")
|
228 |
st.image(recommended_anime_posters[1], use_column_width=True)
|
229 |
with col2:
|
230 |
-
st.write("")
|
231 |
st.image(recommended_anime_posters[2], use_column_width=True)
|
232 |
with col3:
|
233 |
-
st.write("")
|
234 |
st.image(recommended_anime_posters[3], use_column_width=True)
|
235 |
|
236 |
st.divider()
|
@@ -238,16 +267,16 @@ def top_animes_custom(anime_select):
|
|
238 |
with st.container():
|
239 |
col4, col5, col6, col7 = st.columns(4)
|
240 |
with col4:
|
241 |
-
st.write("")
|
242 |
st.image(recommended_anime_posters[4], use_column_width=True)
|
243 |
with col5:
|
244 |
-
st.write("")
|
245 |
st.image(recommended_anime_posters[5], use_column_width=True)
|
246 |
with col6:
|
247 |
-
st.write("")
|
248 |
st.image(recommended_anime_posters[6], use_column_width=True)
|
249 |
with col7:
|
250 |
-
st.write("")
|
251 |
st.image(recommended_anime_posters[7], use_column_width=True)
|
252 |
|
253 |
|
@@ -256,7 +285,7 @@ def top_animes_custom_genres(anime_select, genre_select):
|
|
256 |
style_for_page = """
|
257 |
<style>
|
258 |
div.st-emotion-cache-1v0mbdj.e115fcil1>img {
|
259 |
-
border-radius:
|
260 |
}
|
261 |
a.st-emotion-cache-1lbx6hs.e16zdaao0 {
|
262 |
border-radius: 15px;
|
@@ -269,6 +298,24 @@ def top_animes_custom_genres(anime_select, genre_select):
|
|
269 |
scale: 1.05;
|
270 |
transition-duration: 0.3s;
|
271 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
</style>
|
273 |
"""
|
274 |
st.markdown(style_for_page, unsafe_allow_html=True)
|
@@ -281,16 +328,16 @@ def top_animes_custom_genres(anime_select, genre_select):
|
|
281 |
with st.container():
|
282 |
col0, col1, col2, col3 = st.columns(4)
|
283 |
with col0:
|
284 |
-
st.write("")
|
285 |
st.image(recommended_anime_posters[0], use_column_width=True)
|
286 |
with col1:
|
287 |
-
st.write("")
|
288 |
st.image(recommended_anime_posters[1], use_column_width=True)
|
289 |
with col2:
|
290 |
-
st.write("")
|
291 |
st.image(recommended_anime_posters[2], use_column_width=True)
|
292 |
with col3:
|
293 |
-
st.write("")
|
294 |
st.image(recommended_anime_posters[3], use_column_width=True)
|
295 |
|
296 |
st.divider()
|
@@ -298,16 +345,16 @@ def top_animes_custom_genres(anime_select, genre_select):
|
|
298 |
with st.container():
|
299 |
col4, col5, col6, col7 = st.columns(4)
|
300 |
with col4:
|
301 |
-
st.write("")
|
302 |
st.image(recommended_anime_posters[4], use_column_width=True)
|
303 |
with col5:
|
304 |
-
st.write("")
|
305 |
st.image(recommended_anime_posters[5], use_column_width=True)
|
306 |
with col6:
|
307 |
-
st.write("")
|
308 |
st.image(recommended_anime_posters[6], use_column_width=True)
|
309 |
with col7:
|
310 |
-
st.write("")
|
311 |
st.image(recommended_anime_posters[7], use_column_width=True)
|
312 |
|
313 |
|
|
|
91 |
style_for_page = """
|
92 |
<style>
|
93 |
div.st-emotion-cache-1v0mbdj.e115fcil1>img {
|
94 |
+
border-radius: 25px;
|
95 |
}
|
96 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5 {
|
|
|
97 |
text-align: center;
|
98 |
}
|
99 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5>p {
|
100 |
font-weight: 600;
|
101 |
+
text-decoration: none;
|
102 |
+
border: 3px solid #607985;
|
103 |
+
border-radius: 10px;
|
104 |
+
text-color: #607985;
|
105 |
}
|
106 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5>p:hover {
|
107 |
+
scale: 1.10;
|
108 |
transition-duration: 0.3s;
|
109 |
}
|
110 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5>p>a {
|
111 |
+
text-decoration: none;
|
112 |
+
color: #607985;
|
113 |
+
}
|
114 |
</style>
|
115 |
"""
|
116 |
st.markdown(style_for_page, unsafe_allow_html=True)
|
|
|
120 |
with st.container():
|
121 |
col0, col1, col2, col3 = st.columns(4)
|
122 |
with col0:
|
123 |
+
st.write(f"[{top8.iloc[0].title}]({top8.iloc[0].anime_url})")
|
124 |
st.image(top8.iloc[0].poster, use_column_width=True)
|
125 |
with col1:
|
126 |
+
st.write(f"[{top8.iloc[1].title}]({top8.iloc[1].anime_url})")
|
127 |
st.image(top8.iloc[1].poster, use_column_width=True)
|
128 |
with col2:
|
129 |
+
st.write(f"[{top8.iloc[2].title}]({top8.iloc[2].anime_url})")
|
130 |
st.image(top8.iloc[2].poster, use_column_width=True)
|
131 |
with col3:
|
132 |
+
st.write(f"[{top8.iloc[3].title}]({top8.iloc[3].anime_url})")
|
133 |
st.image(top8.iloc[3].poster, use_column_width=True)
|
134 |
|
135 |
st.divider()
|
|
|
137 |
with st.container():
|
138 |
col4, col5, col6, col7 = st.columns(4)
|
139 |
with col4:
|
140 |
+
st.write(f"[{top8.iloc[4].title}]({top8.iloc[4].anime_url})")
|
141 |
st.image(top8.iloc[4].poster, use_column_width=True)
|
142 |
with col5:
|
143 |
+
st.write(f"[{top8.iloc[5].title}]({top8.iloc[5].anime_url})")
|
144 |
st.image(top8.iloc[5].poster, use_column_width=True)
|
145 |
with col6:
|
146 |
+
st.write(f"[{top8.iloc[6].title}]({top8.iloc[6].anime_url})")
|
147 |
st.image(top8.iloc[6].poster, use_column_width=True)
|
148 |
with col7:
|
149 |
+
st.write(f"[{top8.iloc[7].title}]({top8.iloc[7].anime_url})")
|
150 |
st.image(top8.iloc[7].poster, use_column_width=True)
|
151 |
|
152 |
|
|
|
155 |
style_for_page = """
|
156 |
<style>
|
157 |
div.st-emotion-cache-1v0mbdj.e115fcil1>img {
|
158 |
+
border-radius: 25px;
|
159 |
}
|
160 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5 {
|
|
|
161 |
text-align: center;
|
162 |
}
|
163 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5>p {
|
164 |
font-weight: 600;
|
165 |
+
text-decoration: none;
|
166 |
+
border: 3px solid #607985;
|
167 |
+
border-radius: 10px;
|
168 |
+
text-color: #607985;
|
169 |
+
}
|
170 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5>p:hover {
|
171 |
+
scale: 1.10;
|
172 |
transition-duration: 0.3s;
|
173 |
}
|
174 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5>p>a {
|
175 |
+
text-decoration: none;
|
176 |
+
color: #607985;
|
177 |
+
}
|
178 |
</style>
|
179 |
"""
|
180 |
st.markdown(style_for_page, unsafe_allow_html=True)
|
|
|
184 |
].sort_values("score", ascending=False)[:8]
|
185 |
col0, col1, col2, col3 = st.columns(4)
|
186 |
with col0:
|
187 |
+
st.write(f"[{top_8_genre.iloc[0].title}]({top_8_genre.iloc[0].anime_url})")
|
188 |
+
st.image(top_8_genre.iloc[0].poster, use_column_width=True)
|
189 |
with col1:
|
190 |
+
st.write(f"[{top_8_genre.iloc[1].title}]({top_8_genre.iloc[1].anime_url})")
|
191 |
+
st.image(top_8_genre.iloc[1].poster, use_column_width=True)
|
192 |
with col2:
|
193 |
+
st.write(f"[{top_8_genre.iloc[2].title}]({top_8_genre.iloc[2].anime_url})")
|
194 |
+
st.image(top_8_genre.iloc[2].poster, use_column_width=True)
|
195 |
with col3:
|
196 |
+
st.write(f"[{top_8_genre.iloc[3].title}]({top_8_genre.iloc[3].anime_url})")
|
197 |
+
st.image(top_8_genre.iloc[3].poster, use_column_width=True)
|
198 |
|
199 |
st.divider()
|
200 |
|
201 |
col4, col5, col6, col7 = st.columns(4)
|
202 |
with col4:
|
203 |
+
st.write(f"[{top_8_genre.iloc[4].title}]({top_8_genre.iloc[4].anime_url})")
|
204 |
+
st.image(top_8_genre.iloc[4].poster, use_column_width=True)
|
205 |
with col5:
|
206 |
+
st.write(f"[{top_8_genre.iloc[5].title}]({top_8_genre.iloc[5].anime_url})")
|
207 |
+
st.image(top_8_genre.iloc[5].poster, use_column_width=True)
|
208 |
with col6:
|
209 |
+
st.write(f"[{top_8_genre.iloc[6].title}]({top_8_genre.iloc[6].anime_url})")
|
210 |
+
st.image(top_8_genre.iloc[6].poster, use_column_width=True)
|
211 |
with col7:
|
212 |
+
st.write(f"[{top_8_genre.iloc[7].title}]({top_8_genre.iloc[7].anime_url})")
|
213 |
+
st.image(top_8_genre.iloc[7].poster, use_column_width=True)
|
214 |
|
215 |
|
216 |
# Function to display the top 8 animes with user given anime name for all genres
|
|
|
218 |
style_for_page = """
|
219 |
<style>
|
220 |
div.st-emotion-cache-1v0mbdj.e115fcil1>img {
|
221 |
+
border-radius: 25px;
|
222 |
}
|
223 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5 {
|
|
|
224 |
text-align: center;
|
225 |
}
|
226 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5>p {
|
227 |
font-weight: 600;
|
228 |
+
text-decoration: none;
|
229 |
+
border: 3px solid #607985;
|
230 |
+
border-radius: 10px;
|
231 |
+
text-color: #607985;
|
232 |
+
}
|
233 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5>p:hover {
|
234 |
+
scale: 1.10;
|
235 |
transition-duration: 0.3s;
|
236 |
}
|
237 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5>p>a {
|
238 |
+
text-decoration: none;
|
239 |
+
color: #607985;
|
240 |
+
}
|
241 |
</style>
|
242 |
"""
|
243 |
st.markdown(style_for_page, unsafe_allow_html=True)
|
|
|
250 |
with st.container():
|
251 |
col0, col1, col2, col3 = st.columns(4)
|
252 |
with col0:
|
253 |
+
st.write(f"[{recommended_anime_names[0]}]({recommended_anime_urls[0]})")
|
254 |
st.image(recommended_anime_posters[0], use_column_width=True)
|
255 |
with col1:
|
256 |
+
st.write(f"[{recommended_anime_names[1]}]({recommended_anime_urls[1]})")
|
257 |
st.image(recommended_anime_posters[1], use_column_width=True)
|
258 |
with col2:
|
259 |
+
st.write(f"[{recommended_anime_names[2]}]({recommended_anime_urls[2]})")
|
260 |
st.image(recommended_anime_posters[2], use_column_width=True)
|
261 |
with col3:
|
262 |
+
st.write(f"[{recommended_anime_names[3]}]({recommended_anime_urls[3]})")
|
263 |
st.image(recommended_anime_posters[3], use_column_width=True)
|
264 |
|
265 |
st.divider()
|
|
|
267 |
with st.container():
|
268 |
col4, col5, col6, col7 = st.columns(4)
|
269 |
with col4:
|
270 |
+
st.write(f"[{recommended_anime_names[4]}]({recommended_anime_urls[4]})")
|
271 |
st.image(recommended_anime_posters[4], use_column_width=True)
|
272 |
with col5:
|
273 |
+
st.write(f"[{recommended_anime_names[5]}]({recommended_anime_urls[5]})")
|
274 |
st.image(recommended_anime_posters[5], use_column_width=True)
|
275 |
with col6:
|
276 |
+
st.write(f"[{recommended_anime_names[6]}]({recommended_anime_urls[6]})")
|
277 |
st.image(recommended_anime_posters[6], use_column_width=True)
|
278 |
with col7:
|
279 |
+
st.write(f"[{recommended_anime_names[7]}]({recommended_anime_urls[7]})")
|
280 |
st.image(recommended_anime_posters[7], use_column_width=True)
|
281 |
|
282 |
|
|
|
285 |
style_for_page = """
|
286 |
<style>
|
287 |
div.st-emotion-cache-1v0mbdj.e115fcil1>img {
|
288 |
+
border-radius: 25px;
|
289 |
}
|
290 |
a.st-emotion-cache-1lbx6hs.e16zdaao0 {
|
291 |
border-radius: 15px;
|
|
|
298 |
scale: 1.05;
|
299 |
transition-duration: 0.3s;
|
300 |
}
|
301 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5 {
|
302 |
+
text-align: center;
|
303 |
+
}
|
304 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5>p {
|
305 |
+
font-weight: 600;
|
306 |
+
text-decoration: none;
|
307 |
+
border: 3px solid #607985;
|
308 |
+
border-radius: 10px;
|
309 |
+
text-color: #607985;
|
310 |
+
}
|
311 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5>p:hover {
|
312 |
+
scale: 1.10;
|
313 |
+
transition-duration: 0.3s;
|
314 |
+
}
|
315 |
+
div.st-emotion-cache-1012qpg.e1nzilvr5>p>a {
|
316 |
+
text-decoration: none;
|
317 |
+
color: #607985;
|
318 |
+
}
|
319 |
</style>
|
320 |
"""
|
321 |
st.markdown(style_for_page, unsafe_allow_html=True)
|
|
|
328 |
with st.container():
|
329 |
col0, col1, col2, col3 = st.columns(4)
|
330 |
with col0:
|
331 |
+
st.write(f"[{recommended_anime_names[0]}]({recommended_anime_urls[0]})")
|
332 |
st.image(recommended_anime_posters[0], use_column_width=True)
|
333 |
with col1:
|
334 |
+
st.write(f"[{recommended_anime_names[1]}]({recommended_anime_urls[1]})")
|
335 |
st.image(recommended_anime_posters[1], use_column_width=True)
|
336 |
with col2:
|
337 |
+
st.write(f"[{recommended_anime_names[2]}]({recommended_anime_urls[2]})")
|
338 |
st.image(recommended_anime_posters[2], use_column_width=True)
|
339 |
with col3:
|
340 |
+
st.write(f"[{recommended_anime_names[3]}]({recommended_anime_urls[3]})")
|
341 |
st.image(recommended_anime_posters[3], use_column_width=True)
|
342 |
|
343 |
st.divider()
|
|
|
345 |
with st.container():
|
346 |
col4, col5, col6, col7 = st.columns(4)
|
347 |
with col4:
|
348 |
+
st.write(f"[{recommended_anime_names[4]}]({recommended_anime_urls[4]})")
|
349 |
st.image(recommended_anime_posters[4], use_column_width=True)
|
350 |
with col5:
|
351 |
+
st.write(f"[{recommended_anime_names[5]}]({recommended_anime_urls[5]})")
|
352 |
st.image(recommended_anime_posters[5], use_column_width=True)
|
353 |
with col6:
|
354 |
+
st.write(f"[{recommended_anime_names[6]}]({recommended_anime_urls[6]})")
|
355 |
st.image(recommended_anime_posters[6], use_column_width=True)
|
356 |
with col7:
|
357 |
+
st.write(f"[{recommended_anime_names[7]}]({recommended_anime_urls[7]})")
|
358 |
st.image(recommended_anime_posters[7], use_column_width=True)
|
359 |
|
360 |
|