MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

Reinforcement Learning from Human Feedback (RLHF)

Lihat Kursus

Petunjuk latihan

  • 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.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# 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=____
)
Edit dan Jalankan Kode