|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmarf.Storage.StorageManager
marf.Classification.Classification
marf.Classification.Stochastic.Stochastic
marf.Classification.Stochastic.MaxProbabilityClassifier
public class MaxProbabilityClassifier
Maximum Probability Classification Module.
Originally came with the LangIdentApp NLP application
of Serguei Mokhov.
| Field Summary | |
|---|---|
protected java.util.Vector |
oAvailLanguages
A collection of available natural languages. |
protected StatisticalEstimator |
oStatisticalEstimator
Local reference to some instance of a statistical estimator for probability computation. |
| Fields inherited from class marf.Classification.Classification |
|---|
adFeatureVector, 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(IFeatureExtraction poFeatureExtraction)
Implements Classification API. |
|
MaxProbabilityClassifier(StatisticalEstimator poStatisticalEstimator)
NLP constructor that takes directly a statistical estimator. |
|
| Method Summary | |
|---|---|
void |
backSynchronizeObject()
Add a piece of general StorageManager contract. |
boolean |
classify()
Performs language classification. |
void |
dump()
An object must know how dump itself or its data structures to a file. |
static java.lang.String |
getMARFSourceCodeRevision()
Retrieves class' revision. |
void |
init(StatisticalEstimator poStatisticalEstimator)
Initializes the classifier with all member variables. |
void |
restore()
An object must know how restore itself or its data structures from a file. |
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 |
|---|
classify, getResult, train |
| Methods inherited from class marf.Classification.Classification |
|---|
clone, getFeatureExtraction, getResultSet, getTrainingSetFilename, loadTrainingSet, setFeatureExtraction |
| Methods inherited from class marf.Storage.StorageManager |
|---|
dumpBinary, dumpCSV, dumpGzipBinary, dumpHTML, dumpSQL, dumpXML, enableDumpOnNotFound, equals, getDefaultExtension, getDefaultExtension, getDumpMode, getFilename, getObjectToSerialize, hashCode, restoreBinary, restoreCSV, restoreGzipBinary, restoreHTML, restoreSQL, restoreXML, setDumpMode, setFilename, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected StatisticalEstimator oStatisticalEstimator
protected java.util.Vector oAvailLanguages
| Constructor Detail |
|---|
public MaxProbabilityClassifier(StatisticalEstimator poStatisticalEstimator)
poStatisticalEstimator - statistical estimator to usepublic MaxProbabilityClassifier(IFeatureExtraction poFeatureExtraction)
poFeatureExtraction - FeatureExtraction module reference| Method Detail |
|---|
public void init(StatisticalEstimator poStatisticalEstimator)
poStatisticalEstimator - statistical estimator to use
java.lang.IllegalArgumentException - if poStatisticalEstimator is null
public boolean train()
throws ClassificationException
train in interface IClassificationtrain in class Classificationtrue
ClassificationException - should there be a problem with dump/restoreTrainingSet
public boolean classify()
throws ClassificationException
classify in interface IClassificationclassify in class Classificationtrue if classification was successful
ClassificationException - if there was a problem with I/O
or if there are no available languagesIClassification.classify()public void backSynchronizeObject()
backSynchronizeObject in class StorageManagerStorageManager.restore()
public void dump()
throws StorageException
DUMP_GZIP_BINARY and DUMP_BINARY modes.
dump in interface IStorageManagerdump in class ClassificationStorageException - if saving to a file for some reason fails or
the dump mode set to an unsupported valueStorageManager.dumpGzipBinary(),
StorageManager.dumpBinary(),
backSynchronizeObject()
public void restore()
throws StorageException
restore*() methods based on the current dump mode.
restore in interface IStorageManagerrestore in class ClassificationStorageException - if loading from a file for some reason fails or
the dump mode set to an unsupported valueIStorageManager.DUMP_GZIP_BINARY,
IStorageManager.DUMP_BINARY,
StorageManager.dumpGzipBinary(),
StorageManager.dumpBinary(),
backSynchronizeObject(),
StorageManager.iCurrentDumpModepublic static java.lang.String getMARFSourceCodeRevision()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||