This is an implementation of the Sentiment Analysis model as described in the this paper. The implementation is with the reference to paddle version.
The model makes use of concatenation of two CNN layers with different kernel sizes. Batch normalization and dropout layers are used to prevent over-fitting.
The keras's IMDB Movie reviews sentiment classification dataset is used. The dataset file download is handled by keras module, and the downloaded files are stored at ``~/.keras/datasets` directory. The compressed file's filesize as of June 15 2018 is 17MB.
To train and evaluate the model, issue the following command:
python sentiment_main.py
Arguments:
--dataset
: The dataset name to be downloaded and preprocessed. By default, it isimdb
.
There are other arguments about models and training process. Use the --help
or -h
flag to get a full list of possible arguments with detailed descriptions.
The model was recorded to have the accuracy of 90.1% for the IMDB dataset.