Help for this page

Select Code to Download


  1. or download this
    sub invert_string {
           my ($string, $weight, $hash) = @_;
    ...
                grep { !$StopWords{$_} }
                @{words(lc($string))};
        }
    
  2. or download this
    my $sentence1 = {
        wordA => 2,
        wordB => 1,
    };
    
  3. or download this
    sub invert_item {
            my $item = shift;
    ...
            invert_string($item->{description}, 1, \%hash);
            return \%hash;
        }
    
  4. or download this
     #!/usr/bin/perl
    
    ...
        }
    
        $nb->train; # Work out all the probabilities
    
  5. or download this
     my $rss = new XML::RSS;
            $rss->parsefile("$category.rdf");
           $nb->add_instance(attributes => invert_item($_),
                              label      => $category) for @{$rss->{'items
    +'}};
        }