Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,21 +28,17 @@ def find_most_similar_command(statement, command_list):
|
|
| 28 |
|
| 29 |
# Using globals() to create a global variable
|
| 30 |
for index,file_list in command_list.items():
|
| 31 |
-
|
| 32 |
for command in file_list:
|
| 33 |
similarity = SequenceMatcher(None, statement, command).ratio()
|
| 34 |
-
|
| 35 |
-
"sum_match_"+str(i)="sum_match_"+str(i)+similarity
|
| 36 |
-
print("sum_match_"+str(i))
|
| 37 |
print(index,"similarity",similarity)
|
| 38 |
if similarity > highest_similarity:
|
| 39 |
highest_similarity = similarity
|
| 40 |
best_match = command
|
| 41 |
reply=index
|
| 42 |
print(i)
|
| 43 |
-
|
| 44 |
-
i=i+1
|
| 45 |
-
return best_match,reply
|
| 46 |
|
| 47 |
def transcribe_the_command(audio,menu_id,abc):
|
| 48 |
import soundfile as sf
|
|
|
|
| 28 |
|
| 29 |
# Using globals() to create a global variable
|
| 30 |
for index,file_list in command_list.items():
|
| 31 |
+
i = 0
|
| 32 |
for command in file_list:
|
| 33 |
similarity = SequenceMatcher(None, statement, command).ratio()
|
| 34 |
+
i= i+similarity
|
|
|
|
|
|
|
| 35 |
print(index,"similarity",similarity)
|
| 36 |
if similarity > highest_similarity:
|
| 37 |
highest_similarity = similarity
|
| 38 |
best_match = command
|
| 39 |
reply=index
|
| 40 |
print(i)
|
| 41 |
+
return best_match,reply
|
|
|
|
|
|
|
| 42 |
|
| 43 |
def transcribe_the_command(audio,menu_id,abc):
|
| 44 |
import soundfile as sf
|