public class IsEnglishYesNoQuestionPostProcessor extends StanfordNLPPostProcessor
This post-processor sets the context variable nlp.isYesNo
that contains a boolean value.
The analysis of the input is performed using POS tagging with constituent labelling.
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DEFAULT_IS_YES_NO_VALUE
The default value of the
IS_YES_NO_PARAMETER_KEY parameter. |
protected static String |
IS_YES_NO_PARAMETER_KEY
The context parameter key used to store whether the user input is a yes/no question.
|
NLP_ANNOTATION_SESSION_KEY, NLP_CONTEXT_KEY, NLP_INPUT_SESSION_KEY
Constructor and Description |
---|
IsEnglishYesNoQuestionPostProcessor()
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.isYesNo context parameter. |
getAnnotation, init
protected static final String IS_YES_NO_PARAMETER_KEY
protected static final boolean DEFAULT_IS_YES_NO_VALUE
IS_YES_NO_PARAMETER_KEY
parameter.public IsEnglishYesNoQuestionPostProcessor()
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.isYesNo
context parameter.
This method sets the nlp.isYesNo
context parameter to true
if the provided recognizedIntent
's input is a yes/no question, and false
otherwise.
Note: nlp.isYesNo == false
does not mean that the provided input is not a yes/no question, but
that it could not be matched to the yes/no patterns supported by this processor.
recognizedIntent
- the RecognizedIntent
to processsession
- the XatkitSession
associated to the recognizedIntent
recognizedIntent
Copyright © 2020 SOM Research Lab. All rights reserved.