ULMFiT for other languages

Could be because fastai made some breaking changes. Check this post Language_model_learner not working as before? - #12 by sgugger

If that does not work, try to load it this way:

import pickle
itos = pickle.load( open( “res/norwegian_itos.pkl”, “rb” ) )
vocab = Vocab(itos)

data_lm = TextLMDataBunch.from_df(path=“res/model/ulmfit”, train_df=df_train, valid_df=df_valid, vocab=vocab)
learn = language_model_learner(data_lm, AWD_LSTM, pretrained=False, drop_mult=0.5)
learn.load_encoder(‘norwegian_enc’)