How to call get_preds() on validation data with v2 Text library?

Hello All,

I ma trying to get predictions and metric score on my validation data using fastai v2 library. Can someone help me out?

I am using below code to create DataBlock and classifier

dls_clas = DataBlock(

blocks=(TextBlock.from_df('text', vocab=dls_lm.vocab), CategoryBlock),

get_x=ColReader('text'), 

get_y=ColReader('label'), 

splitter=RandomSplitter()

).dataloaders(data, seq_len=72, bs=64)

learn_clas = text_classifier_learner(dls_clas, AWD_LSTM, drop_mult=0.5,

                            metrics=accuracy).to_fp16()

If possible also let me know how to get train(transformed text prefered) and validation data with predictions to csv

Regards,
Chaitanya Kanth.

I posted a solution to this here: Unable to get Predictions on validation dataset v2

Please try to avoid posting the same question in multiple topics.

1 Like

Thanks a lot @stefan-ai !
And apologies for repeating the question, as I had difficulty in moving the thread to right forum.