Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

marf.Classification.Stochastic
Class MaxProbabilityClassifier  view MaxProbabilityClassifier download MaxProbabilityClassifier.java

java.lang.Object
  extended bymarf.Storage.StorageManager
      extended bymarf.Classification.Classification
          extended bymarf.Classification.Stochastic.Stochastic
              extended bymarf.Classification.Stochastic.MaxProbabilityClassifier
All Implemented Interfaces:
marf.Classification.IClassification, marf.Storage.IStorageManager, java.io.Serializable

public class MaxProbabilityClassifier
extends Stochastic

Maximum Probability Classification Module.

Originally came with the LangIdentApp NLP application of Serguei Mokhov. $Id: MaxProbabilityClassifier.java,v 1.19 2005/08/13 23:09:37 susan_fan Exp $

Since:
0.3.0
Version:
$Revision: 1.19 $

Field Summary
protected  java.util.Vector oAvailLanguages
          A collection of available natural languages.
protected  marf.Stats.StatisticalEstimators.StatisticalEstimator oStatisticalEstimator
          Local reference to some instance of a statistical estimator for probability computation.
private static long serialVersionUID
          For serialization versioning.
 
Fields inherited from class marf.Classification.Classification
oFeatureExtraction, oResultSet, oTrainingSet
 
Fields inherited from class marf.Storage.StorageManager
bDumpOnNotFound, iCurrentDumpMode, oObjectToSerialize, strFilename
 
Fields inherited from interface marf.Classification.IClassification
MARF_INTERFACE_CODE_REVISION
 
Fields inherited from interface marf.Storage.IStorageManager
DUMP_BINARY, DUMP_CSV_TEXT, DUMP_GZIP_BINARY, DUMP_HTML, DUMP_SQL, DUMP_XML, MARF_INTERFACE_CODE_REVISION, STORAGE_FILE_EXTENSIONS
 
Constructor Summary
MaxProbabilityClassifier(marf.FeatureExtraction.IFeatureExtraction poFeatureExtraction)
          Implements Classification API.
MaxProbabilityClassifier(marf.Stats.StatisticalEstimators.StatisticalEstimator poStatisticalEstimator)
          NLP constructor that takes directly a statistical estimator.
 
Method Summary
 boolean classify()
          Performs language classification.
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
 void init(marf.Stats.StatisticalEstimators.StatisticalEstimator poStatisticalEstimator)
          Initializes the classifier with all member variables.
 boolean train()
          Performs training of underlying statistical estimator and goes through restore/dump cycle to save the available languages.
 
Methods inherited from class marf.Classification.Stochastic.Stochastic
dump, getResult, restore
 
Methods inherited from class marf.Classification.Classification
getFeatureExtraction, getResultSet, getTrainingSetFilename, setFeatureExtraction
 
Methods inherited from class marf.Storage.StorageManager
backSynchronizeObject, dumpBinary, dumpCSV, dumpGzipBinary, dumpHTML, dumpSQL, dumpXML, enableDumpOnNotFound, getDefaultExtension, getDefaultExtension, getDumpMode, getFilename, restoreBinary, restoreCSV, restoreGzipBinary, restoreHTML, restoreSQL, restoreXML, setDumpMode, setFilename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
For serialization versioning. When adding new members or make other structural changes regenerate this number with the serialver tool that comes with JDK.

Since:
0.3.0.4
See Also:
Constant Field Values

oStatisticalEstimator

protected marf.Stats.StatisticalEstimators.StatisticalEstimator oStatisticalEstimator
Local reference to some instance of a statistical estimator for probability computation.


oAvailLanguages

protected java.util.Vector oAvailLanguages
A collection of available natural languages.

Constructor Detail

MaxProbabilityClassifier

public MaxProbabilityClassifier(marf.Stats.StatisticalEstimators.StatisticalEstimator poStatisticalEstimator)
NLP constructor that takes directly a statistical estimator.


MaxProbabilityClassifier

public MaxProbabilityClassifier(marf.FeatureExtraction.IFeatureExtraction poFeatureExtraction)
Implements Classification API. TODO: fix setting of data memvers as in MaxProbabilityClassifier(StatisticalEstimator).

Method Detail

init

public void init(marf.Stats.StatisticalEstimators.StatisticalEstimator poStatisticalEstimator)
Initializes the classifier with all member variables.


train

public boolean train()
              throws marf.Classification.ClassificationException
Performs training of underlying statistical estimator and goes through restore/dump cycle to save the available languages. Implements Classification API.

Specified by:
train in interface marf.Classification.IClassification
Overrides:
train in class Stochastic

classify

public boolean classify()
                 throws marf.Classification.ClassificationException
Performs language classification. Implements Classification API.

Specified by:
classify in interface marf.Classification.IClassification
Overrides:
classify in class Stochastic

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Retrieves class' revision.