I am trying to create a data for a classifier, as in imdb notebook. But it shows 'NoneType' object has no attribute 'textify'
. I already checked there is no NaN value in the dataframe:
data.isnull().any().sum()
returns 0.
Here is the code with error:
data.to_csv('texts.csv', sep=';', encoding='utf-8')
TextList.from_csv('.', 'texts.csv', delimiter=";", cols='text')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
~/anaconda3/envs/fastai/lib/python3.7/site-packages/IPython/core/formatters.py in __call__(self, obj)
700 type_pprinters=self.type_printers,
701 deferred_pprinters=self.deferred_printers)
--> 702 printer.pretty(obj)
703 printer.flush()
704 return stream.getvalue()
~/anaconda3/envs/fastai/lib/python3.7/site-packages/IPython/lib/pretty.py in pretty(self, obj)
400 if cls is not object \
401 and callable(cls.__dict__.get('__repr__')):
--> 402 return _repr_pprint(obj, self, cycle)
403
404 return _default_pprint(obj, self, cycle)
~/anaconda3/envs/fastai/lib/python3.7/site-packages/IPython/lib/pretty.py in _repr_pprint(obj, p, cycle)
695 """A pprint that just redirects to the normal repr function."""
696 # Find newlines and replace them with p.break_()
--> 697 output = repr(obj)
698 for idx,output_line in enumerate(output.splitlines()):
699 if idx:
~/Code/fastai/fastai/data_block.py in __repr__(self)
64 return self.items[i]
65 def __repr__(self)->str:
---> 66 items = [self[i] for i in range(min(5,len(self.items)))]
67 return f'{self.__class__.__name__} ({len(self.items)} items)\n{show_some(items)}\nPath: {self.path}'
68
~/Code/fastai/fastai/data_block.py in <listcomp>(.0)
64 return self.items[i]
65 def __repr__(self)->str:
---> 66 items = [self[i] for i in range(min(5,len(self.items)))]
67 return f'{self.__class__.__name__} ({len(self.items)} items)\n{show_some(items)}\nPath: {self.path}'
68
~/Code/fastai/fastai/data_block.py in __getitem__(self, idxs)
102 def __getitem__(self,idxs:int)->Any:
103 idxs = try_int(idxs)
--> 104 if isinstance(idxs, Integral): return self.get(idxs)
105 else: return self.new(self.items[idxs], inner_df=index_row(self.inner_df, idxs))
106
~/Code/fastai/fastai/text/data.py in get(self, i)
319 def get(self, i):
320 o = super().get(i)
--> 321 return Text(o, self.vocab.textify(o))
322
323 def label_for_lm(self, **kwargs):
AttributeError: 'NoneType' object has no attribute 'textify'
Any idea what might be wrong?