1-Transformer_models-4-Encoder_models
中英文对照学习,效果更佳!
原课程链接:https://huggingface.co/course/chapter1/5?fw=pt
Encoder models
编码器型号
问一个问题
Encoder models use only the encoder of a Transformer model. At each stage, the attention layers can access all the words in the initial sentence. These models are often characterized as having “bi-directional” attention, and are often called auto-encoding models.
编码器模型仅使用Transformer模型的编码器。在每个阶段,注意力层可以访问初始句子中的所有单词。这些模型通常被描述为具有“双向”注意,并且通常被称为自动编码模型。
The pretraining of these models usually revolves around somehow corrupting a given sentence (for instance, by masking random words in it) and tasking the model with finding or reconstructing the initial sentence.
这些模型的预训练通常围绕着以某种方式破坏给定的句子(例如,通过掩盖其中的随机单词),并让模型寻找或重建初始句子。
Encoder models are best suited for tasks requiring an understanding of the full sentence, such as sentence classification, named entity recognition (and more generally word classification), and extractive question answering.
编码器模型最适合于需要理解完整句子的任务,例如句子分类、命名实体识别(以及更一般的词分类)和提取问题回答。
Representatives of this family of models include:
这一系列模型的代表包括:
