Tomáš Kraut > Treex-Unilang > Treex::Tool::Tagger::Featurama

Download:
Treex-Unilang-0.08170.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.08170   Source  

NAME ^

Treex::Tool::Tagger::Featurama

VERSION ^

version 0.08170

DESCRIPTION ^

Perl wrapper for Featurama implementation of Collins' perceptron algorithm.

SYNOPSIS ^

 use Treex::Tool::Tagger::Featurama;

 my @wordforms = qw(John loves Jack);

 my $tagger = Treex::Tool::Tagger::Featurama->new(path => '/path/to/model');

 my ($tags_rf, $lemmas_rf) = $tagger->tag_sentence(\@wordforms);

CONSTRUCTOR

my $tagger = Treex::Tool::Tagger::Featurama->new(path = '/path/to/model');

METHODS

my ($tags_rf) = $tagger->tag_sentence(\@wordforms);

METHODS TO OVERRIDE

_analyze($wordform)

This method should provide all possible morphological analyses for the given wordform.

_get_feature_names()

This method should return an array of feature names.

_get_features($wordforms_rf, $analyses_rf_rf, $index)

This method should return an array of features, given all wordforms in the sentence, all possible morphological analyses for each of the wordforms, and a position in the sentence. Since the features may include parts of the context, it is necessary to provide the whole sentence to this function. For example:

 $featurama->_get_features(
     [qw(Time flies)],
     [[qw(NN NNP VB JJ)], [qw(VBZ NNS)]],
     0
 );
_extract_tag_and_lemma($index, $wordform)

This method should extract tag and lemma given index in sentence and wordform. It will probably want to use $self->perc TODO this will probably change

AUTHORS ^

Tomáš Kraut <kraut@ufal.mff.cuni.cz>

Ondřej Dušek <odusek@ufal.mff.cuni.cz>

COPYRIGHT AND LICENSE ^

Copyright © 2011-2012 by Institute of Formal and Applied Linguistics, Charles University in Prague

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: