NLP model on new data

Hello,

I ve got a question :slight_smile:
I made a fastai nlp model but i want to execute it on a new dataframe

  • List item

So i tried the following :
Reading the data
data_lm = (TextList.from_df(df1_test, Path(“model”), cols=‘Commentaire’)
.split_by_rand_pct(0.1, seed=42)
.label_for_lm()
.databunch(bs=128, num_workers=1, backwards=True))

  • List item

then loading the model
classifier = load_learner(’/content/drive/My Drive/’, ‘verbatmodel2.pkl’)
Message /usr/local/lib/python3.6/dist-packages/torch/serialization.py:657: SourceChangeWarning: source code of class ‘fastai.text.models.awd_lstm.AWD_LSTM’ has changed. you can retrieve the original source code by accessing the object’s source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)

  • List item

then
classifier.data.add_test(df1_test)

  • List item

then
prob_preds = classifier.get_preds(ds_type=DatasetType.Test, ordered=True)

gives an error : AttributeError: ‘WeightDropout’ object has no attribute ‘idxs’