Using torchtext for a multiclass classification problem

I have a dataset which is in csv format having text as first field and class label as second field . The number of classes are 6 . How can i create a field object for this. Example code tutorials are helpful

The pipeline to load dataset is very similar like this.

For the multiclass classification problem, there are different models for that. You may take a look at the Bag-Of-Word model here

1 Like

for Mutli classification:
LABEL = data.LabelField(), for multi classification, we donot need to set dtype as pytorch expects it be as numericalized long tensors

IMO, best place to start : https://github.com/bentrevett/pytorch-sentiment-analysis

Happy learning

1 Like