AI-Classifier-Japanese
view release on metacpan or search on metacpan
$meta->prereqs
)->with_merged_prereqs(
CPAN::Meta::Prereqs->new($mbmeta->prereqs)
)->as_string_hash;
my $mymeta = CPAN::Meta->new(
{
%{$meta->as_struct},
prereqs => $prereqs_hash
}
);
print "Merging cpanfile prereqs to MYMETA.yml\n";
$mymeta->save('MYMETA.yml', { version => 1.4 });
print "Merging cpanfile prereqs to MYMETA.json\n";
$mymeta->save('MYMETA.json', { version => 2 });
b) cause the whole of any work that you distribute or publish, that
in whole or in part contains the Program or any part thereof, either
with or without modifications, to be licensed at no charge to all
third parties under the terms of this General Public License (except
that you may choose to grant warranty protection to some or all
third parties, at your option).
c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use
in the simplest and most usual way, to print or display an
announcement including an appropriate copyright notice and a notice
that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these
conditions, and telling the user how to view a copy of this General
Public License.
d) You may charge a fee for the physical act of transferring a
copy, and you may at your option offer warranty protection in
exchange for a fee.
# Add training text
$classifier->add_training_text("ãã®ããï¼æ¥½ããï¼", 'positive');
$classifier->add_training_text("ã¤ããï¼è¾ãï¼", 'negative');
# Train
$classifier->train;
# Test
my $result_ref = $classifier->predict("ãã®ãã");
print $result_ref->{'positive'}; # => Confidence value
# DESCRIPTION
AI::Classifier::Japanese is a Japanese-text category classifier module using Naive Bayes and MeCab.
This module is based on Algorithm::NaiveBayes.
Only noun, verb and adjective are currently supported.
# METHODS
- `my $classifier = AI::Classifier::Japanese->new();`
# Add training text
$classifier->add_training_text("ãã®ããï¼æ¥½ããï¼", 'positive');
$classifier->add_training_text("ã¤ããï¼è¾ãï¼", 'negative');
# Train
$classifier->train;
# Test
my $result_ref = $classifier->predict("ãã®ãã");
print $result_ref->{'positive'}; # => Confidence value
=head1 DESCRIPTION
AI::Classifier::Japanese is a Japanese-text category classifier module using Naive Bayes and MeCab.
This module is based on Algorithm::NaiveBayes.
Only noun, verb and adjective are currently supported.
=head1 METHODS
=over
lib/AI/Classifier/Japanese.pm view on Meta::CPAN
# Add training text
$classifier->add_training_text("ãã®ããï¼æ¥½ããï¼", 'positive');
$classifier->add_training_text("ã¤ããï¼è¾ãï¼", 'negative');
# Train
$classifier->train;
# Test
my $result_ref = $classifier->predict("ãã®ãã");
print $result_ref->{'positive'}; # => Confidence value
=head1 DESCRIPTION
AI::Classifier::Japanese is a Japanese-text category classifier module using Naive Bayes and MeCab.
This module is based on Algorithm::NaiveBayes.
Only noun, verb and adjective are currently supported.
=head1 METHODS
=over
t/save_state.t view on Meta::CPAN
$classifier->add_training_text("ã¤ãã", $CATEGORY_NEGATIVE);
$classifier->train;
$classifier->save_state($PARAMS_PATH);
file_exists_ok($PARAMS_PATH);
$classifier->restore_state($PARAMS_PATH);
my $result_ref = $classifier->predict("妿 ¡ã¯ææ¥ããã");
print "Positive :" . $result_ref->{positive} . "\n";
print "Negative :" . $result_ref->{negative} . "\n";
$result_ref = $classifier->predict("妿 ¡ã«æ¨æ¥è¡ã£ãã");
print "Positive :" . $result_ref->{positive} . "\n";
print "Negative :" . $result_ref->{negative} . "\n";
done_testing;
( run in 1.714 second using v1.01-cache-2.11-cpan-de7293f3b23 )