简单介绍RNN更通用的一个递归结构Recursive Structure,在Sentiment Analysis 情感分析上应用。
pdf 视频
Recurrent Structure and Recursive Structure
Sentiment Analysis 情感分析
上面
f
f
f都是同一个Function(hidden layer参数一样),循环网络可以看成是递归网络的特例。
Recursive Model
f函数需要设计成这样:
即输入2个词需要相乘,但是
x
T
W
x
x^TWx
xTWx得到是一个scalar,所以进行vector size次:
∑
i
=
0
V
s
i
z
e
x
T
W
i
x
\sum_{i=0}^{Vsize}x^TW_ix
∑i=0VsizexTWix,再加上串联相乘:
W
x
Wx
Wx。
demo:
http://nlp.stanford.edu:8080/sentiment/rntnDemo.html
另一种更复杂的f函数:
Matrix-Vector Recursive Network
词对应的vector可以拆分成包含自身信息的vector和包含影响其他词关系的matrix。
Tree LSTM
More Applications
处理可以做Sentiment Analysis ,也可以做Sentence relatedness
NN输出的类别换成:相关、不相关、、、
以上参考李宏毅老师视频和ppt,仅作为学习笔记交流使用