Hi,
I have built a learner object for classifying text data and now I want to incrementally train it one sample at a time recording the change in accuracy along the way.
My code:
learn # learner object
df_new=.......#DataFrame containing the new sample(contains only 1 row)
temp_dbunch=TextClasDataBunch.from_df(train_df = df_new, valid_df = df_val, path = "")
learn.data=temp_dbunch
learn.fit_one_cycle(1)
I am getting this error when I am trying to create a TextClasDataBunch object:
TypeError Traceback (most recent call last)
<ipython-input-52-021052ca68ca> in <module>()
----> 1 temp_dbunch=TextClasDataBunch.from_df(train_df = df_new, valid_df = df_val,
path = "")
1 frames
/usr/local/lib/python3.6/dist-packages/fastai/data_block.py in __init__(self, path,
train, valid)
451 def __init__(self, path:PathOrStr, train:ItemList, valid:ItemList):
452 self.path,self.train,self.valid,self.test = Path(path),train,valid,None
453 if not self.train.ignore_empty and len(self.train.items) == 0:
454 warn("Your training set is empty. If this is by design, pass `ignore_empty=True` to remove this warning.")
455 if not self.valid.ignore_empty and len(self.valid.items) == 0:
TypeError: len() of unsized object
Is this the correct way to do this?
Thanks in advance