deeksonparlma commited on
Commit ·
fa80c7a
1
Parent(s): 45bf0b2
refactor
Browse files45 unmodified lines464748495051522 unmodified lines55565758596061626364656645 unmodified linesdef chat(message):history = history or []message = message.lower()results = model.predict([bag_of_words(message, words)])results_index = np.argmax(results)2 unmodified linesfor tg in data["intents"]:if tg['tag'] == tag:responses = tg['responses']# print(random.choice(responses))response = random.choice(responses)return str(response)# history.append((message, response))# return history, history45 unmodified lines4647484950512 unmodified lines545556575859606145 unmodified linesdef chat(message):message = message.lower()results = model.predict([bag_of_words(message, words)])results_index = np.argmax(results)2 unmodified linesfor tg in data["intents"]:if tg['tag'] == tag:responses = tg['responses']# return responsesreturn random.choice(responses)# history.append((message, response))# return history, history
app.py+2-7