Theano(2) RNN训练词向量

一、项目简介

项目
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(词表长度

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值