Skip to content

classify_with_score and scored_categories return undefined? #43

@cheeyeo

Description

@cheeyeo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions