Skip to content

Problem with the torchtext library text classification example #1993

Closed
@EssamWisam

Description

@EssamWisam

The first section of the tutorial suggests
import torch from torchtext.datasets import AG_NEWS train_iter = iter(AG_NEWS(split='train'))

which does not work yielding
TypeError: _setup_datasets() got an unexpected keyword argument 'split'

I might highlight as well that the string doc for AG_NEWS mentions
train_dataset, test_dataset = torchtext.datasets.AG_NEWS(ngrams=3)

cc @pytorch/team-text-core @Nayef211

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions