deeksonparlma
commited on
Commit
·
d826060
1
Parent(s):
5ef5295
updates to response
Browse files
app.py
CHANGED
|
@@ -52,13 +52,13 @@ def chat(message):
|
|
| 52 |
results_index = np.argmax(results)
|
| 53 |
tag = labels[results_index]
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
# responses = tg['responses']
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
|
|
|
| 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
|