AI-Classifier-Japanese

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

   "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",

META.yml  view on Meta::CPAN

---
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

README.md  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

# 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

t/all.t  view on Meta::CPAN

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);

t/base.t  view on Meta::CPAN

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(

t/labels.t  view on Meta::CPAN

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 distribution
 view release on metacpan -  search on metacpan

( run in 1.266 second using v1.00-cache-2.02-grep-82fe00e-cpan-585fae043c8 )