【发布时间】:2018-08-28 16:55:32
【问题描述】:
我正在使用 keras(后端 tensorflow)对来自亚马逊评论的情绪进行分类。
它从嵌入层(使用 GloVe)开始,然后是 LSTM 层,最后是 Dense 层作为输出。模型摘要如下:
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
embedding_1 (Embedding) (None, None, 100) 2258700
_________________________________________________________________
lstm_1 (LSTM) (None, 16) 7488
_________________________________________________________________
dense_1 (Dense) (None, 5) 85
=================================================================
Total params: 2,266,273
Trainable params: 2,266,273
Non-trainable params: 0
_________________________________________________________________
Train on 454728 samples, validate on 113683 samples
训练时 train 和 eval 准确率约为 74%,损失(train 和 eval)约为 0.6。
我尝试过改变 LSTM 层中的元素数量,包括 dropout、recurrent dropout、regularizer 和 GRU(而不是 LSTM)。然后准确率提高了一点(~76%)。
我还可以尝试什么来改善我的结果?
【问题讨论】:
标签: tensorflow keras text-classification