Treex::Tool::Tagger::Featurama - base class for Featurama PoS taggers
Perl wrapper for Featurama implementation of Collins' perceptron algorithm.
This class cannot be instantiated directly,
you must use derived classes which override methods
_get_feature_names() and probably also
use Treex::Tool::Tagger::Featurama::SomeDerivedClass; my @wordforms = qw(John loves Jack); my $tagger = Treex::Tool::Tagger::Featurama::SomeDerivedClass->new(path => '/path/to/model'); my ($tags_rf, $lemmas_rf) = $tagger->tag_sentence(\@wordforms);
This method should provide all possible morphological analyses for the given wordform.
This method should return an array of feature names.
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 );
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
Tomáš Kraut <email@example.com>
Ondřej Dušek <firstname.lastname@example.org>
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.