Pattern.any 實體
重要
LUIS 將於 2025 年 10 月 1 日淘汰,而自 2023 年 4 月 1 日開始,您將無法建立新的 LUIS 資源。 建議移轉 LUIS 應用程式至交談語言理解,以享有產品持續支援和多語言功能的優點。
Pattern.any 是僅用於模式範本語句的可變長度預留位置,用來標記實體開始及結束的位置。
Pattern.any 實體需要在模式範本裡的範例 (而不是意圖裡使用者所提供的範例) 中進行標記。
以下時機適用此實體:
- 實體的結尾可能會與語句的其餘文字混淆。
使用方式
如果用戶端應用程式要根據書名來搜尋書籍,pattern.any 會擷取完整的書名。 為搜尋此書而使用 pattern.any 的範本語句是 Was {BookTitle} written by an American this year[?]
。
下表中,每個資料列都有兩個版本的語句。 最上層表達是 LUIS 起初對表達的觀察。 這時還無法釐清書名的開頭和結尾。 最底層表達會使用 Pattern.any 實體,以標記實體的開頭和結尾。
實體以粗體呈現的表達 |
---|
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? The Particular Sadness of Lemon Cake 是一位美國人在今年寫的小說嗎? |
Was There's A Wocket In My Pocket! written by an American this year? There's A Wocket In My Pocket! 是一位美國人在今年寫的小說嗎? |
範例 JSON
請考慮下列查詢:
where is the form Understand your responsibilities as a member of the community and who needs to sign it after I read it?
其中包含要以 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": ""
}
下一步
在此教學課程中,如果表達已正確格式化,而且資料結尾可能會很容易和表達中的其餘詞彙混淆,請使用 Pattern.any 實體來從表達中擷取資料。