-
NLP Sentiment Analysis.ipynb creates the model and trains it on the texts from the
sentiment.txt
file. In order to make things easier for the browser app we cache the dictionary which maps the words to indices insidedict.csv
. The trained model is then saved intokeras.h5
file. -
After that you convert the trained keras model into a
model.json
file in order to load it in the browser. The conversion is done using the command
tensorflowjs_converter --input_format keras keras.h5 output/
-
The
output
foulder will then contain onemodel.json
file and 5group*
files which contains the saved weights of the model. These weights are referenced using variables from the json file -
The
testRNN.html
file loads the json file and creates the trained model. Then use it to predict texts.