Skip to content

Commit

Permalink
codice completo
Browse files Browse the repository at this point in the history
  • Loading branch information
serenasensini committed Jan 26, 2020
1 parent af51d00 commit a9e3e50
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
Binary file modified chatbot_model.h5
Binary file not shown.
6 changes: 4 additions & 2 deletions chatgui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import nltk
from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
Expand Down Expand Up @@ -60,9 +59,11 @@ def getResponse(ints, intents_json):
def chatbot_response(msg):
ints = predict_class(msg, model)
res = getResponse(ints, intents)
print(res)
return res


chatbot_response('Thank you')
'''
#Creating GUI with tkinter
import tkinter
from tkinter import *
Expand Down Expand Up @@ -115,3 +116,4 @@ def send():
SendButton.place(x=6, y=401, height=90)
base.mainloop()
'''
Binary file modified classes.pkl
Binary file not shown.
6 changes: 3 additions & 3 deletions train_chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
classes.append(intent['tag'])

words = [lemmatizer.lemmatize(w.lower()) for w in words if w not in ignore_words]
words = sorted(list(set(words)))
#words = sorted(list(set(words)))

classes = sorted(list(set(classes)))
#classes = sorted(list(set(classes)))

print (len(documents), "documents")
print("###########DOCUMENTS")
Expand Down Expand Up @@ -71,7 +71,7 @@

training.append([bag, output_row])
# shuffle our features and turn into np.array
random.shuffle(training)
#random.shuffle(training)
training = np.array(training)
# create train and test lists. X - patterns, Y - intents
train_x = list(training[:,0])
Expand Down
Binary file modified words.pkl
Binary file not shown.

0 comments on commit a9e3e50

Please sign in to comment.