deeksonparlma commited on
Commit
d826060
·
1 Parent(s): 5ef5295

updates to response

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -52,13 +52,13 @@ def chat(message):
52
  results_index = np.argmax(results)
53
  tag = labels[results_index]
54
 
55
- return tag
56
- # for tg in data["intents"]:
57
- # if tg['tag'] == tag:
58
- # responses = tg['responses']
59
 
60
- # # print(random.choice(responses))
61
- # response = random.choice(responses)
 
62
 
63
  # history.append((message, response))
64
  # return history, history
 
52
  results_index = np.argmax(results)
53
  tag = labels[results_index]
54
 
55
+ for tg in data["intents"]:
56
+ if tg['tag'] == tag:
57
+ responses = tg['responses']
 
58
 
59
+ # print(random.choice(responses))
60
+ response = random.choice(responses)
61
+ return response
62
 
63
  # history.append((message, response))
64
  # return history, history