Hunzla commited on
Commit
fe27f73
1 Parent(s): 958f011

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -24,16 +24,14 @@ 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
- i=0
28
- for sub_list in command_list:
29
  for command in sub_list:
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=i
36
- i+=1
37
 
38
  return best_match,reply
39
 
 
24
  def find_most_similar_command(statement, command_list):
25
  best_match = None
26
  highest_similarity = 0
27
+ for index,sub_list in command_list:
 
28
  for command in sub_list:
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=index
 
35
 
36
  return best_match,reply
37