Greetings,
This is my first time using torchtext
and I found it really intuitive. So I was trying to implement a basic classifier using the same.
Certainly there are a lot of methods of importing data from a static file outside into the torchtext.data.TabularDataset
but I found none to directly load lists of texts and labels into the functionality.
Here’s my sample:
tweets
:containing a list of tweets
labels
: denoting their respective sentiment
Till not I’ve defined data.Fields
as:
tweetField=torchtext.data.Field(sequential=True, tokenize=clean_tweets, include_lengths=True,use_vocab=True)
sentimentField=torchtext.data.Field(sequential=False,use_vocab=False,pad_token=None,unk_token=None)
trainTestFields={‘tweet’:(‘t’,tweetField),‘sentiment’:(‘s’,sentimentField)}
Can you help me figure out what I am missing ?