NameError: name 'TextBlock' is not defined

Hi. I am trying to run this line of code:

imdb_lm = DataBlock(blocks=TextBlock.from_df('text', is_lm=True), get_x=ColReader('text'), splitter=ColSplitter())

and it gives this error

NameError: name 'TextBlock' is not defined

I am importing:

from fastai.data.all import * 
from fastai.text.core import *

(thanks in advance )

1 Like

TextBlock lives in fastai.text.data

3 Likes