一、项目简介
项目
Recurrent Neural Networks with Word Embeddings
教程地址:http://deeplearning.net/tutorial/rnnslu.html
Task
The Slot-Filling (Spoken Language Understanding)给句子中每个word分配标签,是一个分类问题。
Dataset
数据集是DARPA的一个小型数据集:ATIS (Airline Travel Information System),使用Inside Outside Beginning (IOB)表示
数据集中训练集句子4978个,word 56590个;测试集句子893,word 9198个;平均句长 15;The number of classes (different slots) is 128 including the O label (NULL).
注:B- prefix 实体的开始, I- prefix 实体内部,O tag 不属于任何实体
评价指标
Precision,Recall,F1 score
教程中使用conlleval PERL script(是一个计算上述指标的脚本代码)来评价性能
二、RNN简介
词向量
这里使用的词向量是context window word embeddings,即定义一个窗口大小,把句子中的每个word及其前后的word index提取出来,再把 index 转换成 embeddings作为对应每个 word 的实数向量。
不同于传统的FNNs(Feed-forward Neural Networks,前向反馈神经网络),RNNs引入了定向循环,能够处理那些输入之间前后关联的问题。教程中使用的是(Elman) recurrent neural network (E-RNN),把当前时刻(t)的输入以及前一时刻( t-1)的隐藏层状态作为输入。
参数
E-RNN中需要学习的参数如下:
the word embeddings(词向量表)
the initial hidden state (real-value vector)(初始化隐含层状态)
two matrices for the linear projection of the input t and the previous hidden layer state t-1(线性投影层和前一状态隐含层状态)
(optional) bias. (偏置项,此处不用)
softmax classification layer on top(softmax分类)
超参数如下:
dimension of the word embedding(de,50)(词向量维度)
size of the vocabulary(词表长度