Hello,
I’m new to torchtext and doing some tutorials with datasets. When I import the AG_NEWS dataset using the following:
import torchtext
train_set, test_set = torchtext.datasets.AG_NEWS(root='./data')
list(train_set)[0]
I get a tuple of an int and tensor:
(2,
tensor([ 432, 426, 2, 1606, 14839, 114, 67, 3, 849, 14,
28, 15, 28, 16, 50726, 4, 432, 375, 17, 10,
67508, 7, 52259, 4, 43, 4010, 784, 326, 2]))
I’m supposed to get a tuple of (int, str), so I’m not sure what am I doing wrong here? or if there is a more proper method to import datasets?
Appreciate any help