On pre-existing dataset, I can do:
from torchtext import datasets
from torchtext import data
TEXT = data.Field(tokenize = 'spacy')
LABEL = data.LabelField(dtype = torch.float)
train_data, test_data = datasets.IMDB.splits(TEXT, LABEL)

But in case I define a custom dataset, it doesn’t seem possible.
In: type(dataset)
Out: dataset.CustomDataset

train_data, test_data = dataset.splits(TEXT, LABEL)

AttributeError: ’ CustomDataset’ object has no attribute ‘splits’
What is the usual workflow? If check the type of datasets.IMDB it gives, which is confusing.
In: type(datasets.IMDB)
Out: type