Hey @hiromi!  I remember ya from fastai.
Here is code I’m using for the toxic comp.  Appreciate any feedback and the good and ugly of it and what can be improved.  Hope this helps:

  
      gist.github.com
  
  
    https://gist.github.com/ohmeow/5b3543a5115040001fce59a105ac4269 357
toxic.py
class TextMultiLabelDataset(torchtext.data.Dataset):
    def __init__(self, df, tt_text_field, tt_label_field, txt_col, lbl_cols, **kwargs):
        # torchtext Field objects
        fields = [('text', tt_text_field)]
        for l in lbl_cols: fields.append((l, tt_label_field))
            
        is_test = False if lbl_cols[0] in df.columns else True
        n_labels = len(lbl_cols)
        
        examples = []
This file has been truncated. show original