Mattral commited on
Commit
8c784dc
·
verified ·
1 Parent(s): f75ddf6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -61,14 +61,17 @@ def find_exact_match(df1, df2, column_name):
61
  matches = pd.merge(df1, df2, on=column_name, how='inner')
62
  return matches
63
 
64
-
65
  def find_similar_texts(df1, df2, column_name, threshold=0.3):
66
  # Find rows with similar texts in the specified column, including exact matches
67
  similar_texts = []
68
  exact_matches = []
69
 
 
 
 
 
70
  # Concatenate texts from both dataframes
71
- all_texts = df1[column_name].astype(str).tolist() + df2[column_name].astype(str).tolist()
72
 
73
  # Compute TF-IDF vectors
74
  vectorizer = TfidfVectorizer()
@@ -95,6 +98,7 @@ def find_similar_texts(df1, df2, column_name, threshold=0.3):
95
  return similar_texts, exact_matches
96
 
97
 
 
98
  def main():
99
  st.title("Item Comparison App")
100
 
 
61
  matches = pd.merge(df1, df2, on=column_name, how='inner')
62
  return matches
63
 
 
64
  def find_similar_texts(df1, df2, column_name, threshold=0.3):
65
  # Find rows with similar texts in the specified column, including exact matches
66
  similar_texts = []
67
  exact_matches = []
68
 
69
+ # Convert numeric values to strings
70
+ df1[column_name] = df1[column_name].astype(str)
71
+ df2[column_name] = df2[column_name].astype(str)
72
+
73
  # Concatenate texts from both dataframes
74
+ all_texts = df1[column_name].tolist() + df2[column_name].tolist()
75
 
76
  # Compute TF-IDF vectors
77
  vectorizer = TfidfVectorizer()
 
98
  return similar_texts, exact_matches
99
 
100
 
101
+
102
  def main():
103
  st.title("Item Comparison App")
104