thugCodeNinja commited on
Commit
5a1664a
·
verified ·
1 Parent(s): a787fb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -71,7 +71,7 @@ def process_text(input_text):
71
  # Calculate cosine similarity between the input text and the article text embeddings
72
  similarity = cosine_similarity(embedding1, embedding2)[0][0]
73
  if similarity > threshold:
74
- similar_articles.append([link,similarity])
75
  similar_articles = sorted(similar_articles, key=lambda x: x[1], reverse=True)
76
  #threshold = 0.5 # Adjust the threshold as needed
77
  return similar_articles[:5]
 
71
  # Calculate cosine similarity between the input text and the article text embeddings
72
  similarity = cosine_similarity(embedding1, embedding2)[0][0]
73
  if similarity > threshold:
74
+ similar_articles.append([link,float(similarity)])
75
  similar_articles = sorted(similar_articles, key=lambda x: x[1], reverse=True)
76
  #threshold = 0.5 # Adjust the threshold as needed
77
  return similar_articles[:5]