public class ViterbiClassifier<OUTCOME_TYPE> extends Object implements SequenceClassifier<OUTCOME_TYPE>, org.apache.uima.fit.factory.initializable.Initializable, ReflectionUtil.TypeArgumentDelegator
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
addScores |
protected Classifier<OUTCOME_TYPE> |
delegatedClassifier |
protected OutcomeFeatureExtractor[] |
outcomeFeatureExtractors |
static String |
PARAM_ADD_SCORES |
static String |
PARAM_STACK_SIZE |
protected int |
stackSize |
| Constructor and Description |
|---|
ViterbiClassifier(Classifier<OUTCOME_TYPE> delegatedClassifier,
OutcomeFeatureExtractor[] outcomeFeatureExtractors) |
| Modifier and Type | Method and Description |
|---|---|
List<OUTCOME_TYPE> |
classify(List<List<Feature>> features)
Classifies a sequence of feature lists.
|
Map<String,Type> |
getTypeArguments(Class<?> genericType) |
void |
initialize(UimaContext context) |
List<Map<OUTCOME_TYPE,Double>> |
score(List<List<Feature>> features)
Classify a sequence of feature lists, and return the scores for each of the outcomes for each
feature list.
|
List<OUTCOME_TYPE> |
viterbi(List<List<Feature>> featureLists)
This implementation of Viterbi requires at most stackSize * sequenceLength calls to the
classifier.
|
protected boolean addScores
protected Classifier<OUTCOME_TYPE> delegatedClassifier
protected OutcomeFeatureExtractor[] outcomeFeatureExtractors
public static final String PARAM_ADD_SCORES
public static final String PARAM_STACK_SIZE
protected int stackSize
public ViterbiClassifier(Classifier<OUTCOME_TYPE> delegatedClassifier, OutcomeFeatureExtractor[] outcomeFeatureExtractors)
public List<OUTCOME_TYPE> classify(List<List<Feature>> features) throws CleartkProcessingException
SequenceClassifierclassify in interface SequenceClassifier<OUTCOME_TYPE>features - a list of features for each member in the sequenceCleartkProcessingExceptionpublic Map<String,Type> getTypeArguments(Class<?> genericType)
getTypeArguments in interface ReflectionUtil.TypeArgumentDelegatorpublic void initialize(UimaContext context) throws ResourceInitializationException
initialize in interface org.apache.uima.fit.factory.initializable.InitializableResourceInitializationExceptionpublic List<Map<OUTCOME_TYPE,Double>> score(List<List<Feature>> features) throws CleartkProcessingException
SequenceClassifierscore in interface SequenceClassifier<OUTCOME_TYPE>features - a list of features for each member in the sequenceCleartkProcessingExceptionpublic List<OUTCOME_TYPE> viterbi(List<List<Feature>> featureLists) throws CleartkProcessingException
featureLists - a sequence-worth of features. Each ListCleartkProcessingExceptionPARAM_STACK_SIZE,
OutcomeFeatureExtractorCopyright © 2014. All rights reserved.