Skip to content

error with fse.average function #72

@antoniakrm

Description

@antoniakrm

TypeError                                 Traceback (most recent call last)
[<ipython-input-16-9b53162cbd8a>](https://localhost:8080/#) in <module>
      2 
      3 vecs = Vectors.from_pretrained("glove-wiki-gigaword-50")
----> 4 model = Average(vecs)
      5 
      6 sentences = [["cat", "say", "meow"], ["dog", "say", "woof"]]

1 frames
[/usr/local/lib/python3.7/dist-packages/fse/models/base_s2v.py](https://localhost:8080/#) in __init__(self, model, sv_mapfile_path, wv_mapfile_path, workers, lang_freq, fast_version, batch_words, batch_ngrams, **kwargs)
    159         self.prep = BaseSentence2VecPreparer()
    160 
--> 161         self.word_weights = ones(len(self.wv), REAL)
    162 
    163     def __str__(self) -> str:

TypeError: object of type 'Word2VecKeyedVectors' has no len()

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