def readFile(file):
f = open(file,‘r’,encoding=‘utf-8’)
text = f.read()
sentences = nltk.sent_tokenize(text)
data = []
for sent in sentences:
words = nltk.word_tokenize(sent)
words = [w.lower() for w in words if len(w)>2 and w not in stopw]
data.append(words)
return data
text = readFile(‘glove.6B.50d.txt’)
This is giving memory error how can I load the file then