Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -91,9 +91,9 @@ def find_similar_texts(df1, df2, column_name, threshold=0.5):
|
|
91 |
max_length = max(len(row1[column_name]), len(row2[column_name]))
|
92 |
similarity_score = 1 - (distance / max_length)
|
93 |
if similarity_score >= threshold:
|
94 |
-
if similarity
|
95 |
exact_matches.append((i, j, row1[column_name], row2[column_name]))
|
96 |
-
elif similarity
|
97 |
similar_texts.append((i, j, row1[column_name], row2[column_name]))
|
98 |
|
99 |
return similar_texts, exact_matches
|
@@ -101,7 +101,6 @@ def find_similar_texts(df1, df2, column_name, threshold=0.5):
|
|
101 |
|
102 |
|
103 |
|
104 |
-
|
105 |
def main():
|
106 |
st.title("Item Comparison App")
|
107 |
|
|
|
91 |
max_length = max(len(row1[column_name]), len(row2[column_name]))
|
92 |
similarity_score = 1 - (distance / max_length)
|
93 |
if similarity_score >= threshold:
|
94 |
+
if similarity == 1: # Exact match
|
95 |
exact_matches.append((i, j, row1[column_name], row2[column_name]))
|
96 |
+
elif similarity < 1: # Similar but not the same
|
97 |
similar_texts.append((i, j, row1[column_name], row2[column_name]))
|
98 |
|
99 |
return similar_texts, exact_matches
|
|
|
101 |
|
102 |
|
103 |
|
|
|
104 |
def main():
|
105 |
st.title("Item Comparison App")
|
106 |
|