The Interaction API includes multiple default components under the Data-Decision-Request and Data-Decision-Response classes.
These components include the pyInteractionDF data flow, decision strategies, decision tables, and the default pyInteractionTA text analyzer. You can extend these rules to adjust the API to your business needs. For more information, see Extending Interaction API.
The Data-Decision-Request class contains the rules to handle the interaction input. These rules are combined into the pyInteractionDF data flow that drives the Interaction API. This class has the following data model:
Data-Decision-Request data model
|Property name||Mode||String type|
The Data-Decision-Response class contains the rules to handle the interaction output, for example, the outcome of natural language processing and decision results. This class has the following data model:
Data-Decision-Response data model
|Property name||Mode||String type|
|pyDecisionResults||Page List||Page List|
The strategy outcome is captured in the pyDecisionResult property that belongs to the Data-pxStrategyResult class.
pyInteractionDF data flow
The pyInteractionDF data flow performs natural language processing (NLP) through the referenced text analyzer and feeds the outcome to the interaction strategy. When the data is processed, the data flow generates a response as part of the pyNLPOutcome property on the Data-pxStrategyResult page. In addition, the interaction results are recorded as part of the interaction history.
See the following figure for reference:
The pyInteractionDF data flow is customizable and you can adjust its configuration to your business needs. To prevent the interaction history size from becoming too large, the data flow checks whether the record is a result of a simulation run. If true, the data flow prevents the simulation records from being saved in the interaction history.
Next, the data flow filters out all entities. As a result of natural language processing, each record becomes associated with a single value for sentiment (that is, the opinion that is expressed, for example, positive, negative, or neutral) and topic (that is, the talking point). However, the text analyzer can detect multiple entities in each record. Common examples include names of people, emails, postal codes, names of companies, products, and so on. Because of that, such records as emails can contain multiple entities. Therefore, avoid saving entities in the interaction history to prevent any system issues that could be caused by an increased interaction history size.
The pyInteractionStrategy is the top-level decision strategy that is called from the pyInteractionDF data flow. This strategy references the following substrategies:
- This strategy integrates the NLP outcome from the text analyzer that is referenced in the pyInteractionDF data flow with other next-best-action components. As a result of this strategy, the detected topics and entities are put into the pxStrategyResult class.
- This strategy initiates a case type, based on the mapping defined in the pyGetActionFromIVAConfig decision table.
- This strategy presents the next best action, based on natural language processing. You can extend this strategy by importing channel-specific propositions or referencing any of your existing strategies to provide the next best action.
The following figure provides an overview of the strategy structure within the Interaction API:
The pyGetActionStrategy is a strategy that includes the pyGetActionFromIVAConfig decision table. You can use this decision table to map text analyzer topics from the channel configuration to case types, as shown in the following example:
The Command column contains the topics to be detected by the text analyzer. The Return column contains case types names to initiate when the corresponding topic is detected. The NO_COMMAND_FOUND action is returned when no topics that are listed in the decision table were detected. Depending on your business needs, you can customize the pyGetActionStrategy strategy to take action when no topic is detected, for example, by presenting a proposition.
The Interaction taxonomy contains an empty rule-based topic detection model. Populate this model with your topic-keyword configuration or override this model, based on your channel configuration. For more information about how to create a topic detection model, see:
The Interaction API contains a default pyInteractionTA text analyzer rule. You can override this rule through the channel configuration menu to provide channel-specific treatment. This text analyzer rule supports sentiment analysis, topic detection, and text categorization. By default, the pyInteractionTA text analyzer rule performs email parsing. The following figure shows the pyInteractionTA text analyzer configuration in the pyInteractionDF data flow:
When email is the conversational channel, the pxEmailParser text extraction rule identifies such email components as signature, greeting, body, and disclaimer. You can choose what type of analysis to perform on each email component, depending on your business needs, as shown in the preceding example.