Relatively simple AI-based chatbot that simulates human conversation through text chats.
Most common use case for this type of chatbot is answering frequently asked questions. Also it can be used for fun.
Neural network model is fairly standard feed-forward neural network model with 2 hidden layers per 4 neurons.
-
Inputs to the network are one hot encoded values of "bag of words" - bag of words because the order in
which the words appear in the sentence is lost, we only know the presence of words in the models vocabulary.
Each sentence is represented with a list the length of the amount of words in models vocabulary.
Each position in the list will represent a word from the vocabulary.
If the position in the list is a 1 then that will mean that the word exists in input sentence, if it is a 0 then the word does not exist. -
Similarly to a bag of words, on output of neural network are lists which are the length of the amount
of labels in dataset.
Each position in the list will represent one distinct label, a 1 in any of those positions
will show which label is represented.
Labels: greeting, goodbye, basic, thanks, meme
You can use pip to install the following:
1. python 3
2. tensorflow
3. numpy
4. nltk
chatbot is released under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0