Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/source/transformers_integrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
To run the 🤗 Transformers examples make sure you have installed the following libraries:

```bash
pip install datasets transformers torch evaluate nltk rouge_score
pip install datasets transformers torch accelerate evaluate nltk rouge_score scikit-learn
```

## Trainer

The metrics in `evaluate` can be easily integrated with the [`~transformers.Trainer`]. The `Trainer` accepts a `compute_metrics` keyword argument that passes a function to compute metrics. One can specify the evaluation interval with `eval_strategy` in the [`~transformers.TrainerArguments`], and based on that, the model is evaluated accordingly, and the predictions and labels passed to `compute_metrics`.
The metrics in `evaluate` can be easily integrated with the [`~transformers.Trainer`]. The `Trainer` accepts a `compute_metrics` keyword argument that passes a function to compute metrics. One can specify the evaluation interval with `eval_strategy` in the [`~transformers.TrainingArguments`], and based on that, the model is evaluated accordingly, and the predictions and labels passed to `compute_metrics`.

```python
from datasets import load_dataset
Expand Down Expand Up @@ -121,7 +121,7 @@ trainer = Seq2SeqTrainer(
args=training_args,
train_dataset=tokenized_billsum["train"],
eval_dataset=tokenized_billsum["test"],
tokenizer=tokenizer,
processing_class=tokenizer,
data_collator=data_collator,
compute_metrics=compute_metrics
)
Expand Down