CommencerCommencer gratuitement

Fine-tuning for review classification

Your project continues and you now want to classify the reviews as positive, neutral, or negative. You'll use a fine-tuned model to automatically categorize the reviews.

The TrainingArguments and Trainer classes have been imported from transformers. The training_args, model, and tokenized_datasets have also been pre-imported.

Cet exercice fait partie du cours

Reinforcement Learning from Human Feedback (RLHF)

Afficher le cours

Instructions

  • Create the train and test datasets using "train" and "test" subsets from the tokenized_datasets dataset.
  • Initialize the trainer class.
  • Add training arguments to the class.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Define the train and test datasets
training_dataset = ____
testing_dataset = ____

# Initialize the trainer class
trainer = ____(
# Add arguments to the class
    model=model,
    args=training_args,
    train_dataset=____,
    eval_dataset=____
)
Modifier et exécuter le code