伯特斯卡斯_google ai嵌入的实验室语言不可知伯特句子

2024-03-13 13:20

本文主要是介绍伯特斯卡斯_google ai嵌入的实验室语言不可知伯特句子,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

伯特斯卡斯

Multilingual Embedding Models are the ones that map text from multiple languages to a shared vector space (or embedding space). This implies that in this embedding space, related or similar words will lie closer to each other, and unrelated words will be distant (refer to the figure above).

多语言嵌入模型是将多种语言的文本映射到共享向量空间(或嵌入空间)的模型。 这意味着在这个嵌入空间中, 相关或相似的词将彼此靠近 ,而无关的词将变得遥远 (请参见上图)。

In this article, we will discuss LaBSE: Language-Agnostic BERT Sentence Embedding, recently proposed in Feng et. al. which is the state of the art in Sentence Embedding.

在这篇文章中,我们将讨论LaBSE:L anguage- 诺斯 ERT 小号 entenceēmbedding,最近提出了Feng等。 等 这是Sentence Embedding中最先进的技术。

现有方法 (Existing Approaches)

The existing approaches mostly involve training the model on a large amount of parallel data. Models like LASER: Language-Agnostic SEntence Representations and m-USE: Multilingual Universal Sentence Encoder essentially map parallel sentences directly from one language to another to obtain the embeddings. They perform pretty well across a number of languages. However, they do not perform as good as dedicated bilingual modeling approaches such as Translation Ranking (which we are about to discuss). Moreover, due to limited training data (especially for low-resource languages) and limited model capacity, these models cease to support more languages.

现有的方法主要涉及在大量并行数据上训练模型。 模型,如LASER:L anguage- 诺斯SE ntenceř对产权和M-USE:M ultilingualùniversal 小号 entenceËncoder基本上平行映射句子直接从一种语言到另获得的嵌入。 它们在多种语言中的表现都很好。 但是,它们的性能不如专用的双语建模方法(例如, 翻译排名 (我们将要讨论))好。 此外,由于训练数据有限(特别是对于资源匮乏的语言)和模型能力有限,这些模型不再支持更多的语言

Recent advances in NLP suggest training a language model on a masked language modeling (MLM) or a similar pre-training objective and then fine-tuning it on downstream tasks. Models like XLM are extended on the MLM objective, but on a cross-lingual setting. These work great on the downstream tasks but produce poor sentence-level embeddings due to the lack of a sentence-level objective.

NLP的最新进展表明,在掩盖语言建模(MLM)或类似的预训练目标上训练语言模型,然后在下游任务上对其进行微调。 像XLM这样的模型是在MLM目标上扩展的,但是是在跨语言环境下进行的。 这些在下游任务上效果很好,但是由于缺少句子级目标而产生的句子级嵌入效果很差

Rather, the production of sentence embeddings from MLMs must be learned via fine-tuning, similar to other downstream tasks.

而是,必须通过微调来学习来自传销的句子嵌入的产生,这与其他下游任务类似。

— LaBSE Paper

— LaBSE纸

与语言无关的BERT句子嵌入 (Language-Agnostic BERT Sentence Embedding)

Image for post
LaBSE Paper LaBSE Paper具有附加裕度Softmax和共享参数的双向双编码器

The proposed architecture is based on a Bidirectional Dual-Encoder (Guo et. al.) with Additive Margin Softmax (Yang et al.) with improvements. In the next few sub-sections we will decode the model in-depth:

所提出的体系结构是基于双向双编码器 (Guo等人 )和具有改进的加性余量Softmax( Yang等人 )的 。 在接下来的几个小节中,我们将对模型进行深入解码:

翻译排名任务 (Translation Ranking Task)

Image for post
Google AI Blog Google AI博客进行翻译排名任务

First things first, Guo et. al. uses a translation ranking task which essentially ranks all the target sentences in order of their compatibility with the source. This is usually not ‘all’ the sentences but some ‘K - 1’ sentences. The objective is to maximize the compatibility between the source sentence and its real translation and minimize it with others (negative sampling).

首先, 郭等。 等 使用翻译排序任务,该任务从本质上排序所有目标句子与源句子的兼容性 。 这通常不是“全部”句子,而是一些“ K-1 ”句子。 目的是最大程度地提高源句子与其实际翻译之间的兼容性,使其与其他 句子 ( 负采样 ) 的兼容性 最小化

双向双编码器 (Bidirectional Dual Encoder)

Image for post
Dual-Encoder Architecture via Guo et. al.
通过 Guo等人的双编码器架构 。 等

The dual-encoder architecture essentially uses parallel encoders to encode two sequences and then obtain a compatibility score between both the encodings using a dot-product. The model in Guo et. al. was essentially trained on a parallel corpus for the translation ranking task which was discussed in the previous section.

双编码器体系结构本质上使用并行编码器对两个序列进行编码,然后使用点积获得两种编码之间的兼容性得分 。 郭等人的模型。 等 基本上在并行语料库上接受了翻译排名任务的培训,这已在上一节中进行了讨论。

As far as ‘bidirectional’ is concerned; it basically takes the compatibility scores in both the ‘directions’, i.e. from source to target as well as from target to source. For example, if the compatibility from source x to target y is denoted by ɸ(x_i, y_i), then the score ɸ(y_i, x_i) is also taken into account and the individual losses are summed.

就“双向”而言; 它基本上在两个“方向”上取得兼容性评分,即从源到目标以及从目标到源 。 例如,如果从源x到目标y的兼容性 ɸ(x_i,y_i)表示 然后得分ɸ(y_i,x_i) 还考虑了损失,并对各个损失进行了求和。

Loss = L + L′

损失= L + L'

附加保证金Softmax(AMS) (Additive Margin Softmax (AMS))

Image for post
Embedding Space with and without Additive Margin Softmax via Yang et al.
通过 Yang等人的方法,在具有和不具有附加余量Softmax的情况下嵌入空间 。

In vector spaces, classification boundaries can be pretty narrow, hence it can be difficult to separate the vectors. AMS suggests introducing a parameter m in the original softmax loss to increase the separability between the vectors.

在向量空间中,分类边界可能非常狭窄,因此可能难以分离向量 。 AMS建议引入参数m 原始softmax损失会增加向量之间的可分离性。

Image for post
LaBSE Paper LaBSE Paper进行 AMS

Notice how the parameter m is subtracted just from the positive sample and not the negative ones which is responsible for the classification boundary.

注意如何仅从正样本中减去参数m ,而不从负样本中减去负参数m ,这是分类边界的原因。

You can refer to this blog if you’re interested in getting a better understanding of AMS.

如果您有兴趣更好地了解AMS,可以参考此博客 。

跨加速器负采样 (Cross-Accelerator Negative Sampling)

Image for post
LaBSE Paper LaBSE纸进行交叉加速器负采样

The translation ranking task suggests using negative sampling for ‘K - 1’ other sentences that aren’t potentially compatible translations of the source sentence. This is usually done by taking sentences from the rest of the batch. This in-batch negative sampling is depicted in the above figure (left). However, LaBSE leverages BERT as its encoder network. For heavy networks like these, it is infeasible to have batch sizes that are large enough to provide sufficient negative samples for training. Thus, the proposed approach leverages distributed training methods to share batches across different accelerators (GPUs) and broadcasting them in the end. Here, all the shared batches are considered as negative samples, and just the sentences in the local batch are considered for positive sampling. This is depicted in the above figure (right).

翻译排名任务建议对“ K-1 ”其他与源句潜在不兼容的译文使用否定采样。 这通常是通过从其余部分中提取句子来完成的。 上图( )显示了批生产中的负采样。 但是,LaBSE利用BERT作为其编码器网络。 对于此类繁重的网络,批量大小足够大以提供足够的阴性样本进行训练是不可行的。 因此,提出的方法利用分布式训练方法在不同的加速器(GPU)之间共享批次并最终广播它们 。 在这里,所有共享批次都被视为否定样本,而仅将本地批次中的句子视为正样本。 上图( )对此进行了描述。

预训练和参数共享 (Pre-Training and Parameter Sharing)

Finally, as mentioned earlier, the proposed architecture uses BERT encoders and are pretrained on Masked Language Model (MLM) as in Devlin et. al. and Translation Language Model (TLM) objective as in XLM (Conneau and Lample). Moreover, these are trained using a 3-stage progressive stacking algorithm i.e. an L layered encoder is first trained for L / 4 layers, then L / 2 layers and then finally L layers.

最后,如前所述,所提出的体系结构使用BERT编码器,并且像Devlin等人在Masked Language Model(MLM)上进行了预训练。 人 。 和XLM(Conneau和Lample)中的翻译语言模型(TLM)目标。 此外,使用三阶段渐进式堆栈算法对这些层进行训练,即首先对L层编码器进行L / 4层,然后L / 2层,最后L层的训练。

For more on BERT pre-training, you can refer to my blog.

有关BERT预培训的更多信息,请参阅我的博客 。

放在一起 (Putting it All Together)

LaBSE,

LaBSE,

  1. combines all the existing approaches i.e. pre-training and fine-tuning strategies with bidirectional dual-encoder translation ranking model.

    结合了所有现有方法,即预训练和微调策略与双向双编码器翻译排名模型。
  2. is a massive model and supports 109 languages.

    是一个大型模型,支持109种语言。

结果 (Results)

Image for post
Tatoeba Datasets via Google AI博客获得的 Google AI Blog Tatoeba数据集的平均准确度(%)

LaBSE clearly outperforms its competitors with a state of the art average accuracy of 83.7% on all languages.

LaBSE在所有语言上的平均准确度均达到83.7%,明显优于竞争对手。

Image for post
Google AI Blog Google AI博客进行零位设置

LaBSE was also able to produce decent results on the languages for which training data was not available (zero-shot).

LaBSE还能够在没有培训数据的语言(零射)上产生不错的成绩。

Fun Fact: The model uses a 500k vocabulary size to support 109 languages and provides cross-lingual support for even zero-shot cases.

有趣的事实:该模型使用500k的词汇量来支持109种语言,甚至为零击案例提供了跨语言支持。

结论 (Conclusion)

We discussed the Language-Agnostic BERT Sentence Embedding model and how pre-training approaches can be incorporated to obtain the state of the art sentence embeddings.

我们讨论了语言不可知的BERT句子嵌入模型,以及如何结合预训练方法来获取最新的句子嵌入状态。

The model is open-sourced at TFHub here.

该模型在TFHub开源 。

翻译自: https://towardsdatascience.com/labse-language-agnostic-bert-sentence-embedding-by-google-ai-531f677d775f

伯特斯卡斯


http://www.taodudu.cc/news/show-8491223.html

相关文章:

  • 基于JavaWeb的企业公司管理系统设计与实现
  • Silicon Labs新推出EFR32BG22芯片性能强劲,详细对比nRF52832和CC2640R2F
  • Silicon Labs BG22、xG24、BG27无线SoC比较及信驰达无线模块选型指南
  • 华为企业业务2.0,以数字平台起跳
  • html5 企业网站模板 多语言,通用HTML5企业网站模板
  • 华为企业BG全球智慧城市业务部副总裁王盾:打造智慧城市神经系统
  • 四川公务员考试考“性生活满意度”引热议
  • 120941138报:V8 的 Java 封装 jav8
  • V8的Java 封装jav8
  • Java 8 – List分组GroupBy
  • 自媒体人有哪些好用的热点工具,可以快速蹭热点?
  • 做自媒体必备4大蹭热点工具
  • 自媒体文章阅读量低怎么办?学会蹭热点热搜,流量翻倍
  • 蹭热点的Alpha Zero感想
  • 把握新手期流量:巧妙蹭热点,让你的内容点赞10W+
  • 公众号自媒体怎么做,学会这几招,蹭热点超级快
  • 自媒体百万大号怎么蹭热点?4个小技巧,拿捏了~
  • 短视频人的硬伤,蹭热点大有讲究
  • 成都速领科技:抖音蹭热点技巧是啥
  • 3.8 如何在小红书上蹭热点,这里有8个方法【玩赚小红书】
  • 这些蹭热点的方法你一定要学会,教你打造爆款内容
  • 网络推广蹭热点需要掌握的几点套路
  • 小红书热点怎么蹭?10个技巧,手把手带你用好热点
  • 蹭热点破百万播放量,这些涨粉技巧千万不能错过!
  • 【宽创国际】馆讯:泰特现代美术馆于2018年超越大英博物馆成为伦敦最受欢迎的艺术机构
  • 用VR探索20世纪俄罗斯艺术家工作室(转载)
  • 英国最值得参观的十大博物馆介绍
  • .ART描绘现代创造力和特质
  • 布朗温莎汤(Brown Windsor Soup)布朗温莎汤的特点起源与争议现代的布朗温莎汤白兰地加苏打水这个搭配如何,并讲述这样搭配的由来白兰地的特点苏打水的特点白兰地加
  • 最佳学习网站收集
  • 这篇关于伯特斯卡斯_google ai嵌入的实验室语言不可知伯特句子的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



    http://www.chinasem.cn/article/805015

    相关文章

    Ilya-AI分享的他在OpenAI学习到的15个提示工程技巧

    Ilya(不是本人,claude AI)在社交媒体上分享了他在OpenAI学习到的15个Prompt撰写技巧。 以下是详细的内容: 提示精确化:在编写提示时,力求表达清晰准确。清楚地阐述任务需求和概念定义至关重要。例:不用"分析文本",而用"判断这段话的情感倾向:积极、消极还是中性"。 快速迭代:善于快速连续调整提示。熟练的提示工程师能够灵活地进行多轮优化。例:从"总结文章"到"用

    AI绘图怎么变现?想做点副业的小白必看!

    在科技飞速发展的今天,AI绘图作为一种新兴技术,不仅改变了艺术创作的方式,也为创作者提供了多种变现途径。本文将详细探讨几种常见的AI绘图变现方式,帮助创作者更好地利用这一技术实现经济收益。 更多实操教程和AI绘画工具,可以扫描下方,免费获取 定制服务:个性化的创意商机 个性化定制 AI绘图技术能够根据用户需求生成个性化的头像、壁纸、插画等作品。例如,姓氏头像在电商平台上非常受欢迎,

    从去中心化到智能化:Web3如何与AI共同塑造数字生态

    在数字时代的演进中,Web3和人工智能(AI)正成为塑造未来互联网的两大核心力量。Web3的去中心化理念与AI的智能化技术,正相互交织,共同推动数字生态的变革。本文将探讨Web3与AI的融合如何改变数字世界,并展望这一新兴组合如何重塑我们的在线体验。 Web3的去中心化愿景 Web3代表了互联网的第三代发展,它基于去中心化的区块链技术,旨在创建一个开放、透明且用户主导的数字生态。不同于传统

    AI一键生成 PPT

    AI一键生成 PPT 操作步骤 作为一名打工人,是不是经常需要制作各种PPT来分享我的生活和想法。但是,你们知道,有时候灵感来了,时间却不够用了!😩直到我发现了Kimi AI——一个能够自动生成PPT的神奇助手!🌟 什么是Kimi? 一款月之暗面科技有限公司开发的AI办公工具,帮助用户快速生成高质量的演示文稿。 无论你是职场人士、学生还是教师,Kimi都能够为你的办公文

    Andrej Karpathy最新采访:认知核心模型10亿参数就够了,AI会打破教育不公的僵局

    夕小瑶科技说 原创  作者 | 海野 AI圈子的红人,AI大神Andrej Karpathy,曾是OpenAI联合创始人之一,特斯拉AI总监。上一次的动态是官宣创办一家名为 Eureka Labs 的人工智能+教育公司 ,宣布将长期致力于AI原生教育。 近日,Andrej Karpathy接受了No Priors(投资博客)的采访,与硅谷知名投资人 Sara Guo 和 Elad G

    科研绘图系列:R语言扩展物种堆积图(Extended Stacked Barplot)

    介绍 R语言的扩展物种堆积图是一种数据可视化工具,它不仅展示了物种的堆积结果,还整合了不同样本分组之间的差异性分析结果。这种图形表示方法能够直观地比较不同物种在各个分组中的显著性差异,为研究者提供了一种有效的数据解读方式。 加载R包 knitr::opts_chunk$set(warning = F, message = F)library(tidyverse)library(phyl

    透彻!驯服大型语言模型(LLMs)的五种方法,及具体方法选择思路

    引言 随着时间的发展,大型语言模型不再停留在演示阶段而是逐步面向生产系统的应用,随着人们期望的不断增加,目标也发生了巨大的变化。在短短的几个月的时间里,人们对大模型的认识已经从对其zero-shot能力感到惊讶,转变为考虑改进模型质量、提高模型可用性。 「大语言模型(LLMs)其实就是利用高容量的模型架构(例如Transformer)对海量的、多种多样的数据分布进行建模得到,它包含了大量的先验

    AI hospital 论文Idea

    一、Benchmarking Large Language Models on Communicative Medical Coaching: A Dataset and a Novel System论文地址含代码 大多数现有模型和工具主要迎合以患者为中心的服务。这项工作深入探讨了LLMs在提高医疗专业人员的沟通能力。目标是构建一个模拟实践环境,人类医生(即医学学习者)可以在其中与患者代理进行医学

    【生成模型系列(初级)】嵌入(Embedding)方程——自然语言处理的数学灵魂【通俗理解】

    【通俗理解】嵌入(Embedding)方程——自然语言处理的数学灵魂 关键词提炼 #嵌入方程 #自然语言处理 #词向量 #机器学习 #神经网络 #向量空间模型 #Siri #Google翻译 #AlexNet 第一节:嵌入方程的类比与核心概念【尽可能通俗】 嵌入方程可以被看作是自然语言处理中的“翻译机”,它将文本中的单词或短语转换成计算机能够理解的数学形式,即向量。 正如翻译机将一种语言

    AI行业应用(不定期更新)

    ChatPDF 可以让你上传一个 PDF 文件,然后针对这个 PDF 进行小结和提问。你可以把各种各样你要研究的分析报告交给它,快速获取到想要知道的信息。https://www.chatpdf.com/