my $sentence1 = { wordA => 2, wordB => 1, }; my $probability = $categorizer->predict(attributes => $sentence1); if ($probability->{'positive'} > 0.5) { # sentence1 probably positive } elsif ($probability->{'negative'} > 0.5) { # sentence1 probably negative }