USE LARGER DICTIONARIES FOR WORD PROCESSING TO CAPTURE MORE TEXT

Before the accuracy of our model predictions is 0.81. I hope to further improve the accuracy of the prediction, the method is as follows: Word count of the dictionary: Originally 1000 word dictionary, added to build 3800 dictionary of words. ”Number list” of the length of truncation: The original “digital list” length is 100 number, now changed to 380 numbers. This approach is like training deep learning model to recognize some words, and increase the number of words read in movie reviews by improve the accuracy.

Then, we can just change some code–data preprocessing from Multi Layer Perceptron. We can establish 3800 dictionary of words, change the “Number list” length is 380. Input dimension changed to 3800. Change some code of pad_sequences. Revise predict_review function. After that, perform the prediction and evaluate model accuracy.

FULL CODE OF LARGER DICTIONARIES FOR WORD PROCESSING TO CAPTURE MORE TEXT

After learning the steps, now we can implement the code (just copy from Multi Layer Perceptron) below: