Gensim .wv attribute deprecated · Issue #3 · PacktPublishing/Python-Machine-Learning-By-Example-Third-Edition · GitHub
Skip to content

Gensim .wv attribute deprecated #3

Description

@prpfr3

In Chapter 11 word_embedding.py in the Github repo and also in the book, the following code samples raise an attribute error because "vw" is deprecated at least in gensim 4.2.0:-

vector = model.wv['computer']

doc_vector = np.mean([model.wv[word] for word in doc_sample], axis=0)

Simply removing the 'wv' attribute solves the issue as per the SO solution for a similar issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions