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

pad_to_length doesn't work when using concatenated Magnitude vectors in call to query() #50

Open
ParikhKadam opened this issue Apr 3, 2019 · 1 comment

Comments

@ParikhKadam
Copy link

Code to reproduce:

from pymagnitude import MagnitudeUtils, Magnitude
size = 384
vecs1 = Magnitude(MagnitudeUtils.download_model('glove/medium/glove.6B.100d'))
vecs2 = Magnitude(MagnitudeUtils.download_model('fasttext/medium/wiki-news-300d-1M-subword'))
vecs = Magnitude(vecs1, vecs2)
sents = [["I", "read", "a", "book"], ["I", "read", "a", "magazine"]]
a = vecs.query(sents, pad_to_length=size, pad_left=False, truncate_left=False)
print(a.shape)

Output:
(2, 4, 400)

I don't need an alternative but I want this to work in my project.. So, please solve it as soon as possible..

Thank you..

ParikhKadam added a commit to kp-forks/magnitude that referenced this issue Apr 3, 2019
The code took pad_to_length, pad_left and truncate_left as arguments but never used it which caused the issue reported here - plasticityai#50

This is an attempt to solve the above issue..
@ParikhKadam
Copy link
Author

Just created a pull request which I think might solve this issue.. Please take a look and update it as soon as possible @AjayP13

#51

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