How to import TextLMDataBunch?

I am following this tutorial to build a NLP sentiment analysis model.

from fastai.text import *

This is the only import specified that includes fastai.

Unfortunately the TextLMDataBunch is undefined.

What import should I used to have this class avaialable?

I have already tried:

from import TextLMDataBunch

But apparently is not even a package.

Consequently I checked the source on github. does not include TextLMDataBunch, but does.

So how do I import from fastai1 ? Is this an older are newer version.


That tutorial seems like it’s for the V1 of FastAI.

Regarding the Source code == V2 of FastAI == V1 of FastAI

I would look at this tutorial: to use with the V2 of the FastAI library.

1 Like