Skip to content
Term-Frequency Inverse Document Frequency calculator for Perl 6.
Other
  1. Other 100.0%
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
lib/Text
t
.travis.yml
META6.json
README.md

README.md

Text::TFIdf

Given a set of documents, generates TF-IDF Vectors for them. Build Status

Installation

panda install Text::TFIdf

Usage

use Text::TFIdf;

my %stop-words;

my $doc-store = TFIdf.new(:trim(True), :stop-list(%stop-words));

$doc-store.add('perl is cool');
$doc-store.add('i like node');
$doc-store.add('java is okay');
$doc-store.add('perl and node are interesting meh about java');

sub results($id, $score) {
  say $id ~ " got " ~ $score;
}

$doc-store.tfids('node perl java', &results);

Output:

0 got 0.858454714967854
1 got 0.858454714967854
2 got 0.858454714967854
3 got 2.17296349726238

Acknowledgements

You can’t perform that action at this time.