I am not sure I understand how the Trainer class identifies the target from the features.  In the given example in the documentation, Trainer is passed “train_dataset” with no X and Y specified. Is this already assigned somewhere on the dataset object?
from transformers import BartForSequenceClassification, Trainer, TrainingArguments
model = BartForSequenceClassification.from_pretrained(“facebook/bart-large-cnn”)
training_args = TrainingArguments(
output_dir=’./results’,          # output directory
num_train_epochs=3,              # total # of training epochs
per_device_train_batch_size=2,  # batch size per device during training
per_device_eval_batch_size=2,   # batch size for evaluation
warmup_steps=100,                # number of warmup steps for learning rate scheduler
weight_decay=0.01,               # strength of weight decay
logging_dir=’./logs’,            # directory for storing logs)
trainer = Trainer(
model=model,                         # the instantiated  Transformers model to be trained
args=training_args,                  # training arguments, defined above
train_dataset=train_df,         # training dataset**
**    eval_dataset=eval_df)**