2-Using_Transformers-7-End-of-chapter_quiz
中英文对照学习,效果更佳!
原课程链接:https://huggingface.co/course/chapter2/8?fw=pt
End-of-chapter quiz
章末测验
问一个问题
- What is the order of the language modeling pipeline?
First, the model, which handles text and returns raw predictions. The tokenizer then makes sense of these predictions and converts them back to text when needed.
语言建模管道的顺序是什么?首先是模型,它处理文本并返回原始预测。然后,标记器理解这些预测,并在需要时将其转换回文本。
First, the tokenizer, which handles text and returns IDs. The model handles these IDs and outputs a prediction, which can be some text.
首先是记号赋予器,它处理文本并返回ID。该模型处理这些ID并输出预测,该预测可以是一些文本。
The tokenizer handles text and returns IDs. The model handles these IDs and outputs a prediction. The tokenizer can then be used once again to convert these predictions back to some text.
记号赋予器处理文本并返回ID。该模型处理这些ID并输出预测。然后,可以再次使用标记器将这些预测转换回一些文本。
- How many dimensions does the tensor output by the base Transformer model have, and what are they?
2: The sequence length and the batch size
基本Transformer模型的张量输出有多少维,它们是什么?2:序列长度和批量大小
2: The sequence length and the hidden size
2:序列长度和隐藏大小
3: The sequence length, the batch size, and the hidden size
3:序列长度、批次大小和隐藏大小
- Which of the following is an example of subword tokenization?
WordPiece
下面哪一个是子词标记化的例子?
Character-based tokenization
基于字符的标记化
Splitting on whitespace and punctuation
按空格和标点符号拆分
BPE
BPE
Unigram
单字
None of the above
以上都不是
- What is a model head?
A component of the base Transformer network that redirects tensors to their correct layers
什么是模型头部?基本Transformer网络的一个组件,它将张量重定向到其正确的层
Also known as the self-attention mechanism, it adapts the representation of a token according to the other tokens of the sequence
也称为自我注意机制,它根据序列的其他标记来调整标记的表示形式
An additional component, usually made up of one or a few layers, to convert the transformer predictions to a task-specific output
一个附加组件,通常由一个或几个层组成,用于将Transformer预测转换为特定于任务的输出
- What is an AutoModel?
A model that automatically trains on your data
什么是自动模型?根据您的数据自动训练的模型
An object that returns the correct architecture based on the checkpoint
基于检查点返回正确体系结构的对象
A model that automatically detects the language used for its inputs to load the correct weights
自动检测用于其输入以加载正确权重的语言的模型
- What are the techniques to be aware of when batching sequences of different lengths together?
Truncating
将不同长度的序列批处理在一起时需要注意的技术是什么?截断
Returning tensors
返回张量
Padding
填充物
Attention masking
注意掩饰
- What is the point of applying a SoftMax function to the logits output by a sequence classification model?
It softens the logits so that they’re more reliable.
对序列分类模型的逻辑输出应用SoftMax函数的意义是什么?它软化了逻辑,使它们更可靠。
It applies a lower and upper bound so that they’re understandable.
它应用了一个上下限,因此它们是可以理解的。
The total sum of the output is then 1, resulting in a possible probabilistic interpretation.
因此,输出的总和是1,从而产生可能的概率解释。
- What method is most of the tokenizer API centered around?
encode, as it can encode text into IDs and IDs into predictions
大多数标记器API都以什么方法为中心?encode,因为它可以将文本编码为ID,并将ID编码为预测
Calling the tokenizer object directly.
直接调用标记器对象。
pad
`pad`
tokenize
`标记化`
- What does the
resultvariable contain in this code sample?
1 | |
A list of strings, each string being a token
在此代码示例中,Result变量包含什么?字符串列表,每个字符串都是一个标记
A list of IDs
ID列表
A string containing all of the tokens
包含所有令牌的字符串
- Is there something wrong with the following code?
1 | |
No, it seems correct.
下面的代码有什么问题吗?没有,看起来是正确的。
The tokenizer and model should always be from the same checkpoint.
令牌器和型号应始终来自同一检查点。
It’s good practice to pad and truncate with the tokenizer as every input is a batch.
使用记号赋值器填充和截断是很好的做法,因为每个输入都是批处理。
