Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -24,14 +24,15 @@ with open("tasks.json", "r",encoding="utf-8") as json_file:
|
|
24 |
def find_most_similar_command(statement, command_list):
|
25 |
best_match = None
|
26 |
highest_similarity = 0
|
27 |
-
for index,
|
28 |
-
for
|
|
|
29 |
similarity = SequenceMatcher(None, statement, command).ratio()
|
30 |
print(i,"similarity",similarity)
|
31 |
if similarity > highest_similarity:
|
32 |
highest_similarity = similarity
|
33 |
best_match = command
|
34 |
-
reply=
|
35 |
|
36 |
return best_match,reply
|
37 |
|
|
|
24 |
def find_most_similar_command(statement, command_list):
|
25 |
best_match = None
|
26 |
highest_similarity = 0
|
27 |
+
for index,file_list in command_list.items():
|
28 |
+
for key,value in file_list.items():
|
29 |
+
for command in value:
|
30 |
similarity = SequenceMatcher(None, statement, command).ratio()
|
31 |
print(i,"similarity",similarity)
|
32 |
if similarity > highest_similarity:
|
33 |
highest_similarity = similarity
|
34 |
best_match = command
|
35 |
+
reply=key
|
36 |
|
37 |
return best_match,reply
|
38 |
|