E - Type of tokens in the tagging.public class MarginalTaggerEvaluator<E> extends Object implements ObjectHandler<Tagging<E>>
MarginalTaggerEvaluator evaluates marginal taggers either
directly or by adding their outputs.
Test cases may be added directly using the method addCase(Tagging,TagLattice), where the tagging is a reference
gold-standard tagging and the tag lattice the system response
tagging.
Test cases may be added indirectly using the method handle(Tagging). With this use, the contained tagger in the
evaluator is used to generate the response tag lattice, which is
then added along with the reference tagging.
The tagger may be set in the constructor, or may be set using
the method setTagger(MarginalTagger). The tagger must
be non-null in order for a call to the handle method to succeed.
The token-by-token evaluation is available through the method
perTokenEval(), which returns a classifier
evaluator. The items for the classifier evaluator are the tokens,
and their classification is determined by the marginal probability
assignments for those tags by the tag lattice. If the marginal
tagger evaluator stores tokens, they will be available as part of
the returned evaluator.
| Constructor and Description |
|---|
MarginalTaggerEvaluator(MarginalTagger<E> tagger,
Set<String> tagSet,
boolean storeTokens)
Construct an evaluator for the specified marginal tagger,
using the specifed tag set and flag indicating whether or
not to store input tokens.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCase(Tagging<E> referenceTagging,
TagLattice<E> responseLattice)
Add a case for evaluation consisting of the gold-standard
reference tagging and a lattice representing the output of
a marginal tagger.
|
void |
handle(Tagging<E> referenceTagging)
Add a test case consisting of the specified reference tagging
along with the lattice output of the marginal tagger being
evaluated on the tokens of the reference tagging.
|
String |
lastCaseToString(int maxTagsPerToken) |
ConditionalClassifierEvaluator<E> |
perTokenEval()
Returns the tagger evaluation on a per-token basis.
|
void |
setTagger(MarginalTagger<E> tagger)
Set the tagger for this tagger evaluated to the specified
tagger.
|
boolean |
storeTokens()
Returns
true if this evaluator is storing input
tokens. |
MarginalTagger<E> |
tagger()
Returns the tagger for this evaluator.
|
Set<String> |
tagSet()
Returns an unmodifiable view of the tags used by
this evaluator.
|
public MarginalTaggerEvaluator(MarginalTagger<E> tagger, Set<String> tagSet, boolean storeTokens)
tagger - The tagger to use or null if all cases
are added directly or the tagger's specified later.tagSet - Complete set of tags found in reference and
response taggings.storeTokens - Flag set to true to store input
tokens for return during classification.public MarginalTagger<E> tagger()
public void setTagger(MarginalTagger<E> tagger)
tagger - Tagger to be evaluated.public boolean storeTokens()
true if this evaluator is storing input
tokens.public Set<String> tagSet()
public void addCase(Tagging<E> referenceTagging, TagLattice<E> responseLattice)
referenceTagging - Reference gold-standard tagging.responseLattice - System response.IllegalArgumentException - If the reference tagging
is not the same length as the response.public void handle(Tagging<E> referenceTagging)
handle in interface ObjectHandler<Tagging<E>>referenceTagging - Reference tagging to evaluatepublic String lastCaseToString(int maxTagsPerToken)
public ConditionalClassifierEvaluator<E> perTokenEval()
Copyright © 2019 Alias-i, Inc.. All rights reserved.