Update app.py
Browse files
app.py
CHANGED
@@ -46,11 +46,12 @@ def find_similar_texts(model_name, input_text):
|
|
46 |
sorted_embeddings = text_embeddings.sort_values(by='euclidean_distance', ascending=True)
|
47 |
top_five = sorted_embeddings.head(5)[['abstract', 'patent no', 'title']]
|
48 |
# formatted_output = '\n\n'.join([f"<Patent No: {row['patent no']}\nTitle: {row['title']}\nAbstract: {row['abstract']}" for index, row in top_five.iterrows()])
|
49 |
-
formatted_output = '
|
50 |
f"<strong>Patent No:</strong> {row['patent no']}<br>"
|
51 |
f"<strong>Title:</strong> {row['title']}<br>"
|
52 |
-
f"<strong>Abstract:</strong> {row['abstract']}"
|
53 |
-
|
|
|
54 |
])
|
55 |
return formatted_output
|
56 |
else:
|
|
|
46 |
sorted_embeddings = text_embeddings.sort_values(by='euclidean_distance', ascending=True)
|
47 |
top_five = sorted_embeddings.head(5)[['abstract', 'patent no', 'title']]
|
48 |
# formatted_output = '\n\n'.join([f"<Patent No: {row['patent no']}\nTitle: {row['title']}\nAbstract: {row['abstract']}" for index, row in top_five.iterrows()])
|
49 |
+
formatted_output = '<br><br>'.join([
|
50 |
f"<strong>Patent No:</strong> {row['patent no']}<br>"
|
51 |
f"<strong>Title:</strong> {row['title']}<br>"
|
52 |
+
f"<strong>Abstract:</strong> {row['abstract']}<br>"
|
53 |
+
for index, row in top_five.iterrows()
|
54 |
+
])
|
55 |
])
|
56 |
return formatted_output
|
57 |
else:
|