Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ def validate_input(input_string):
|
|
24 |
return False
|
25 |
|
26 |
# Define the function for mapping code
|
27 |
-
def mapping_code(user_input
|
28 |
|
29 |
emb1 = model.encode(user_input.lower())
|
30 |
similarities = []
|
@@ -33,7 +33,7 @@ def mapping_code(user_input,user_slider_input_number):
|
|
33 |
similarities.append(similarity)
|
34 |
|
35 |
# Filter results with similarity scores above 0.70
|
36 |
-
result = [(code, desc, sim) for (code, desc, sim) in zip(stored_data["SBS_code"], stored_data["Description"], similarities)
|
37 |
|
38 |
# Sort results by similarity scores
|
39 |
result.sort(key=lambda x: x[2], reverse=True)
|
|
|
24 |
return False
|
25 |
|
26 |
# Define the function for mapping code
|
27 |
+
def mapping_code(user_input):
|
28 |
|
29 |
emb1 = model.encode(user_input.lower())
|
30 |
similarities = []
|
|
|
33 |
similarities.append(similarity)
|
34 |
|
35 |
# Filter results with similarity scores above 0.70
|
36 |
+
result = [(code, desc, sim) for (code, desc, sim) in zip(stored_data["SBS_code"], stored_data["Description"], similarities)]
|
37 |
|
38 |
# Sort results by similarity scores
|
39 |
result.sort(key=lambda x: x[2], reverse=True)
|