Я новичок в Gensim, изучаю Gensim и следую примеру здесь: https://www.machinelearningplus.com/nlp/gensim-tutorial/
Я не уверен в последней строке, которая создает корпус из словаря. При создании словаря мы уже использовали simple_preprocess для построчной обработки «документов». При создании корпуса с использованием словаря я думал, что нам нужно снова использовать simple_preprocess для обработки «документов» построчно. Это избыточно?
documents = ["This is the first line",
"This is the second sentence",
"This third document"]
# Create the Dictionary and Corpus
mydict = corpora.Dictionary([simple_preprocess(line) for line in documents])
# Why need to use simple_preprocess and pass the documents again while
# the last call already created the dictionary using simple_preporcess on documents
corpus = [mydict.doc2bow(simple_preprocess(line)) for line in documents]
Спасибо,
Alex