AI-Classifier
view release on metacpan or search on metacpan
lib/AI/Classifier/Text/Analyzer.pm view on Meta::CPAN
=head1 DESCRIPTION
Computes feature vectors of text using some heuristics and adds words count
(using L<Text::WordCounter> by default).
The object is immutable - but some methods use a second parameter as an accumulator for the
features found in given text.
It uses some specific values and methods that work for our case - but are not guaranteed
to bring good results universally - see the source for details!
=head1 ATTRIBUTES
=over 4
=item C<word_counter>
Object with a word_count method that will calculate the frequency of words in a text document.
By default L<Text::WordCounter>.
=item C<global_feature_weight>
The weight assigned for computed features of the text document. By default 2.
=back
=head1 METHODS
=over 4
=item C<< new(word_counter => $foo, global_feature_weight => 3) >>
Creates a new AI::Classifier::Text::Analyzer object. Both arguments are optional.
=item C<analyze($document, $features)>
Computes the feature vector of the given document and adds the initial vector of C<$features>.
=item C<analyze_urls($document, $features)>
Computes a vector special url related features of a given text - currently there are used
C<NO_URLS>, C<MANY_URLS> and C<REPEATED_URLS> features.
=item C<filter($document)>
Removes html related parts from the text.
=back
=head1 SEE ALSO
AI::NaiveBayes (3), AI::Classifier::Text(3)
=head1 AUTHOR
Zbigniew Lukasiak <zlukasiak@opera.com>, Tadeusz SoÅnierz <tsosnierz@opera.com>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Opera Software ASA.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
__END__
# ABSTRACT: computing feature vectors from documents
( run in 1.331 second using v1.01-cache-2.11-cpan-acf6aa7dc9e )