| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectemolib.util.proc.TextDataProcessor
emolib.classifier.Classifier
emolib.classifier.machinelearning.LSA
public class LSA
The LSA class is a Latent Semantic Analysis classifier.
It learns the latent semantic space by computing the Singular Value Decomposition (SVD) of the term-class matrix (i.e., constructing a low-rank approximation with its principal eigenvectors). The cosine similarity between the class vectors (right singular vectors) and the query text vectors (obtained by adding the observed term vectors, i.e., the left singular vectors) is used to make decisions in the reduced latent space.
The core implementation of this LSA classifier is based on LingPipe. The same term weighting schemes as the ones used in the ARN-R are considered.
ARNReduced| Constructor Summary | |
|---|---|
| LSA()Main constructor of this LSA classifier. | |
| Method Summary | |
|---|---|
|  java.lang.String | getCategory(FeatureBox inputFeatures)The function that decides the most appropriate emotional category. | 
|  void | load(java.lang.String path)Generic function to load a previously saved classifier. | 
|  void | resetExamples()Method to reset the classifier and flush the training examples. | 
|  void | save(java.lang.String path)Generic method to save the fully fledged classifier into a given file path. | 
|  void | setCOF(boolean cof)Method to consider bigram frequencies. | 
|  void | setPOS(boolean pos)Method to consider POS tags. | 
|  void | setStemming(boolean stems)Method to consider stems. | 
|  void | setSynonyms(boolean syns)Method to consider synonyms. | 
|  void | setTermWeighingMeasure(java.lang.String twm)Method to set the TW method. | 
|  void | simpleClassification()Functionality test. | 
|  void | trainingProcedure()Training method based on the SVD decomposition. | 
| Methods inherited from class emolib.classifier.Classifier | 
|---|
| applyClassification, getData, getListOfExampleCategories, getListOfExampleFeatures, initialize, inputTrainingExample, newProperties, register, train | 
| Methods inherited from class emolib.util.proc.TextDataProcessor | 
|---|
| flush, getName, getPredecessor, setPredecessor, toString | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
|---|
public LSA()
| Method Detail | 
|---|
public java.lang.String getCategory(FeatureBox inputFeatures)
Classifier
getCategory in class ClassifierinputFeatures - The input emotional features.
public void setPOS(boolean pos)
pos - The POS flag.public void setStemming(boolean stems)
stems - The stemming flag.public void setSynonyms(boolean syns)
syns - The synonyms flag.public void trainingProcedure()
trainingProcedure in class Classifierpublic void setTermWeighingMeasure(java.lang.String twm)
twm - The TW method.public void setCOF(boolean cof)
cof - The COF flag.public void save(java.lang.String path)
Classifier
save in class Classifierpath - The file path to save the classifier.public void load(java.lang.String path)
Classifier
load in class Classifierpath - The path of the file which contains the previously saved
 classifier.public void resetExamples()
Classifier
resetExamples in class Classifierpublic void simpleClassification()
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||