emolib.eks.anlw
Class EmotionalKeywordSpotterANLW

java.lang.Object
  extended by emolib.util.proc.TextDataProcessor
      extended by emolib.eks.EmotionalKeywordSpotter
          extended by emolib.eks.anlw.EmotionalKeywordSpotterANLW
All Implemented Interfaces:
Configurable, DataProcessor

public class EmotionalKeywordSpotterANLW
extends EmotionalKeywordSpotter

The EmotionalKeywordSpotterANLW class performs the Emotional Keyword Spotting (EKS) process using the Affective Norms Language Words (ANLW) dictionary.

This class accepts a configuration parameter that indicates the absolute path of the location of an ANLW dictionary in the file system of the user's computer. Since these dictionaries have the same structure, the term Language has been introduced to wrap English and Spanish.

ANLW contains 1034 stemmed words evaluated for the three emotional dimensions: valence, activation and control. These evaluations range from 0 to 10 in this work. Also, the words are grammatically labelled in order to disambiguate the cases where conflation occurs. In this case, the weight configuration parameter determines the amount of contribution that, despite the conflation, is allowed in the affect computation.

The dictionary is first loaded into the system to then be used to map the incoming stemmed words to the word stems that contains, thus extracting the emotional dimensions and enabling the rest of the system to compute the general affect being expressed. If the stemmed words matched correspond to synonyms of the original word, then a weighting parameter is allowed through the configuration file.

If for the word in question, despite having emotional content, no appropriate emotional dimensions are found, then a default neutral value is assigned to each of the dimensions. This value corresponds to a parameter available through the configuration file.

Author:
Alexandre Trilla (atrilla@salle.url.edu)

Field Summary
static java.lang.String PROP_CONFLATION_WEIGHT
           
static java.lang.String PROP_DICTIONARY
          The name of the property indicating the location of the ANLW dictionary.
static java.lang.String PROP_SYNONYMS_WEIGHT
           
static java.lang.String PROP_WORD_NOT_FOUND
           
 
Constructor Summary
EmotionalKeywordSpotterANLW()
          Main constructor of the EmotionalKeywordSpotterANLW.
 
Method Summary
 void applyEKS(TextData inputTextDataObject)
          Method to perform the EKS process.
 void initialize()
          Method to initialize the EmotionalKeywordSpotterANLW.
 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.
 
Methods inherited from class emolib.eks.EmotionalKeywordSpotter
getData
 
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
 

Field Detail

PROP_DICTIONARY

public static final java.lang.String PROP_DICTIONARY
The name of the property indicating the location of the ANLW dictionary.

See Also:
Constant Field Values

PROP_CONFLATION_WEIGHT

public static final java.lang.String PROP_CONFLATION_WEIGHT
See Also:
Constant Field Values

PROP_SYNONYMS_WEIGHT

public static final java.lang.String PROP_SYNONYMS_WEIGHT
See Also:
Constant Field Values

PROP_WORD_NOT_FOUND

public static final java.lang.String PROP_WORD_NOT_FOUND
See Also:
Constant Field Values
Constructor Detail

EmotionalKeywordSpotterANLW

public EmotionalKeywordSpotterANLW()
Main constructor of the EmotionalKeywordSpotterANLW.

Method Detail

register

public void register(java.lang.String name,
                     Registry registry)
              throws PropertyException
Description copied from interface: Configurable
Register my properties. This method is called once early in the time of the component, shortly after the component is constructed. This component should register any configuration properties that it needs to register. If this configurable extends another configurable, super.register should also be called

Specified by:
register in interface Configurable
Overrides:
register in class EmotionalKeywordSpotter
Parameters:
name - the name of the component
registry - the registry for this component
Throws:
PropertyException

newProperties

public void newProperties(PropertySheet ps)
                   throws PropertyException
Description copied from interface: Configurable
This method is called when this configurable component has new data. The component should first validate the data. If it is bad the component should return false. If the data is good, the component should record the the data internally and return true.

Specified by:
newProperties in interface Configurable
Overrides:
newProperties in class EmotionalKeywordSpotter
Parameters:
ps - a property sheet holding the new data
Throws:
PropertyException - if there is a problem with the properties.

initialize

public void initialize()
Method to initialize the EmotionalKeywordSpotterANLW.

Specified by:
initialize in interface DataProcessor
Overrides:
initialize in class EmotionalKeywordSpotter

applyEKS

public void applyEKS(TextData inputTextDataObject)
Method to perform the EKS process. If the word stem of the affective dictionary is produced by the same POS as the word in question, the emotional dimentions are direct, otherwise they are weighed due to the conflation effect.

Specified by:
applyEKS in class EmotionalKeywordSpotter
Parameters:
inputTextDataObject - The TextData object to process.