csli.util.classify.stanford
Class ExternalClassifier
java.lang.Object
edu.stanford.nlp.classify.Classifier
csli.util.classify.stanford.ExternalClassifier
- Direct Known Subclasses:
- C4_5Classifier, SvmLightClassifier
public abstract class ExternalClassifier
- extends edu.stanford.nlp.classify.Classifier
An extension for the standard Stanford Classifier 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 edu.stanford.nlp.classify.Classifier |
classOf, scoresOf |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExternalClassifier
public ExternalClassifier(String classifyCommand,
String fileStem)
ExternalClassifier
public ExternalClassifier(String classifyCommand,
String fileStem,
HashMap<String,Integer> featureMap,
List<Pair<Double,Double>> normFactors)
getClassifyCommand
public String getClassifyCommand()
- Returns:
- the classifyCommand
setClassifyCommand
public void setClassifyCommand(String classifyCommand)
- Parameters:
classifyCommand - the classifyCommand to set
getFileStem
public String getFileStem()
- Returns:
- the fileStem
setFileStem
public void setFileStem(String fileStem)
- Parameters:
fileStem - the fileStem to set
isResultCacheing
public boolean isResultCacheing()
- Returns:
- true if this classifier caches its scoresOf results
setResultCacheing
public void setResultCacheing(boolean resultCacheing)
- Parameters:
resultCacheing - true if this classifier should cache its scoresOf results, false otherwise
getFeatureMap
public HashMap<String,Integer> getFeatureMap()
getNormFactors
public List<Pair<Double,Double>> getNormFactors()
- Returns:
- the normFactors
getClassResults
public HashMap<edu.stanford.nlp.dbm.Datum,Object> getClassResults()
- Returns:
- the cached class results
getScoreResults
public HashMap<edu.stanford.nlp.dbm.Datum,edu.stanford.nlp.util.Counter<?>> getScoreResults()
- Returns:
- the cached score results
classOf
public Object classOf(edu.stanford.nlp.dbm.Datum example)
- Specified by:
classOf in class edu.stanford.nlp.classify.Classifier
classOf
public <D extends edu.stanford.nlp.dbm.Datum> List<Object> classOf(List<D> examples)
- Overrides:
classOf in class edu.stanford.nlp.classify.Classifier
scoresOf
public edu.stanford.nlp.util.Counter<?> scoresOf(edu.stanford.nlp.dbm.Datum example)
- Specified by:
scoresOf in class edu.stanford.nlp.classify.Classifier
scoresOf
public <D extends edu.stanford.nlp.dbm.Datum> List<edu.stanford.nlp.util.Counter<?>> scoresOf(List<D> examples)
- Overrides:
scoresOf in class edu.stanford.nlp.classify.Classifier