Skip to content

Word2Vec has no attribute load_word2vec_format #2

@iamtalhaasghar

Description

@iamtalhaasghar
Traceback (most recent call last):
  File "/mnt/data/programmer/projects/clones/urduvec_samarh/main.py", line 3, in <module>
    model = word2vec.Word2Vec.load_word2vec_format('urduvec_140M_100K_300d.bin', binary=True)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'Word2Vec' has no attribute 'load_word2vec_format'

Solution for people who are going to visit this in future:

from gensim.models import word2vec
model = word2vec.KeyedVectors.load_word2vec_format('urduvec_140M_100K_300d.bin', binary=True)

reference

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