Test data or unlabeled data

I am sorry for the simple question.
I load data for text classification with code
TextList.from_csv(path, 'texts.csv', cols='text').split_from_df(col=2).label_from_df(cols=0).databunch(bs=bs, num_workers=1)
So I have a Train and Valid Data.
I have no idea how to load test data, or just data to make a prediction (unlabeled data). I keep it in csv file.

Thank you for your help in advance.

Hi there,

your code looks pretty much like fastaiv1, am I right? Then try to add test=‘test.csv’ to from_csv

TextList.from_csv(path, 'texts.csv', cols='text', test='test.csv').split_from_df(col=2).label_from_df(cols=0).databunch(bs=bs, num_workers=1)

Create a learner, train it and later run

preds,y = learn.get_preds(ds_type=DatasetType.Test)

This worked for me a while back with fastaiv1.

If you are working with the current version of fastai you yould use the test_dl method.


Thank you for the response.
Yes, it’s 1st version.
Unfortunately, there is no keyword argument “test”. =(

Ah I see… I was using a DataBunch. Try to use TextDataBunch.from_csv instead of TextList