Error in TorchText -TEXT.build_vocab

I am getting below error while implementing Text classification in Torchtext:

AttributeError Traceback (most recent call last)
in ()
----> 1 TEXT.build_vocab(train,max_size=40000)

~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torchtext/data/ in build_vocab(self, *args, **kwargs)
236 sources.append(arg)
237 for data in sources:
–> 238 for x in data:
239 if not self.sequential:
240 x = [x]

~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torchtext/data/ in getattr(self, attr)
91 if attr in self.fields:
92 for x in self.examples:
—> 93 yield getattr(x, attr)
95 @classmethod

AttributeError: ‘Example’ object has no attribute ‘Url_text’

My Code -
TEXT = data.Field(sequential=True, tokenize=tokenizer, lower=True)
LABEL = data.Field(sequential=False, use_vocab=False,postprocessing= lambda x: float(x))

train, val= data.TabularDataset.splits(
path=PATH, train=‘train_new.csv’,
validation=‘val.csv’, format=‘csv’,
fields=[(‘Webpage_id’,None),(‘Tag’, LABEL),(‘Url_text’, TEXT)],skip_header=True)

dict_keys([‘Tag’, ‘Url_text’])


Any help on above is appreciated.

All samples have the Url_text attribute defined? Maybe you can use the debugger or add a print(x) inside the loop at line 92 to find out what’s going on with the x.