相似度_基于Bert_2019:Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks

Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks

论文核心

对预训练的BERT网络进行修改,使用连体和三连体网络结构,得出有语义的句子嵌入,可以使用余弦相似度进行比较。

a modification of the pretrained BERT network that use siamese and triplet network structures to derive semantically meaningful sentence embeddings that can be compared using cosine-similarity

模型结构

在解决分类任务时,模型是左边的结构,在计算相似度分值时,模型结构是右边的。
SBERT在BERT/RoBERTa的输出上增加了一个池化操作,以得出一个固定大小的句子嵌入。我们试验了三种池化策略。使用CLS-token的输出,计算所有输出向量的平均值(MEANstrategy),以及计算输出向量的最大超时(MAX-strategy)。
相似度_基于Bert_2019:Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks_第1张图片

三种任务

1分类任务——损失函数:cross_entropy

2 回归任务——损失函数:mean-square loss

3 三元目标函数

给定一个锚点句子a,一个正面句子p,和一个负面句子n,三联失调网络,使a和p之间的距离小于a和n之间的距离。最小化下列函数:在这里插入图片描述

训练之Ablation study

评价指标:使用余弦相似度和Spearman等级相关度。
比较了不同的池化策略和concatenation策略

相似度_基于Bert_2019:Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks_第2张图片

你可能感兴趣的:(相似度,论文记录,bert,深度学习,机器学习)