| 
 | |||||||||
| 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
public abstract class Classifier
The Classifier abstract class defines the basic methods that any EmoLib classifier should implement in order to provide an affective label.
The Classifier establishes the frontier (interface) between the feature-wise world and the knowledge-wise world. The knowledge may be incorporated in the classifier by means of explicitly hard-coding it into the definition of the classifier, i.e., the expert-based heuristic approach, or by means of automatically learning it from training data, i.e., the data-driven Machine Learning approach.
| Constructor Summary | |
|---|---|
| Classifier()Main constructor of the Classifier. | |
| Method Summary | |
|---|---|
|  void | applyClassification(TextData inputTextDataObject)Method to perform the classification process. | 
| abstract  java.lang.String | getCategory(FeatureBox inputFeatures)The function that decides the most appropriate emotional category. | 
|  Data | getData()Obtains the TextData from the previous module, processes it and makes it available to the rest of the text processing chain. | 
|  java.util.ArrayList<java.lang.String> | getListOfExampleCategories()Retrieves the list of training example categories. | 
|  java.util.ArrayList<FeatureBox> | getListOfExampleFeatures()Retrieves the list of training example features. | 
|  void | initialize()Method to initialize the Classifier. | 
|  void | inputTrainingExample(FeatureBox features,
                     java.lang.String cat)Mehtod to input training data into the classifier. | 
| abstract  void | load(java.lang.String path)Generic function to load a previously saved classifier. | 
|  void | newProperties(PropertySheet ps)This method is called when this configurable component has new data. | 
|  void | register(java.lang.String name,
         Registry registry)Register my properties. | 
|  void | resetExamples()Method to reset the classifier and flush the training examples. | 
| abstract  void | save(java.lang.String path)Generic method to save the fully fledged classifier into a given file path. | 
|  void | train()Method to train the classifier. | 
| abstract  void | trainingProcedure()Generic training procedure. | 
| 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 Classifier()
| Method Detail | 
|---|
public void register(java.lang.String name,
                     Registry registry)
              throws PropertyException
Configurable
register in interface Configurableregister in class TextDataProcessorname - the name of the componentregistry - the registry for this component
PropertyException
public void newProperties(PropertySheet ps)
                   throws PropertyException
Configurable
newProperties in interface ConfigurablenewProperties in class TextDataProcessorps - a property sheet holding the new data
PropertyException - if there is a problem with the properties.
public Data getData()
             throws DataProcessingException
getData in interface DataProcessorgetData in class TextDataProcessorDataProcessingException - If there is a processing error.public void initialize()
initialize in interface DataProcessorinitialize in class TextDataProcessorpublic void applyClassification(TextData inputTextDataObject)
inputTextDataObject - The TextData object to process.public abstract java.lang.String getCategory(FeatureBox inputFeatures)
inputFeatures - The input emotional features.
public void inputTrainingExample(FeatureBox features,
                                 java.lang.String cat)
features - The input emotional features.cat - The category of the input example.public void train()
public abstract void trainingProcedure()
public java.util.ArrayList<FeatureBox> getListOfExampleFeatures()
public java.util.ArrayList<java.lang.String> getListOfExampleCategories()
public void resetExamples()
public abstract void save(java.lang.String path)
path - The file path to save the classifier.public abstract void load(java.lang.String path)
path - The path of the file which contains the previously saved
 classifier.| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||