Update app.py
Browse files
app.py
CHANGED
@@ -216,7 +216,7 @@ def process_batch(batch):
|
|
216 |
|
217 |
try:
|
218 |
for movie in batch:
|
219 |
-
embedding_string = f"Название: {movie['name']}\nГод: {movie['year']}\nЖанры: {movie['
|
220 |
string_crc32 = calculate_crc32(embedding_string)
|
221 |
|
222 |
# Проверяем существующий эмбеддинг
|
@@ -305,7 +305,7 @@ def rerank_results(query, results):
|
|
305 |
for movie_id, _ in results:
|
306 |
movie = next((m for m in movies_data if m['id'] == movie_id), None)
|
307 |
if movie:
|
308 |
-
movie_info = f"Название: {movie['name']}\nГод: {movie['year']}\nЖанры: {movie['
|
309 |
pairs.append([query, movie_info])
|
310 |
movie_ids.append(movie_id)
|
311 |
|
@@ -376,7 +376,7 @@ def search_movies(query, top_k=20):
|
|
376 |
movie = next((m for m in movies_data if m['id'] == movie_id), None)
|
377 |
if movie:
|
378 |
output += f"<h3>{movie['name']} ({movie['year']})</h3>\n"
|
379 |
-
output += f"<p><strong>Жанры:</strong> {movie['
|
380 |
output += f"<p><strong>Описание:</strong> {movie['description']}</p>\n"
|
381 |
output += f"<p><strong>Релевантность (reranker score):</strong> {score:.4f}</p>\n"
|
382 |
output += "<hr>\n"
|
|
|
216 |
|
217 |
try:
|
218 |
for movie in batch:
|
219 |
+
embedding_string = f"Название: {movie['name']}\nГод: {movie['year']}\nЖанры: {movie['genreslist']}\nОписание: {movie['description']}"
|
220 |
string_crc32 = calculate_crc32(embedding_string)
|
221 |
|
222 |
# Проверяем существующий эмбеддинг
|
|
|
305 |
for movie_id, _ in results:
|
306 |
movie = next((m for m in movies_data if m['id'] == movie_id), None)
|
307 |
if movie:
|
308 |
+
movie_info = f"Название: {movie['name']}\nГод: {movie['year']}\nЖанры: {movie['genreslist']}\nОписание: {movie['description']}"
|
309 |
pairs.append([query, movie_info])
|
310 |
movie_ids.append(movie_id)
|
311 |
|
|
|
376 |
movie = next((m for m in movies_data if m['id'] == movie_id), None)
|
377 |
if movie:
|
378 |
output += f"<h3>{movie['name']} ({movie['year']})</h3>\n"
|
379 |
+
output += f"<p><strong>Жанры:</strong> {movie['genreslist']}</p>\n"
|
380 |
output += f"<p><strong>Описание:</strong> {movie['description']}</p>\n"
|
381 |
output += f"<p><strong>Релевантность (reranker score):</strong> {score:.4f}</p>\n"
|
382 |
output += "<hr>\n"
|