Spaces:
Runtime error
Runtime error
Commit
·
6a7d122
1
Parent(s):
83b6f4e
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,10 +7,13 @@ def predict(input_text, option):
|
|
| 7 |
if option == "Semantic search":
|
| 8 |
|
| 9 |
response = db_lookup.recommend_based_on_text(input_text)
|
| 10 |
-
output = f"Message: {response['message']} \n Datasets: {'
|
| 11 |
elif option == 'Dataset similarity':
|
| 12 |
response = db_lookup.get_similar_datasets(input_text)
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
else:
|
| 16 |
output = "Please select an option"
|
|
|
|
| 7 |
if option == "Semantic search":
|
| 8 |
|
| 9 |
response = db_lookup.recommend_based_on_text(input_text)
|
| 10 |
+
output = f"Message: {response['message']} \n \n Datasets: {' \n '.join([x for x in response['datasets']])}"
|
| 11 |
elif option == 'Dataset similarity':
|
| 12 |
response = db_lookup.get_similar_datasets(input_text)
|
| 13 |
+
if 'error' in response:
|
| 14 |
+
output = response['error']
|
| 15 |
+
else:
|
| 16 |
+
output = f"Similar Datasets: {' \n '.join([x for x in response['datasets']])}"
|
| 17 |
|
| 18 |
else:
|
| 19 |
output = "Please select an option"
|