Pytorch datasets.UDPOS.splits throwing error
I want to split the UDPOS dataset into train, valid, and test by fields. Below is my code-
import torch
import torch.nn as nn
import torch.optim as optim

from torchtext.legacy import data
from torchtext import datasets

SEED = 1234

random.seed(SEED)
np.random.seed(SEED)
torch.manual_seed(SEED)
torch.backends.cudnn.deterministic = True

TEXT = data.Field(lower = True)
UD_TAGS = data.Field(unk_token = None)
PTB_TAGS = data.Field(unk_token = None)

fields = ((&quot;text&quot;, TEXT), (&quot;udtags&quot;, UD_TAGS), (&quot;ptbtags&quot;, PTB_TAGS))

train_data, valid_data, test_data = datasets.UDPOS.splits(fields)

This code give me following error-

I am using Pytorch version - '1.10.2'.
How do I split the UDPOS dataset using fileds in the current version.

I solved the same problem by changing the code
from torchtext import datasets


to
from torchtext.legacy import datasets


