Skip to content

Processors

Gwendal Daniel edited this page Oct 14, 2020 · 17 revisions

Xatkit embeds processors, that are additional pieces of logic that can be plugged to tune the intent recognition process. Pre-processors operate on the user input to optimize it before intent extraction (e.g. by adding a question mark at the end of a sentence that is obviously a question). On the other hand, post-processors are designed to operate after the intent recognition process, usually to set additional context parameters (e.g. perform some sentiment analysis, set whether the input is a yes/no question, etc).

Unless explicitly stated in the documentation, Xatkit processors can be used with any intent recognition engine. To integrate Xatkit processors in your bot you need to add the following lines in your bot configuration:

xatkit.recognition.preprocessors  = PreProcessor1, PreProcessor2
xatkit.recognition.postprocessors = PostProcessor1, PostProcessor2

Processors are set using their name (see the table below for the list of processors embedded in Xatkit). Note that each property accepts a list of comma-separated processor names.

📚 You can also directly use the processor class to configure your bot programmatically:

import static com.xatkit.core.recognition.IntentRecognitionProviderFactoryConfiguration.*;
 
[...]

configuration.addProperty(RECOGNITION_PREPROCESSORS_KEY, EnglishSentimentPostProcessor.class.getSimpleName());

Pre-Processors

There is currently no pre-processor in Xatkit

Post-Processors

Name Description Requirements
RemoveEnglishStopWords Removes English stop words from recognized intent's parameter values that have been extracted from any entities. This processor helps normalizing DialogFlow values when using any entities.
IsEnglishYesNoQuestion Sets the context parameter nlp.isYesNo to true if the user input is a yes/no question, and false otherwise This processor requires stanford-core-nlp-full-3.9.2 in the classpath. You can download it on the Stanford NLP page.
EnglishSentiment Sets the context parameter nlp.sentiment to a value in ["Very Negative", "Negative", "Neutral", "Positive", "Very Positive"] corresponding to the sentiment extracted from the user input. This processor requires stanford-core-nlp-full-3.9.2 in the classpath. You can download it on the Stanford NLP page.
Clone this wiki locally