【问题标题】:can slot take entity values without a action function or forms in RASA?插槽可以在 RASA 中采用没有操作功能或表单的实体值吗?
【发布时间】:2023-04-06 12:24:02
【问题描述】:

是否可以将实体中的值传递给插槽而不需要表单或编写动作函数?

nlu.yml

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

domain.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?"

stories.yml

version: "2.0"

stories:

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

调试输出:它识别实体,但值没有传递给槽

嘿!我可以帮助你吗? 您的意见 -> 我想为我的小狗订购大号蓝色鞋

 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

【问题讨论】:

    标签: chatbot rasa rasa-core


    【解决方案1】:

    “slot”是一个未知的关键字。你应该在域文件中写“slots”而不是“slot”,它会起作用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-10
      • 1970-01-01
      • 1970-01-01
      • 2022-01-08
      相关资源
      最近更新 更多