使用模式來區分類似的表達

已完成

在某些情況下,模型可能包含多個表達類似的意圖。 您可以使用表達模式來區分意圖,同時將表達範例的數目降至最低。

例如,請參考下列表達:

  • "Turn on the kitchen light" (把廚房的燈打開)
  • "Is the kitchen light on?" (廚房的燈亮了嗎?)
  • "Turn on the kitchen light" (把廚房的燈關了)

這些表達在語法上類似,只有字組或標點符號上有些差異。 不過,這些表達代表三個不同的意圖 (可以命名為 TurnOnDeviceGetDeviceStatusTurnOffDevice)。 此外,意圖也可以套用至範圍廣泛的實體值。 除了「廚房的燈」之外,此意圖也可以套用至「客廳的燈」、「電視」或任何其他可能需要模型支援的裝置。

若要正確定型模型,請提供指定不同表達格式之各個意圖的多個範例。

  • TurnOnDevice
    • "Turn on the {DeviceName}" (開啟 {DeviceName})
    • 「切換 {DeviceName}」
    • "Turn the {DeviceName} on" (把 {DeviceName} 打開)
  • GetDeviceStatus
    • "Is the {DeviceName} on[?]" ({DeviceName} 開啟了嗎?)
  • TurnOffDevice
    • "Turn the {DeviceName} off" (把 {DeviceName} 關閉)
    • "Switch off the {DeviceName}" (關上 {DeviceName})
    • "Turn off the {DeviceName}" (關閉 {DeviceName})

當您使用各種不同類型的表達教導模型時,Azure AI 語言服務會學習如何根據格式和標點符號正確分類意圖。