Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Yelp-Review

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.
What is the main purpose of the `Vocabulary` class in the Yelp review classifier?
a)
To manage token-to-index mappings
b)
To vectorize the input reviews
c)
To assign sentiment labels
d)
To clean raw review data
2.
Which special token allows the model to handle unknown words during inference?
a)
<UNK>
b)
<EOS>
c)
<PAD>
d)
<START>
3.
What is the function of the `vectorize()` method in the `ReviewVectorizer` class?
a)
To tokenize reviews
b)
To map reviews into collapsed one-hot vectors
c)
To encode labels
d)
To shuffle dataset samples
4.
What is the role of PyTorchโ€™s `DataLoader`?
a)
To transform tensors into strings
b)
To create data splits
c)
To clean the dataset
d)
To create and manage minibatches
5.
Which PyTorch class must be subclassed to define a custom dataset?
a)
ReviewDataset
b)
DataFrame
c)
TensorDataset
d)
Dataset
6.
Which two methods must be implemented when subclassing `Dataset`?
a)
__init__ and __call__
b)
__getitem__ and __len__
c)
__str__ and __repr__
d)
__main__ and __load__
7.
What is the purpose of the `ReviewClassifier` class?
a)
To predict star ratings
b)
To tokenize reviews
c)
To define a perceptron-based classifier
d)
To clean the input reviews
8.
What does the `forward()` method in `ReviewClassifier` return?
a)
An index of the token
b)
A string output
c)
A tensor with raw or sigmoid-activated values
d)
A list of tokens
9.
What does the `predict_rating()` function do?
a)
It makes a prediction from raw text input
b)
It computes validation loss
c)
It trains the model
d)
It shuffles the test set
10.
What does `loss.backward()` do during training?
a)
Updates model weights
b)
Computes gradients
c)
Evaluates on test set
d)
Saves model state
11.
Why is `.eval()` called on the model during validation or testing?
a)
To freeze weights and disable dropout
b)
To reload the data
c)
To compute gradients
d)
To clear the cache
12.
What is the function of the `generate_batches()` wrapper?
a)
To vectorize data
b)
To serialize the vocabulary
c)
To move batches to correct device
d)
To sample test data