Quiz Capitulo3
Quiz Capitulo3
Ask a Question
1. The emotion dataset contains Twitter messages labeled with emotions. Search for it in the
Hub, and read the dataset card. Which of these is not one of its basic emotions?
Joy
Love
Confusion: Correct! Correct! Confusion is not one of the six basic emotions.
Surprise
2. Search for the ar_sarcasm dataset in the Hub. Which task does it support?
Sentiment classification: Correct! That's right! You can tell thanks to the tags.
Machine translation
Question answering
The results of the function are cached, so it won't take any time if we re-execute the code.
Correct! That is indeed one of the neat benefits of this method! It's not the only one, though...
It can apply multiprocessing to go faster than applying the function on each element of the
dataset.
Correct! This is a neat feature of this method, but it's not the only one!
It does not load the whole dataset into memory, saving the results as soon as one element is
processed.
Correct! That's one advantage of this method. There are others, though!
5. What does dynamic padding mean?
It's when you pad the inputs for each batch to the maximum length in the whole dataset.
It's when you pad your inputs when the batch is created, to the maximum length of the
sentences inside that batch.
Correct! That's correct! The "dynamic" part comes from the fact that the size of each batch is
determined at the time of creation, and all your batches might have different shapes as a result.
It's when you pad your inputs so that each sentence has the same number of tokens as the
previous one in the dataset.
It ensures all the sequences in the dataset have the same length.
Correct! Correct! You can pass the collate function as an argument of a DataLoader. We used the
DataCollatorWithPadding function, which pads all items in a batch so they have the same length.
7. What happens when you instantiate one of the AutoModelForXxx classes with a pretrained
language model (such as bert-base-uncased ) that corresponds to a different task than the one
for which it was trained?
The head of the pretrained model is discarded and a new head suitable for the task is inserted
instead.
Nothing, since the model can still be fine-tuned for the different task.
It contains all the hyperparameters used for training and evaluation with the Trainer.
Correct! Correct!
Correct! Correct! With Accelerate, your training loops will work for multiple GPUs and TPUs.