deeksonparlma commited on
Commit ·
fa80c7a
1
Parent(s): 45bf0b2
refactor
Browse files45 unmodified lines464748494950512 unmodified lines545556585960616263575859606145 unmodified lines
def chat(message): history = history or [] message = message.lower() results = model.predict([bag_of_words(message, words)]) results_index = np.argmax(results)2 unmodified lines for tg in data["intents"]: if tg['tag'] == tag: responses = tg['responses']
# print(random.choice(responses)) response = random.choice(responses) return str(response) # return responses return random.choice(responses) # history.append((message, response)) # return history, historyapp.py+2-7