Spaces:
Runtime error
Runtime error
Commit
·
ea052a5
1
Parent(s):
20efea7
Update app.py
Browse files
app.py
CHANGED
@@ -33,9 +33,9 @@ if submit_button:
|
|
33 |
|
34 |
# Create embeddings for both sentences
|
35 |
sentence_embeddings = model.encode(sentences)
|
|
|
|
|
36 |
|
37 |
|
38 |
st.write('Similarity between {} and {} is {}%'.format(sentence_1,
|
39 |
-
sentence_2,
|
40 |
-
cosine_similarity(sentence_embeddings[0].reshape(1, -1),
|
41 |
-
sentence_embeddings[1].reshape(1, -1))[0][0]) * 100)
|
|
|
33 |
|
34 |
# Create embeddings for both sentences
|
35 |
sentence_embeddings = model.encode(sentences)
|
36 |
+
|
37 |
+
cos_sim = cosine_similarity(sentence_embeddings[0].reshape(1, -1), sentence_embeddings[1].reshape(1, -1))[0][0])
|
38 |
|
39 |
|
40 |
st.write('Similarity between {} and {} is {}%'.format(sentence_1,
|
41 |
+
sentence_2, cos_sim)
|
|
|
|