Create DataBunch from TextClasDataBunch

I am trying to create a simple DataBunch from my TextClasDataBunch, so that it conforms with the description of “Batching for classification” in the notebook

il = TextList.from_files(path, include=['train', 'test'])
sd = SplitData.split_by_func(il, partial(grandparent_splitter, valid_name='test'))
ll = label_by_func(sd, parent_labeler, proc_x = [proc_tok, proc_num], proc_y=proc_cat)

I don’t have files I can apply to this approach, I have 2 labelled pandas dataframes for train and valid datasets, and so I used TextClasDataBunch.from_df since it seemed appropriate. Everything I need is in my TextClasDataBunch object, but hidden away, whereas the example in the code is a very simple set of the two numeralicalized and labelled datasets.

This may not be needed, since the TextClasDataBunch has what I need, but I am unsure whether the simpler format may be required as I follow the notebooks through with my own data. Is there a simpler approach to handling dataframes that would more naturally lead into the workflow in the notebook?

I have since worked out that since the code in the lesson is a continuation of the “designing pytorch/fastai from scratch” approach of the course 3 tutorials then I am really trying to shoehorn my data into a “from scratch” implementation of working with ULMFiT. So, I have since reverted to the official implementation and the standard fastai libraries. Still, I spent a lot if time trying to create a dataframe loader along the lines of the files loader, but didn’t quite get there, so if anyone has done this I would really appraciate seeing how it was done!