Rewrite utterance task

When users chat with your chatbot, they may send questions that are difficult to match using NLP, such as questions that:

  • Are very long and contain irrelevant detail.
  • Are incoherent or lack context.
  • Contain spelling or grammatical errors or incorrect auto-corrections.

Your chatbot has a Fallback for long utterances to ask users to rephrase very long utterances, but rephrasing a response can be frustrating for the chatbot user, and even a short question may be difficult to match if it is poorly phrased.

The rewrite utterance task rephrases the user's utterance to make it easier to find an NLP match. It may:

  • Rephrase long utterances to be more concise.
  • Correct spelling and grammatical errors or incorrect auto-corrections.
  • Adjust the terminology to be closer to your chatbot's context.

You can control when an utterance is rephrased based on its length and whether the chatbot could confidently match it to an NLP question.

The rewrite utterance task is in the TrueIntent usage. You need an administrator or publisher role in your team to create a usage.

By default, new usages you create are set as the primary usage (the usage the chatbot will use). You can create a usage without setting it as primary if you need to.

When you create the TrueIntent usage, the rewrite utterance task is disabled. Disabled tasks won't appear in your live chatbot, but you can still configure and test them using automated tests. When you're ready to use the rewrite utterance task in your live chatbot, enable the task and publish the change.

When editing tasks and usages, check the top of the usage page to see if it is the primary usage and whether your changes must be published to take effect. If there is no message indicating your changes must be published, then the changes are applied immediately and will not appear in versions.

The rephrased question will not be visible to your chatbot users but may impact their experience when the chatbot is matching their questions, so you should test your changes thoroughly before you publish. You can create an automated test to test your prompt against a variety of utterances and generate improvements.

You can also test the task by asking questions in the Test Bot once the task is enabled. Questions that have been rephrased are shown in the test bot logs as LLM Action: Changed input into: with the generated result. The rewrite utterance task is not used during regression tests.

To create usages and configure tasks, you must have:

  • Generative AI configurations enabled for your chatbot by inGenious AI support.
  • A connector to power the task. 
    You can see the list of connectors that support the task when you create the usage.

To create a TrueIntent usage and configure the rewrite utterance task:

  1. Click Manage in the left navigation, then click LLM Usages
  2. Click + LLM Usage.
  3. In the Type field, select TrueIntent.
  4. Optionally, edit the Name for the usage.
  5. If you don't want the chatbot to use this task yet, clear the Set As Primary checkbox.
  6. Select the Connector to use for the task or select Create compatible Connector to create a new connector.
    Only compatible connectors will be available.
    You must have an administrator role in your team to create connectors.
  7. Click Create.
  8. Leave the Enable Rewrite Utterance field unselected for now.
    You can configure the task and test it in automated tests without enabling it.
    You'll need to enable the task if you want to test it in TestBot. 
    The task won't run in your live chatbot until you've enabled it and published that change.
  9. By default, the inGenious AI platform waits a maximum of 5 seconds for the model to generate a result. If it doesn't receive a result within that time, it starts the passage that matches the chatbot users's original utterance. 
    If you want to change this period:
    1. Expand the Timeout section.
    2. Update the number of seconds the inGenious AI platform will wait.
  10. If you want to edit the default prompt used to rewrite the utterance, type any edits into the Prompt area.
    Make sure you don't delete the prompt variables: ${userQuestion} and ${chatHistory}.
  11. If you want to include the transcript of the chat for context, select Populate ${chatHistory}.
    If this field is not selected, the ${chatHistory} prompt variable is blank.
  12. Set the Minimum and Maximum length of utterances that the chatbot is permitted to rephrase.
    These thresholds override your chatbot's Long utterance fallback settings
    Utterances longer than the Maximum will trigger the chatbot's Long utterance fallback passage.
  13. If you want to always rephrase utterances over a certain length, select Longer than x words and set the number of words in the task's Long utterance threshold that appears:

    • Utterances between the Minimum and the task's Long utterance threshold will be rephrased if the conditions are met.
    • Utterances between the task's Long utterance threshold and the Maximum will be rephrased regardless of your Matching conditions.

    If you leave longer than x words unselected, the chatbot will only rephrase utterances if they are between the Minimum and Maximum and the matching conditions are met.
    See Control when TrueIntent runs.

  14. In the Match the following conditions section, select when to rephrase utterances that are between the Maximum and Minimum:

    • Before keyword matching.
    • After keyword matching, but before NLP matching.
    • After keyword and NLP matching but only if the NLP match had a low confidence.
      If you select this option:
      1. Set the NLP confidence threshold.
        The chatbot will rephrase an utterance if its NLP match is below this confidence score.
      2. If you want the chatbot to always use whichever NLP match had higher confidence, select Always use the match with higher NLP confidence.
        If this field is not selected, the chatbot uses the rephrased utterance match.

    This setting can impact the accuracy of your Keyword and NLP matches, and how long it takes your chatbot to match a question.
    See Control when utterances are rewritten.

  15. Click Save.

Enable rewrite utterance

The rewrite utterance task is only available to your live chatbot once you've enabled the task and published the change. To enable the task: 

  1. Click Manage in the left navigation, then click LLM Usages.
  2. Click the primary TrueIntent usage.
    Only the task from the primary usage will be used.
  3. Click Enable Rewrite Utterance.
  4. Click Save.

You must publish the change for it to take effect.

Was this article helpful?
0 out of 0 found this helpful