I’m trying to work on agnews library, but my code doesn’t seem to work. What I’ve got so far is the following:
import torch import torchtext from torchtext import datasets agnews_train, agnews_test = torchtext.datasets.AG_NEWS(root='./datasets', split=('train', 'test'))
Running the code returns:
opt/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/utils/data/dataset.py", line 34, in __getitem__ raise NotImplementedError NotImplementedError
I thought that might be not importing the datasets from torchtext, but it still raises the error. Any ideas?
Thanks in advance!