句向量

本文介绍了几种常见的句向量生成方法,包括通过词向量的简单平均、TF-IDF加权平均、SIF加权平均等传统方法,以及利用RNN/LSTM、BERT和skip-thought vectors等深度学习模型直接生成句向量的技术。
  1. 词向量得到句向量

1)bag of words求平均
2)TF-IDF加权平均
3)SIF加权平均
在这里插入图片描述
That is, the MLE is approximately a weighted average of the vectors of the words in the sentence.Note that for more frequent words w, the weight a/(p(w) + a) is smaller, so this naturally leads to a down weighting of the frequent words.
在这里插入图片描述

在这里插入图片描述
To estimate cs, we estimate the direction c0 by computing the first principal component of c˜s’s for a set of sentences. In other words, the final sentence embedding is obtained by subtracting the projection of c˜s’s to their first principal component.
在这里插入图片描述

在这里插入图片描述

  1. 直接得到句向量

1)Encoder:RNN/LSTM得到序列末尾的hidden vector;若双层,则concat得到的两个hidden vector
RNNs using long short-term memory (LSTM) capture long-distance dependency and have also been used for modeling sentences (Tai et al., 2015)。
2)BERT:[CLS]对应位置的输出即为句向量
3)skip-thought vectors:Skip-thought of (Kiros et al., 2015) tries to reconstruct the surrounding sentences from surrounded one and treats the hidden parameters as their vector representations.

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值