Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,11 +37,14 @@ def mapping_code(user_input):
|
|
| 37 |
|
| 38 |
# Return top 5 entries with 'code', 'description', and 'similarity_score'
|
| 39 |
top_5_results = []
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
| 44 |
|
|
|
|
| 45 |
# Streamlit frontend interface
|
| 46 |
def main():
|
| 47 |
st.title("CPT Description Mapping")
|
|
|
|
| 37 |
|
| 38 |
# Return top 5 entries with 'code', 'description', and 'similarity_score'
|
| 39 |
top_5_results = []
|
| 40 |
+
if num_results > 0:
|
| 41 |
+
for i in range(num_results):
|
| 42 |
+
code, description, similarity_score = result[i]
|
| 43 |
+
top_5_results.append({"Code": code, "Description": description, "Similarity Score": similarity_score})
|
| 44 |
+
else:
|
| 45 |
+
top_5_results.append({"Code": "", "Description": "No similar sentences found", "Similarity Score": 0.0})
|
| 46 |
|
| 47 |
+
return top_5_results
|
| 48 |
# Streamlit frontend interface
|
| 49 |
def main():
|
| 50 |
st.title("CPT Description Mapping")
|