ULMFIT AWD_LSTM language model help

Hi guys,

I’m extremely new to fastai and for our class project, we’ve decided to implement ULMFIT on a AWD_LSTM model for a multiclass NLP classification problem. We had been following the instructions closely related to Hiromi’s lecture notes: https://github.com/hiromis/notes/blob/master/Lesson4.md#training-2229

I want to ask whether I am calling the language model and the data_classifier correctly. For the language model, I had written:

data_lm = (TextLMDataBunch.from_csv(path, ‘df.csv’,label_cols=lab, text_cols=[‘text’])
** .split_subsets(train_size=0.8, valid_size=0.2)**
** .label_for_lm()**
** .databunch()**
** )**

which trained pretty fast, most likely thanks to the databunch(). However, when I do a learn.show_results(), the results of the language model are non-sensical.

Furthermore, when I try to call the data_classifer:

data_clas = (TextClasDataBunch.from_csv(path, ‘df.csv’, **
** vocab=data_lm.train_ds.vocab, bs=32,label_cols=lab, text_cols=[‘text’])

** .split_from_df(col=‘is_valid’)**
** .databunch()**
** )**

it gives me a ValueError: could not convert string to float:

Can somebody give us any assistance on how to properly call the language model and the classifier properly (and ideally use optimal data loading techniques) so that we can perform ULMFIT on our problem? Thanks!

Neal

2 Likes