diff --git a/docs/source/en/how_to/absa.mdx b/docs/source/en/how_to/absa.mdx index 0bd38c95..684b3431 100644 --- a/docs/source/en/how_to/absa.mdx +++ b/docs/source/en/how_to/absa.mdx @@ -67,6 +67,8 @@ Two datasets that already match this format are these datasets of reviews from t * [tomaarsen/setfit-absa-semeval-laptops](https://huggingface.co/datasets/tomaarsen/setfit-absa-semeval-laptops) ```py +from dataset import load_dataset + # The training/eval dataset must have `text`, `span`, `label`, and `ordinal` columns dataset = load_dataset("tomaarsen/setfit-absa-semeval-restaurants", split="train") train_dataset = dataset.select(range(128)) @@ -82,6 +84,9 @@ If you wish, you can specify separate training arguments for the aspect model as ```py +from setfit import AbsaTrainer, TrainingArguments +from transformers import EarlyStoppingCallback + args = TrainingArguments( output_dir="models", num_epochs=5,