No codigo:
TEXT = data.Field(tokenize = 'spacy', include_lengths = True)
LABEL = data.LabelField(dtype = torch.long)
train_data, test_data = datasets.IMDB.splits(TEXT, LABEL)
train_data, valid_data = train_data.split(random_state = random.seed(SEED))
o erro é:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Input In [17], in <cell line: 1>()
----> 1 TEXT = data.Field(tokenize = 'spacy', include_lengths = True)
2 LABEL = data.LabelField(dtype = torch.long)
4 train_data, test_data = datasets.IMDB.splits(TEXT, LABEL)
AttributeError: module 'torchtext.data' has no attribute 'Field'
Já tentei usar as versões inferiores do TorchText 0.81 e superior, sempre o mesmo erro.