Coders Packet

Intelligent Chatbot for CodeSpeedy Website Trained using ML dataset and Neural Network

By Syeed Chowdhury Jahin

Nora is an AI Chatbot trained to answer questions about services, products and basic questions whilst users browsing experience through CodeSpeedy Website.

Intents.json file contains the user inputs as patterns and chatbot output as responses grouped under categorized tags creatng a dataset file.In trainingnora.py the words are tokenized by the natural language processing library nltk and then lemmatized to their stem avoiding duplicates and unnecessary symbols.Neural network cannot work on words, so words were appended into numerical values 0 and 1. After that,

model=Sequential()
model.add(Dense(130,input_shape=(len(train_x[0]),),activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(64,activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(len(train_y[0]),activation='softmax'))
sgd=SGD(lr=0.01,decay=1e-6,momentum=0.9,nesterov=True)
model.compile(loss='categorical_crossentropy',optimizer=sgd,metrics=['accuracy'])
variable=model.fit(np.array(train_x),np.array(train_y),epochs=200,batch_size=5,verbose=1)
model.save('Noramodel.h5',variable)
print("Done")
The code was used to feed the data tothe netwok built and after compilation of the file,the network was trained and ready.
The actual chatbot code is in norabot.py where get_response(intents_list,intents_json) function generates the response on Nora the chatbot.

Download project

Reviews Report

Submitted by Syeed Chowdhury Jahin (Syeed)

Download packets of source code on Coders Packet