public class EnglishSentimentPostProcessor extends StanfordNLPPostProcessor
The extracted sentiment is one of {Very Negative, Negative, Neutral, Positive, Very Positive}
. This
post-processor sets the context variable nlp.sentiment
with the result of the analysis.
Modifier and Type | Field and Description |
---|---|
protected static String |
DEFAULT_SENTIMENT_VALUE
The default value for the
SENTIMENT_PARAMETER_KEY parameter. |
protected static String |
SENTIMENT_PARAMETER_KEY
The context parameter key used to store the sentiment extracted from the user input.
|
NLP_ANNOTATION_SESSION_KEY, NLP_CONTEXT_KEY, NLP_INPUT_SESSION_KEY
Constructor and Description |
---|
EnglishSentimentPostProcessor()
Constructs an instance of this post-processor.
|
Modifier and Type | Method and Description |
---|---|
com.xatkit.intent.RecognizedIntent |
process(com.xatkit.intent.RecognizedIntent recognizedIntent,
XatkitSession session)
Processes the provided
recognizedIntent and sets the nlp.sentiment context parameter. |
getAnnotation, init
protected static final String SENTIMENT_PARAMETER_KEY
protected static final String DEFAULT_SENTIMENT_VALUE
SENTIMENT_PARAMETER_KEY
parameter.public EnglishSentimentPostProcessor()
This method sets the NLP annotators required to perform the analysis.
public com.xatkit.intent.RecognizedIntent process(com.xatkit.intent.RecognizedIntent recognizedIntent, XatkitSession session)
recognizedIntent
and sets the nlp.sentiment
context parameter.recognizedIntent
- the RecognizedIntent
to processsession
- the XatkitSession
associated to the recognizedIntent
recognizedIntent
Copyright © 2020 SOM Research Lab. All rights reserved.