Interpretation results: Intents

The results returned by NLU include one or more candidate intents that identify the underlying meaning of the user’s input. (They can also include entities and values, described in Interpretation results: Entities) The candidate intents are from the intents defined in your NLU model.

You may request either single-intent interpretation or multi-intent interpretation with InterpretationParameters (interpretation_result_type: SINGLE_INTENT or MULTI_INTENT).

Single intent interpretation

Single-intent interpretation means that NLU returns one intent for the user’s input: the intent that best describes the user’s underlying meaning. NLU may return several candidate intents, but they are listed as alternatives rather than as complementary intents.

Multi-intent interpretation

Multi-intent interpretation requires that your semantic model support this type of interpretation. Currently you cannot create these models in Mix, so the feature is not fully supported, but you may still request multi-interpretation without error. Like single-intent results, multi-intent results contain one best candidate for the user’s input, optionally with alternatives.

True multi-intent results show all the intents contained within the user’s input. These results will be available in an upcoming release.

Examples

This input exactly matches a training sentence for the ASK_JOB intent (notice "origin": GRAMMAR). An alternative intent is proposed but with much lower confidence.

"result": {
  "literal": "Do you have any openings for a pastry chef ?",
  "formatted_literal": "Do you have any openings for a pastry chef ?",
  "interpretations": [
    {
      "single_intent_interpretation": {
        "intent": "ASK_JOB",
        "confidence": 1.0,
        "origin": "GRAMMAR"
      }
    },
    {
      "single_intent_interpretation": {
        "intent": "PLACE_ORDER",
        "confidence": 0.00010213560017291456,
        "origin": "STATISTICAL"
      }
    }
  ]
}

This input is similar to the PLACE_ORDER training sentences (notice "origin": STATISTICAL):

"result": {
  "literal": "I'd like to make an order please",
  "formatted_literal": "I'd like to make an order please",
  "interpretations": [
    {
      "single_intent_interpretation": {
        "intent": "PLACE_ORDER",
        "confidence": 0.9779196381568909,
        "origin": "STATISTICAL"
      }
    }
  ]
}

This result returns the intent PLACE_ORDER along with several entities. See Interpretation results: Entities for more results with entities.

"result": {
  "literal": "I'd like to order a blueberry pie",
  "formatted_literal": "I'd like to order a blueberry pie",
  "interpretations": [{
      "single_intent_interpretation": {
        "intent": "PLACE_ORDER",
        "confidence": 0.9913266897201538,
        "origin": "STATISTICAL",
        "entities": {
          "FLAVOR": {
            "entities": [{
                "text_range": {
                  "start_index": 20,
                  "end_index": 29
                },
                "formatted_text_range": {
                  "start_index": 20,
                  "end_index": 29
                },
                "confidence": 0.8997141718864441,
                "origin": "STATISTICAL",
                "string_value": "blueberry",
                "literal": "blueberry",
                "formatted_literal": "blueberry"
              }
            ]
          },
          "PRODUCT": {
            "entities": [{
                "text_range": {
                  "start_index": 30,
                  "end_index": 33
                },
                "formatted_text_range": {
                  "start_index": 30,
                  "end_index": 33
                },
                "confidence": 0.8770073652267456,
                "origin": "STATISTICAL",
                "string_value": "pie",
                "literal": "pie",
                "formatted_literal": "pie"
              }
            ]
          }
        }
      }
    }
  ]
}

NLU returns two alternative intents for this input, GET_INFO or PLACE_ORDER, both with medium confidence:

"result": {
  "literal": "Can I see a price list and place an order",
  "formatted_literal":"Can I see a price list and place an order"
  "interpretations": [
    {
      "single_intent_interpretation": {
        "intent": "GET_INFO",
        "confidence": 0.563047468662262,
        "origin": "STATISTICAL"
      }
    },
    {
      "single_intent_interpretation": {
        "intent": "PLACE_ORDER",
        "confidence": 0.40654945373535156,
        "origin": "STATISTICAL"
      }
    }
  ]
}

Multi-intent interpretation currently returns information similar to single-intent:

"result": {
  "literal": "Can I see a price list and place an order",
  "formatted_literal": "Can I see a price list and place an order",
  "interpretations": [
    {
      "multi_intent_intepretation": {
        "root": {
          "intent": {
            "name": "GET_INFO",
            "text_range": {
              "end_index": 41
            },
            "formatted_text_range": {
              "end_index": 41
            },
            "confidence": 0.563047468662262,
            "origin": "STATISTICAL"
          }
        }
      }
    },
    {
      "multi_intent_intepretation": {
        "root": {
          "intent": {
            "name": "PLACE_ORDER",
            "text_range": {
              "end_index": 41
            },
            "formatted_text_range": {
              "end_index": 41
            },
            "confidence": 0.40654945373535156,
            "origin": "STATISTICAL"
          }
        }
      }
    }
  ]
}

NO_INTENT and NO_MATCH

An interpretation result may return one of two special intents.

NO_INTENT is returned when the input sentence consists entirely or almost entirely of known entities from your NLU model and does not match with a custom intent from the model. This usually happens for sentence fragments.

NO_MATCH means NLU was unable to match with any intent from the model. This is rarely returned. Usually NLU will match with an intent, even if at a low confidence level. NO_MATCH is generally returned only when the input is empty or gibberish, for example, “asdfghjkl”

{
  "result": {
    "literal": "asdfghjk",
    "interpretations": [
      {
        "singleIntentInterpretation": {
          "intent": "NO_MATCH",
          "confidence": 1,
          "origin": "STATISTICAL"
        }
      }
    ],
    "formattedLiteral": "asdfghjk"
  }
}