Research On Text Classification Based On CNN and LSTM: Yuandong Luan Shaofu Lin
Research On Text Classification Based On CNN and LSTM: Yuandong Luan Shaofu Lin
Research On Text Classification Based On CNN and LSTM: Yuandong Luan Shaofu Lin
353
TABLE I. CONFUSION MATRIX
Negative Pre Positive Pre
Negative Act TN FP
Positive Act FN TP
IV. EXPERIMENT TP
𝐹𝐹1 = × 100%#(11)
A. Data Set FN + FP
TP +
2
The experimental data in this paper are derived from the
subjective and objective text data used in [1]. The data set D. Experimental comparison
version number is subjectivity dataset v1.0, which includes
In this paper, a single CNN and LSTM model is used as
5000 subjective text and 5000 objective text data.
the contrast model, and produce four kinds of subjective and
B. Experimental settings objective text data classification models by combining CNN
In this experiment, for the convolutional network layer, and LSTM and their variants. They are standard CNN
we use the word embedding dimension of 256, the size of the combined with standard LSTM called CNN-LSTM model,
filter is 3,4,5, the number of filters is 128, the sliding step is non-activation function CNN combined with standard LSTM
1, and the valid padding method is used. For LSTM layer, we called NA-CNN-LSTM model, standard CNN combined
use two-tier stacked LSTM and set the number of hidden with variant LSTM called CNN-COIF-LSTM model, and
units to 128. non-activation function CNN combined with variant LSTM
called NA-CNN-COIF-LSTM model.
C. Evaluating indicator
V. RESULTS ANALYSIS
In order to evaluate the performance of our model, we
use the precision, recall and f1-score as the evaluation In this paper, the above model is used to experiment on
criteria of this experiment. To illustrate the meanings of a given data set. The final experimental results are shown in
these indicators, confusion matrix is introduced first [12], Table II. comparison result
shown in TableⅠ. Model Precision Recall F1 score
CNN 98.9353% 98.5197% 98.7270%
354
LSTM 98.9816% 99.1598% 99.0706% combination of CNN without activation function and LSTM
CNN-LSTM 99.4769% 98.9197% 99.1975% or its variant has better performance. Ref. [9] proposed eight
NA-CNN-LSTM 99.2201% 99.2598% 99.2400% variant models of LSTM. The next step of this paper is to
CNN-COIF-LSTM 98.9816% 99.1598% 99.0706%
NA-CNN-COIF-LSTM 99.1415 99.3398% 99.2406%
explore the performance of the combination of CNN and
other variants of LSTM.
From the above results, we can draw some interesting
findings. REFERENCES
[1] Bo Pang, Lillian Lee. A Sentimental Education: Sentiment Analysis
In terms of precision, CNN-LSTM performs best, Using Subjectivity Summarization Based on Minimum Cuts.
followed by NA-CNN-LSTM. As far as recall is concerned, Proceedings of the ACL, 2004.
NA-CNN-COIF-LSTM performs best, followed by NA- [2] Lecun, Y. L. , et al. "Gradient-Based Learning Applied to Document
CNN-LSTM. Generally speaking, NA-CNN-LSTM and NA- Recognition." Proceedings of the IEEE 86.11(1998):2278-2324.
CNN-COIF-LSTM are the best performers in terms of F1 [3] Hochreiter, Sepp , and Schmidhuber, Jürgen. "Long Short-Term
score. This is in line with our expectation that CNN without Memory." Neural Computation 9.8(1997):1735-1780.
activation function combined with LSTM or its variant will [4] Minar, Matiur Rahman , and J. Naher . "Recent Advances in Deep
have better performance, which proves the validity of the Learning: An Overview." (2018).
model in this paper. [5] Otter, Daniel W. , J. R. Medina , and J. K. Kalita . "A Survey of the
Usages of Deep Learning in Natural Language Processing." (2018).
The model performance of CNN combined with LSTM [6] Kim, Yoon . "Convolutional Neural Networks for Sentence
variants is not necessarily improved, such as the performance Classification." Eprint Arxiv (2014).
of CNN-COIF-LSTM is the same as that of LSTM. However, [7] Liu, Pengfei , X. Qiu , and X. Huang . "Recurrent Neural Network for
the performance of CNN without activation combined with Text Classification with Multi-Task Learning." (2016).
LSTM variants is obviously improved, which proves the [8] Zhou, Chunting , et al. "A C-LSTM Neural Network for Text
validity of this model again. Classification." Computer Science (2015).
[9] Greff, Klaus , et al. "LSTM: A Search Space Odyssey." IEEE
VI. CONCLUSION Transactions on Neural Networks & Learning Systems
28.10(2015):2222-2232.
Unlike the typical CNN, which contains convolution [10] Ye Zhang, Byron C. Wallace. A Sensitivity Analysis of (and
operation and activation function, this paper constructs two Practitioners’ Guide to) Convolutional Neural Networks for Sentence
text classification models called NA-CNN-LSTM and NA- Classification.(2016).
CNN-COIF-LSTM by combining CNN without activation [11] Yan Fang. An Analysis of the Internal Structure of Words.(2014).
function and LSTM, and one of its variants COIF-LSTM. [12] Ting, Kai Ming . "Confusion Matrix." (2011).
Through comparative experiments, it is proved that the
355