csli.util.classify.stanford
Class ExternalClassifierFactory
java.lang.Object
csli.util.classify.stanford.ExternalClassifierFactory
- All Implemented Interfaces:
- edu.stanford.nlp.classify.ClassifierFactory
- Direct Known Subclasses:
- C4_5ClassifierFactory, SvmLightClassifierFactory
public abstract class ExternalClassifierFactory
- extends Object
- implements edu.stanford.nlp.classify.ClassifierFactory
An extension for the standard Stanford ClassifierFactory class for use with external stand-alone classifiers.
Includes result cacheing, feature normalization, and mapping from feature objects to numerical indices (for external
classifier packages which like that sort of thing)
- Author:
- mpurver
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface edu.stanford.nlp.classify.ClassifierFactory |
trainClassifier |
ExternalClassifierFactory
public ExternalClassifierFactory(String keyStem,
String fileStem)
getTrainCommand
public String getTrainCommand()
- Returns:
- the trainCommand
getClassifyCommand
public String getClassifyCommand()
- Returns:
- the classifyCommand
getFileStem
public String getFileStem()
- Returns:
- the fileStem
isBag
public boolean isBag()
- Returns:
- if true, features are to be specified as a bag of Objects or ScoredObjects; one feature per unique Object
will be created, with its value set as the number of instances of that Object in the bag, or the total
score of the ScoredObject instances. If false, features are to be specified as a list of numerical values
in consistent order. (default false)
setBag
public void setBag(boolean bag)
- Parameters:
bag - if true, features are to be specified as a bag of Objects or ScoredObjects; one feature per unique
Object will be created, with its value set as the number of instances of that Object in the bag, or
the total score of the ScoredObject instances. If false, features are to be specified as a list of
numerical values in consistent order. (default false)
isNormalize
public boolean isNormalize()
- Returns:
- if true, normalize features to the range 0-1
setNormalize
public void setNormalize(boolean normalize)
- Parameters:
normalize - if true, normalize features to the range 0-1