AI-Classifier-Japanese
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
"prereqs" : {
"configure" : {
"requires" : {
"CPAN::Meta" : "0",
"CPAN::Meta::Prereqs" : "0",
"Module::Build" : "0.38"
}
},
"develop" : {
"requires" : {
"Test::CPAN::Meta" : "0",
"Test::MinimumVersion" : "0.10108",
"Test::Pod" : "1.41",
"Test::Spellunker" : "v0.2.7"
}
},
"runtime" : {
"requires" : {
"Algorithm::NaiveBayes" : "0",
"Mouse" : "0",
"Text::MeCab" : "0",
"perl" : "5.008005"
}
},
"test" : {
"requires" : {
"Test::File" : "0",
"Test::More" : "0.98"
}
}
},
"provides" : {
"AI::Classifier::Japanese" : {
"file" : "lib/AI/Classifier/Japanese.pm",
"version" : "0.01"
}
},
"release_status" : "stable",
---
abstract: 'the combination wrapper of Algorithm::NaiveBayes and Text::MeCab.'
author:
- 'Shinichi Goto <shingtgt @ GMAIL COM>'
build_requires:
Test::File: 0
Test::More: 0.98
configure_requires:
CPAN::Meta: 0
CPAN::Meta::Prereqs: 0
Module::Build: 0.38
dynamic_config: 0
generated_by: 'Minilla/v0.11.1, CPAN::Meta::Converter version 2.120921'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
# Create new instance
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
# 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
lib/AI/Classifier/Japanese.pm view on Meta::CPAN
# Create new instance
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
use strict;
use Test::More;
use AI::Classifier::Japanese;
my $classifier = AI::Classifier::Japanese->new();
my $CATEGORY_POSITIVE = "positive";
my $CATEGORY_NEGATIVE = "negative";
$classifier->add_training_text("ãã®ãã", $CATEGORY_POSITIVE);
$classifier->add_training_text("楽ãã", $CATEGORY_POSITIVE);
use strict;
use Test::More;
use_ok $_ for qw(
AI::Classifier::Japanese
);
my $classifier = AI::Classifier::Japanese->new();
isa_ok($classifier, 'AI::Classifier::Japanese');
can_ok($classifier, $_) for qw(
use strict;
use Test::More;
use AI::Classifier::Japanese;
my $classifier = AI::Classifier::Japanese->new();
my $CATEGORY_POSITIVE = "positive";
my $CATEGORY_NEGATIVE = "negative";
$classifier->add_training_text("ãã®ãã", $CATEGORY_POSITIVE);
t/save_state.t view on Meta::CPAN
use strict;
use Test::More;
use Test::File;
use AI::Classifier::Japanese;
my $classifier = AI::Classifier::Japanese->new();
my $PARAMS_PATH = "param_dummy.dat";
my $CATEGORY_POSITIVE = "positive";
my $CATEGORY_NEGATIVE = "negative";
$classifier->add_training_text("ãã®ãã", $CATEGORY_POSITIVE);
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.695 second using v1.00-cache-2.02-grep-82fe00e-cpan-585fae043c8 )