Spaces:
Runtime error
Runtime error
Commit ·
a4967e1
1
Parent(s): 4fd42f1
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,7 +44,7 @@ if submit_button:
|
|
| 44 |
sentence_embeddings = model.encode(sentences)
|
| 45 |
|
| 46 |
cos_sim = cosine_similarity(sentence_embeddings[0].reshape(1, -1), sentence_embeddings[1].reshape(1, -1))[0][0]
|
| 47 |
-
cos_sim = cos_sim * 100 # Convert to percentage
|
| 48 |
|
| 49 |
|
| 50 |
st.write('Similarity between {} and {} is {}%'.format(sentence_1,
|
|
|
|
| 44 |
sentence_embeddings = model.encode(sentences)
|
| 45 |
|
| 46 |
cos_sim = cosine_similarity(sentence_embeddings[0].reshape(1, -1), sentence_embeddings[1].reshape(1, -1))[0][0]
|
| 47 |
+
cos_sim = round(cos_sim * 100) # Convert to percentage and round-off
|
| 48 |
|
| 49 |
|
| 50 |
st.write('Similarity between {} and {} is {}%'.format(sentence_1,
|