Algorithm-VSM
view release on metacpan or search on metacpan
examples/calculate_similarity_matrix_for_all_normalized_docs.pl view on Meta::CPAN
#!/usr/bin/perl -w
use lib '../blib/lib', '../blib/arch';
## calculate_similarity_matrix_for_all_normalized_docs.pl
# This script demonstrates how you can calculate the similarity matrix for
# all of the documents in your corpus. The (i,j)th element of the output
# matrix is the dot-vector based similarity between the i-th document and
# the j-th document. The index associated with a documnet is its place in
# an alphabetically sorted list of all the documents.
use Test::Simple tests => 2;
use lib '../blib/lib','../blib/arch';
use Algorithm::VSM;
# Test 1 (Test VSM:)
my $corpus_dir = "examples/minicorpus";
my @query = qw/ string getallchars throw ioexception distinct treemap histogram map /;
my $corpus_vocab_db = "t/___corpus_vocab_db";
my $doc_vectors_db = "t/___doc_vectors_db";
( run in 0.233 second using v1.01-cache-2.11-cpan-87723dcf8b7 )