簡體   English   中英

插槽可以在沒有動作函數或 RASA 形式的情況下采用實體值嗎?

[英]can slot take entity values without a action function or forms in RASA?

是否可以將實體中的值傳遞給插槽而不使用表單或編寫操作函數?

文件名

nlu:
- intent: place_order
  examples: |
    - wanna [large](size) shoes for husky
    - need a [small](size) [green](color) boots for pupps
    - have [blue](color) socks
    - would like to place an order

- lookup: size
  examples: |
    - small
    -medium
    -large

- synonym: small
  examples: |
    - small
    - s
    - tiny
- synonym: large
  examples: |
    - large
    - l
    - big

- lookup: color
  examples: |
    - white
    - red
    - green

域名.yml

version: "2.0"

intents:
  - greet
  - goodbye
  - affirm
  - deny
  - mood_great
  - mood_unhappy
  - bot_challenge
  - place_order

entities:
  - size
  - color

slot:
  size:
    type: text
  color:
    type: text

responses:
  utter_greet:
  - text: "Hey! can I assist you ?"

  utter_order_list:
  - text : "your order is {size} [color} boots. right?"

故事.yml

version: "2.0"

stories:

- story: place_order
  steps:
  - intent: greet
  - action: utter_greet
  - intent: place_order
  - action: utter_order_list

調試輸出:它識別 entity ,但該值未傳遞給 slot

嘿! 我可以幫助你嗎? 您的輸入 -> 我想為我的小狗訂購大號藍色鞋子

 Received user message 'I would like to place an order for large blue shoes for my puppy' with intent '{'id': -2557752933293854887, 'name': 'place_order', 'confidence': 0.9996021389961243}' and entities '[{'entity': 'size', 'start': 35, 'end': 40, 'confidence_entity': 0.9921159148216248, 'value': 'large', 'extractor': 'DIETClassifier'}, {'entity': 'color', 'start': 41, 'end': 45, 'confidence_entity': 0.9969255328178406, 'value': 'blue', 'extractor': 'DIETClassifier'}]'

 Failed to replace placeholders in response 'your order is {size} [color} boots. right?'. Tried to replace 'size' but could not find a value for it. There is no slot with this name nor did you pass the value explicitly when calling the response. Return response without filling the response

“slot”是一個未知的關鍵字。 你應該在域文件中寫“slots”而不是“slot”,它會起作用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM