什么是上下文嵌入?

机器算法验证 神经网络 深度学习 自然语言 word2vec 词嵌入
2022-03-26 00:34:26

我了解词嵌入和 word2vec。

本文:https ://arxiv.org/pdf/1603.01547.pdf

他们说的是一种新型的词嵌入。

Our model uses one word embedding function
and two encoder functions. The word embedding
function e translates words into vector representations.
The first encoder function is a document
encoder f that encodes *every word from the document*
d *in the context of the whole document*.
We call this the **contextual embedding**.

这是一些新的编码方式,我该如何实现?谢谢 。

1个回答

一个词的上下文嵌入就是一个 bi-GRU 对应的隐藏状态:

在我们的模型中,文档编码器实现为双向门控循环单元 (GRU) 网络,其隐藏状态形成上下文词嵌入,即 , 其中表示向量连接,表示来自各自循环网络的前向和后向上下文嵌入。ffi(d)=fi(d)||fi(d)||fifi

红色是第一个词的上下文嵌入:

在此处输入图像描述