Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
t
 
 
 
 
 
 
 
 

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

About

Term-Frequency Inverse Document Frequency calculator for Perl 6.

Resources

Releases

No releases published

Packages

No packages published

Languages

  • Other 100.0%
You can’t perform that action at this time.