DOsinga / deep_learning_cookbook

Deep Learning Cookbox
Apache License 2.0
686 stars 335 forks source link

15.4 Train a music recommender -- NameError: name 'model_input' is not defined #80

Open mikechen66 opened 4 years ago

mikechen66 commented 4 years ago

It show NameError: name 'model_input' is not defined.

1. Lines of Code

class WordSplitter(object):
    def __init__(self, filename):
        self.filename = filename

    def __iter__(self):
        with open(self.filename) as fin:
            for line in fin:
                yield line.split()

model = gensim.models.Word2Vec(model_input, min_count=4)

2. NameError Message


NameError Traceback (most recent call last)

in 8 yield line.split() 9 ---> 10 model = gensim.models.Word2Vec(model_input, min_count=4) NameError: name 'model_input' is not defined