Browser-Sentiment-Classification
Browser-Sentiment-Classification copied to clipboard
Sentiment Classification in the browser using TensorFlow.js
Browser-Sentiment-Classification
Project Description
-
NLP Sentiment Analysis.ipynb creates the model and trains it on the texts from the
sentiment.txtfile. 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.h5file. -
After that you convert the trained keras model into a
model.jsonfile in order to load it in the browser. The conversion is done using the command
tensorflowjs_converter --input_format keras keras.h5 output/
-
The
outputfoulder will then contain onemodel.jsonfile and 5group*files which contains the saved weights of the model. These weights are referenced using variables from the json file -
The
testRNN.htmlfile loads the json file and creates the trained model. Then use it to predict texts.