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

Wrong output #25

Open
limapedro opened this issue Nov 22, 2017 · 3 comments
Open

Wrong output #25

limapedro opened this issue Nov 22, 2017 · 3 comments

Comments

@limapedro
Copy link

When I try to predict some sentence I get the prediction for each word.
Is this a bug?

@giacbrd
Copy link
Owner

giacbrd commented Nov 23, 2017

Hi, can you give me an example of input sentence?

@limapedro
Copy link
Author

Here my source:

from shallowlearn.models import GensimFastText

clf = GensimFastText(size=100, min_count=0, loss='hs', iter=1, seed=66)'''

clf.fit([('i', 'am', 'tall'), ('you', 'are', 'fat')], ['yes', 'no'])
print(clf.predict(['tall', 'am', 'i']))

It outputs: ['no', 'no', 'no'] Instead of just 'no'

@giacbrd
Copy link
Owner

giacbrd commented Nov 24, 2017

This is because predict takes a list of samples, while you are passing a single sample: ['tall', 'am', 'i']
Try for example clf.predict([('tall', 'am', 'i')])

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

2 participants