Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with fse.average function #72

Open
antoniakrm opened this issue Nov 23, 2022 · 0 comments
Open

error with fse.average function #72

antoniakrm opened this issue Nov 23, 2022 · 0 comments

Comments

@antoniakrm
Copy link


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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant