java.io.Serializable
public class NRCHashtagEmotionLexiconEvaluator extends LexiconEvaluator
Constructor | Description |
---|---|
NRCHashtagEmotionLexiconEvaluator(java.lang.String path,
java.lang.String name) |
initializes the Object
|
Modifier and Type | Method | Description |
---|---|---|
java.util.Map<java.lang.String,java.lang.Double> |
evaluateTweet(java.util.List<java.lang.String> words) |
Calculates lexicon-based feature values from a list of tokens
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Double>> |
getDict() |
Gets the dictionary mapping the words to their emotion associations
|
java.util.Map<java.lang.String,java.lang.Double> |
getWord(java.lang.String word) |
Gets the emotions for a word
|
void |
processDict() |
initializes the dictionary
|
getFeatureNames
public NRCHashtagEmotionLexiconEvaluator(java.lang.String path, java.lang.String name)
path
- the file with the lexiconname
- the prefix for all the attributes calculated from this lexiconpublic java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Double>> getDict()
public java.util.Map<java.lang.String,java.lang.Double> getWord(java.lang.String word)
word
- the wordpublic void processDict() throws java.io.IOException
LexiconEvaluator
processDict
in class LexiconEvaluator
java.io.IOException
- in case of wrong filepublic java.util.Map<java.lang.String,java.lang.Double> evaluateTweet(java.util.List<java.lang.String> words)
LexiconEvaluator
evaluateTweet
in class LexiconEvaluator
words
- a tokenized tweet