Variable answers using Code and Rule cells
Last updated
Last updated
With Syntphony CAI, it is possible to predict in your flow different responses for the same Intent. The mechanism can be very useful in several use cases in dialogs.
For example, in the dialog below:
User message: What are the required documents to open a bank account?
Virtual agent answer 1: I am glad to know that you want to open an account at Bank XYZ! The documents required are ID, proof of residence, proof of income, and an up-to-date photo.
Now, imagine that the user spends some time talking to the virtual agent and repeats the same question. In this case, the virtual agent can vary the answer, for example:
Virtual agent answer 2: I’ve got it! No problem, I can give you the information again ;-) The required documents are ID, proof of residence, proof of income, and an up-to-date photo.
There are two types of Variable Answers:
I) Sequential: as the name suggests, it delivers the answers in sequence, from the first predicted answer to the last one.
To create them, you need to create a Code cell and a Rule cell for each answer, as illustrated in the image below:
In cases of sequential answers, the code in the Code cell will always be:
For example, if three (3) sequential answers are predicted, the code will be:
If eleven (11) sequential answers are predicted, the code will be:
And the Rule cell codes will vary in this way:
For the first answer:
For the second answer:
If you want to add other answers, simply change the number in the code (2 for the third answer, 3 for the fourth answer, 4 for the fifth answer, and so on).
II) Random: Also as the name suggests, it delivers answers randomly. To create them, you need to create a Code cell and a Rule cell for each answer, as illustrated in the image below:
In cases of random answers, the code in the Code cell will always be:
For example, if three (3) random answers are predicted, the code will be:
If eleven (11) random answers are predicted, the code will be:
And the codes in the Rule cells will vary like this:
For the first answer
For the second answer
If you want to add other answers, simply change the number in the code (2 for the third answer, 3 for the fourth answer, 4 for the fifth answer, and so on).
Tip: Using this same method, you can also perform A/B Tests
In this case, the code cell will always be:
The rule cell codes, on the other hand, will be:
Answer A
Answer B
To get the metrics of which answer did better, you need a webhook. There are two alternatives: Either predict a transactional answer (with webhook) on each response that will be evaluated or provide a Service cell in the flow.