Spaces:
Runtime error
Runtime error
Commit
·
4fd42f1
1
Parent(s):
68b6bdf
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,13 @@
|
|
| 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import streamlit as st
|
| 3 |
from transformers import pipeline
|
| 4 |
from textblob import TextBlob
|
|
@@ -35,6 +44,7 @@ if submit_button:
|
|
| 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,
|
|
|
|
| 1 |
|
| 2 |
+
''' To-do
|
| 3 |
+
|
| 4 |
+
Create a side bar to compare two or upload CSV
|
| 5 |
+
|
| 6 |
+
In the second tab, allow them to compare all CSV files
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
'''
|
| 10 |
+
|
| 11 |
import streamlit as st
|
| 12 |
from transformers import pipeline
|
| 13 |
from textblob import TextBlob
|
|
|
|
| 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,
|