public interface Classifier<OUTCOME_TYPE>
This class provides an abstraction for interfacing with various ML learning libraries such as Mallet, Libsvm, OpenNLP Maxent, etc. Each subclass must override the abstract methods (naturally!) each of which is documented below. Each subclass must also be able to be instantiated from a single jar file that contains all the necessary meta-data and data (e.g. the model). The contents of the jar file will vary for each implementation. However, each jar file should have a manifest file with two attributes, "returnType" and "classifier". The jar command can be used to set the manifest of a jar file. A manifest file should look something like this:
Manifest-Version: 1.0 classifier: org.cleartk.ml.OpenNLPMaxentClassifier returnType: string
| Modifier and Type | Method and Description |
|---|---|
OUTCOME_TYPE |
classify(List<Feature> features)
Classifies a list of features.
|
Map<OUTCOME_TYPE,Double> |
score(List<Feature> features)
Classify a list of features, and return the scores for each of the outcomes
|
OUTCOME_TYPE classify(List<Feature> features) throws CleartkProcessingException
features - a list of features to be classifiedCleartkProcessingExceptionMap<OUTCOME_TYPE,Double> score(List<Feature> features) throws CleartkProcessingException
features - a list of features to be classifiedCleartkProcessingExceptionCopyright © 2014. All rights reserved.