Skip to content

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

@mikechen66

Description

@mikechen66

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions