Spaces:
Runtime error
Runtime error
Commit
•
b0f213e
1
Parent(s):
bc90e89
Update app.py
Browse files
app.py
CHANGED
@@ -15,8 +15,6 @@ from sklearn.metrics.pairwise import cosine_similarity
|
|
15 |
|
16 |
model = SentenceTransformer('paraphrase-xlm-r-multilingual-v1')
|
17 |
|
18 |
-
sentences = []
|
19 |
-
|
20 |
# Streamlit interface
|
21 |
|
22 |
st.title("Sentence Similarity")
|
@@ -45,6 +43,9 @@ if sidebar_selectbox == "Compare two sentences":
|
|
45 |
|
46 |
# Perform calculations
|
47 |
|
|
|
|
|
|
|
48 |
# Append input sentences to 'sentences' list
|
49 |
sentences.append(sentence_1)
|
50 |
sentences.append(sentence_2)
|
@@ -75,14 +76,18 @@ if sidebar_selectbox == "Bulk upload and mark":
|
|
75 |
st.write(file_details)
|
76 |
df = pd.read_csv(data_file)
|
77 |
|
78 |
-
#
|
79 |
total_rows = df.shape[0]
|
80 |
|
81 |
similarity_scores = []
|
82 |
|
|
|
|
|
|
|
83 |
# similarity_scores.append()
|
84 |
|
|
|
|
|
85 |
# df['Similarity'] = similarity_scores
|
86 |
|
87 |
-
st.dataframe(df)
|
88 |
-
st.write(total_rows)
|
|
|
15 |
|
16 |
model = SentenceTransformer('paraphrase-xlm-r-multilingual-v1')
|
17 |
|
|
|
|
|
18 |
# Streamlit interface
|
19 |
|
20 |
st.title("Sentence Similarity")
|
|
|
43 |
|
44 |
# Perform calculations
|
45 |
|
46 |
+
#Initialise sentences
|
47 |
+
sentences = []
|
48 |
+
|
49 |
# Append input sentences to 'sentences' list
|
50 |
sentences.append(sentence_1)
|
51 |
sentences.append(sentence_2)
|
|
|
76 |
st.write(file_details)
|
77 |
df = pd.read_csv(data_file)
|
78 |
|
79 |
+
# Get length of df.shape
|
80 |
total_rows = df.shape[0]
|
81 |
|
82 |
similarity_scores = []
|
83 |
|
84 |
+
for index, sentence in enumerate(range(total_rows)):
|
85 |
+
|
86 |
+
|
87 |
# similarity_scores.append()
|
88 |
|
89 |
+
# Append new column to dataframe
|
90 |
+
|
91 |
# df['Similarity'] = similarity_scores
|
92 |
|
93 |
+
st.dataframe(df)
|
|