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

classify_with_score and scored_categories return undefined? #43

Closed
cheeyeo opened this issue Sep 3, 2015 · 3 comments
Closed

classify_with_score and scored_categories return undefined? #43

cheeyeo opened this issue Sep 3, 2015 · 3 comments

Comments

@cheeyeo
Copy link

cheeyeo commented Sep 3, 2015

Hi

I tried running ClassifierReborn::LSI from the example in the README and when invoking the 'classify_with_score' and 'scored_categories' methods, it returns undefined? Am I calling it wrong?

lsi = ClassifierReborn::LSI.new

strings = [ ["This text deals with dogs. Dogs.", "a"],
            ["This text involves dogs too. Dogs!", "a"],
            ["This text revolves around cats. Cats.", "b"],
            ["This text also involves cats. Cats!", "b"],
            ["This text involves birds. Birds.", "c"]]

strings.each {|x| lsi.add_item x.first, x.last}

# NoMethodError
scored_categories = lsi.scored_categories("dog bird cat")

# NoMethodError
lsi.classify_with_score("test")
@cheeyeo
Copy link
Author

cheeyeo commented Sep 3, 2015

I also noticed that these methods are not in the gem version pulled from rubygems.org? The LSI class differs from the master branch here in the repo?

@parkr
Copy link
Member

parkr commented Sep 3, 2015

@cheeyeo the readme might be reflecting current master which has (in the last few days) undergone some fairly significant changes. Please use the master branch for those or find the readme at the version you're running.

@cheeyeo
Copy link
Author

cheeyeo commented Sep 3, 2015

@parkr Thanks for the prompt reply! Thought I was losing my mind for a moment 👍

@cheeyeo cheeyeo closed this as completed Sep 3, 2015
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