Getting "TypeError: 'NoneType' object is not iterable" as error while implementing bag of words unigram

I have written following code same as video but getting this error

corpus=[‘indian cricket team willwin the world cup says indian captain kohli’,
'indian pm says we will win lok sabha election ',
‘the movie raazi is an exciting indian thriller’,
‘the nobel won the hearts of the people’

def mytokenizer(sentence):
words = tokenizer.tokenize(sentence.lower())
return useful(words)

from sklearn.feature_extraction.text import CountVectorizer

Hello Gautam,
Which line are you getting the error in? It would be easier for me to decode it if you could send me a picture of the error.

sir i have uploaded the picture kindly resolve it its been 7 days now

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

A subscriptable object is any object that implements the getitem special method (think lists, dictionaries). It is an object that records the operations done to it and it can store them as a “script” which can be replayed. You are trying to subscript an object which you think is a list or dict, but actually is None. NoneType is the type of the None object which represents a lack of value, for example, a function that does not explicitly return a value will return None.‘NoneType’ object is not subscriptable is the one thrown by python when you use the square bracket notation object[key] where an object doesn’t define the getitem method . You might have noticed that the method sort() that only modify the list have no return value printed – they return the default None. This is a design principle for all mutable data structures in Python.