Zeitstaub commited on
Commit
9c4539c
1 Parent(s): f58eab9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -44,7 +44,7 @@ def find_similar_texts(model_name, input_text):
44
  distances = euclidean_distances(embedding_matrix, input_embedding).flatten()
45
  text_embeddings['euclidean_distance'] = distances
46
  sorted_embeddings = text_embeddings.sort_values(by='euclidean_distance', ascending=True)
47
- top_five = sorted_embeddings.head(5)[['abstract', 'patent no']]
48
  # formatted_output = '\n\n'.join([f"Patent No: {row['patent no']}\nAbstract: {row['abstract']}\n" for index, row in top_five.iterrows()])
49
  formatted_output = '\n\n'.join([f"Patent No: {row['patent no']}\nTitle: {row['title']}\nAbstract: {row['abstract']}\n" for index, row in top_five.iterrows()])
50
  return formatted_output
 
44
  distances = euclidean_distances(embedding_matrix, input_embedding).flatten()
45
  text_embeddings['euclidean_distance'] = distances
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']}\nAbstract: {row['abstract']}\n" for index, row in top_five.iterrows()])
49
  formatted_output = '\n\n'.join([f"Patent No: {row['patent no']}\nTitle: {row['title']}\nAbstract: {row['abstract']}\n" for index, row in top_five.iterrows()])
50
  return formatted_output