admin管理员组文章数量:1534209
一、原理
skip-thought模型结构借助了skip-gram的思想。在skip-gram中,是以中心词来预测上下文的词;在skip-thought同样是利用中心句子来预测上下文的句子,其数据的结构可以用一个三元组表示 (st−1,st,st+1) ,输入值 st,输出值 (st−1,st+1),具体模型结构如下图:
二、实践
使用预训练好的Skip-Thought提取文本特征
1)Dependencies
我的电脑环境是Ubuntu 16.04,python2.7,需要在Theano 0.7运行
打开终端
pip install theano
2) Git 作者github上代码
https://github/ryankiros/skip-thoughts
3)下载预训练好的模型及word embedding文件(>5G),并放在skip-thoughts文件下
wget http://www.cs.toronto.edu/~rkiros/models/dictionary.txt
wget http://www.cs.toronto.edu/~rkiros/models/utable.npy
wget http://www.cs.toronto.edu/~rkiros/models/btable.npy
wget http://www.cs
版权声明:本文标题:Skip-Thought词向量模型实现Sent2Vec 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1726876263a1088385.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论