Skip to content

Latest commit

 

History

History
108 lines (80 loc) · 3.76 KB

reference-entity-pattern-any.md

File metadata and controls

108 lines (80 loc) · 3.76 KB
title titleSuffix description ms.author author manager ms.service ms.subservice ms.topic ms.date
Pattern.any entity type - LUIS
Azure AI services
Pattern.any is a variable-length placeholder used only in a pattern's template utterance to mark where the entity begins and ends.
aahi
aahill
nitinme
azure-ai-language
azure-ai-luis
reference
01/19/2024

Pattern.any entity

[!INCLUDE deprecation notice]

Pattern.any is a variable-length placeholder used only in a pattern's template utterance to mark where the entity begins and ends.

Pattern.any entities need to be marked in the Pattern template examples, not the intent user examples.

The entity is a good fit when:

  • The ending of the entity can be confused with the remaining text of the utterance.

Usage

Given a client application that searches for books based on title, the pattern.any extracts the complete title. A template utterance using pattern.any for this book search is Was {BookTitle} written by an American this year[?].

In the following table, each row has two versions of the utterance. The top utterance is how LUIS initially sees the utterance. It isn't clear where the book title begins and ends. The bottom utterance uses a Pattern.any entity to mark the beginning and end of the entity.

Utterance with entity in bold
Was The Man Who Mistook His Wife for a Hat and Other Clinical Tales written by an American this year?

Was The Man Who Mistook His Wife for a Hat and Other Clinical Tales written by an American this year?
Was Half Asleep in Frog Pajamas written by an American this year?

Was Half Asleep in Frog Pajamas written by an American this year?
Was The Particular Sadness of Lemon Cake: A Novel written by an American this year?

Was The Particular Sadness of Lemon Cake: A Novel written by an American this year?
Was There's A Wocket In My Pocket! written by an American this year?

Was There's A Wocket In My Pocket! written by an American this year?

Example JSON

Consider the following query:

where is the form Understand your responsibilities as a member of the community and who needs to sign it after I read it?

With the embedded form name to extract as a Pattern.any:

Understand your responsibilities as a member of the community

"entities": [
  {
    "entity": "understand your responsibilities as a member of the community",
    "type": "FormName",
    "startIndex": 18,
    "endIndex": 78,
    "role": ""
  }

This is the JSON if verbose=false is set in the query string:

"entities": {
    "FormName": [
        "Understand your responsibilities as a member of the community"
    ]
}

This is the JSON if verbose=true is set in the query string:

"entities": {
    "FormName": [
        "Understand your responsibilities as a member of the community"
    ],
    "$instance": {
        "FormName": [
            {
                "type": "FormName",
                "text": "Understand your responsibilities as a member of the community",
                "startIndex": 18,
                "length": 61,
                "modelTypeId": 7,
                "modelType": "Pattern.Any Entity Extractor",
                "recognitionSources": [
                    "model"
                ]
            }
        ]
    }
}

Next steps

In this tutorial, use the Pattern.any entity to extract data from utterances where the utterances are well-formatted and where the end of the data may be easily confused with the remaining words of the utterance.