I can’t figure out how to properly setup a field object for multi-label classification with torchtext. Here is what I have in my dataset class:

image.png946×288 30.1 KB

… where lbl is a OHE numpy array (e.g., [0, 1, 0 ,0, 1, 1, 0])
My torchtext field object is defined like this:
tt_LABEL = data.Field(sequential=False, use_vocab=False)
But when I try to package everything up into a BucketIterator and get a mini-batch, I get the following exception:
only length-1 arrays can be converted to Python scalars
There error is on line 294 of field.py:
294 arr = [numericalization_func(x) for x in arr]