Help for this page

Select Code to Download


  1. or download this
    my $positive = {
        word1 => 2,
    ...
        word4 => 3,
        word5 => 1,
    };
    
  2. or download this
    my $categorizer = Algorithm::NaiveBayes->new;
    
    ...
        label => 'negative');
    
    $categorizer->train;
    
  3. or download this
    my $sentence1 = {
        wordA => 2,
    ...
    elsif ($probability->{'negative'} > 0.5) { 
        # sentence1 probably negative
    }