首页 > 解决方案 > rasa 2.0.2 上未激活表单

问题描述

好的,所以我正在运行 Rasa 2.0.2,每当我尝试激活我的表单时,rasa 似乎无法加载它们。我很确定我的代码运行正常,因为它在 rasa 2.7.0 上运行。另请注意,通过我在网上阅读的一些线程,我知道旧版本的 rasa 需要具有特定命名的 utters,例如:“utter_ask_name”,所以我这样做了,并且插槽也需要像这样命名:“slot_date”。所以我使用了这两种方法,但仍然没有成功。有什么帮助吗?

域.yml:

版本:“2.0”

intents:
- greet
- inform
- subscribe
- bot_challenge
- name
- age
- learn
- book demo
- describe
- describe more
- learn more
- learn less
- date
- time
- firstname
- lastname
- email
- country
- kai101


slots:
  email1:
    type: unfeaturized
    influence_conversation: false
  slot_date:
    type: unfeaturized
    influence_conversation: false
  slot_time:
    type: unfeaturized
    influence_conversation: false
  slot_firstname:
    type: unfeaturized
    influence_conversation: false
  slot_lastname:
    type: unfeaturized
    influence_conversation: false
  slot_email:
    type: unfeaturized
    influence_conversation: false
  slot_country:
    type: unfeaturized
    influence_conversation: false



responses:
  utter_greet:
  - text: |
      Hello & welcome to achatbotAgancy.com! Your one-stop shop to the world of chatbots.
      How may I assist you?
    buttons:
    - title: "Learn about chatbots"
      payload: '/learn'
    - title: "What do you want your chatbot to do? In a few words describe the purpose of your chatbot:"
      payload: '/describe'
    - title: "Book a demo to test drive us"
      payload: '/book demo'

  utter_kuh:
  - text: |
      What is your email address?
  utter_subscribed:
  - text: |
      Check your inbox at {email} in order to finish subscribing to the newsletter!
  - text: You're all set! Check your inbox at {email} to confirm your subscription.
  - text: You've been subscribed, the newsletter will be sent to {email} shotly.
  utter_i_am_a_bot:
  - text: |
      I am a bot powered by RASA
  utter_my_name:
  - text: |
      I am KAI The Chatbot
  utter_my_age:
  - text: |
      I was made on June 2 2021 and I'm still being developed on a regular basis.

  utter_learn:
  - text: |
      A chatbot is a software application used to conduct an on-line chat conversation via text or text-to-speech, in lieu of providing direct contact with a live human agent.
      Did that answer help your question or do need more information?
    buttons:
    - title: "No thank you"
      payload: '/learn less'
    - title: "I am intrested in learning more"
      payload: '/learn more'

  utter_description:
  - text: |
      What do you want your chatbot to do? In a few words describe the purpose of your chatbot:

  utter_description_reply:
  - text: |
      Ah yes, we can definitely help with that. May I book an appointment for you with one of my colleagues?

  utter_book_demo:
  - text: |
      Sure. I will ask one of our humans to reach out. May I know:

  utter_learn_more:
  - text: |
      A chatbot is a software application used to conduct an on-line chat conversation via text or text-to-speech, in lieu of providing direct contact with a live human agent.
      Did that answer help your question or do need more information?
    buttons:
    - title: "No thank you"
      payload: '/learn less'
    - title: "I am intrested in learning more"
      payload: '/learn more'

  utter_learn_less:
  - text: |
      Ok great.Well, I am one message away. Don’t be shy.
  
  utter_learn_more1:
  - text: |
      Sure, I am more than happy to book an appointment for you.

  utter_ask_date:
  - text: |
      May I know the best date that works for you?

  utter_ask_time:
  - text: |
      Great, and what time??

  utter_ask_firstname:
  - text: |
      May I know your first name?

  utter_ask_lastname:
  - text: |
      May I know your last name?

  utter_ask_email:
  - text: |
      May I know your email address?
      
  utter_ask_country:
  - text: |   
      Which country are you in?
    
  utter_done_requesting:
  - text: |   
      Awesome Mr.{slot_firstname} {slot_lastname}, one of my colleagues will contact you shortly on your email {slot_email} to book an appointment on {slot_date} at {slot_time}

actions:
- '...'
- utter_greet
- utter_kuh
- utter_subscribed
- utter_i_am_a_bot
- utter_my_name
- utter_my_age
- utter_learn
- utter_description
- utter_description_reply
- utter_book_demo
- utter_learn_more
- utter_learn_less
- utter_learn_more1
- utter_ask_date
- utter_ask_time
- utter_ask_firstname
- utter_ask_lastname
- utter_ask_email
- utter_ask_country
- utter_done_requesting


forms:
  informative_form:
    required_slots:
      slot_date:
      - type: from_text
      slot_time:
      - type: from_text
      slot_firstname:
      - type: from_text
      slot_lastname:
      - type: from_text
      slot_email:
      - type: from_text
      slot_country:
      - type: from_text



session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true

表格.yml:

 forms:
      informative_form:
        required_slots:
          slot_date:
          - type: from_text
          slot_time:
          - type: from_text
          slot_firstname:
          - type: from_text
          slot_lastname:
          - type: from_text
          slot_email:
          - type: from_text
          slot_country:
          - type: from_text

nlu.yml:

version: "2.0"

nlu:
- intent: greet
  examples: |
    - Hi
    - Hey!
    - Hallo
    - Good day
    - Good morning
    - howdy

- intent: subscribe
  examples: |
    - I want to get the newsletter
    - Can you send me the newsletter?
    - Can you sign me up for the newsletter?
    - Can I  on your mailing list?

- intent: inform
  examples: |
    - My email is example@example.com
    - random@example.com
    - Please send it to anything@example.com
    - Email is something@example.com

- intent: bot_challenge
  examples: |
    - Are you a bot?
    - Am I talking to a human?
    - is this a chatbot?
    - is this a real person?
    - you're a bot, aren't you

- intent: name
  examples: |
    - What's your name?
    - What did they name you??
    - what are you called?
    - What should I call you ?


- intent: learn
  examples: |
    - Learn about chatbots

- intent: describe
  examples: |
    - What do you want your chatbot to do? In a few words describe the purpose of your chatbot:

- intent: describe more
  examples: |
    - I want my chatbot to
    - I want it to do something
    - I want it to be something
    - I want it 
    - To do something
    - want it to be something
    - do something

- intent: book demo
  examples: |
    - Book a demo to test drive us

- intent: learn less
  examples: |
    - No, thank you.

- intent: learn 
  examples: |
    - I am interested in learning more.

- intent: kai101
  examples: |
    - Ask me your questions.
    - Ask me about the form.

- intent: date
  examples: |
    - May 31 1999
    - 31/05/1999
    - July 16 1978
    - 16/07/1978
    - January 4 1974
    - 04/01/1974
    - September 10 2003
    - 10/09/2003

- intent: time
  examples: |
    - 3:00 PM
    - 8:00 AM
    - 16:00
    - 8 in the morning
    - 4 afternoon
    - 12 in the morning
    - 4 in the evening

- intent: firstname
  examples: |
    - Kareem
    - Yehya
    - Mariam
    - Johnny
    - Charbel
    - Nour
    - Hanin
    - Hussein
    - John

- intent: lastname
  examples: |
    - Aridi
    - Abou Dargham
    - Harfouch
    - Abou Dagher
    - Smith
    - Malaeb

- intent: email
  examples: |
    - My email is example@example.com
    - random@example.com
    - Please send it to anything@example.com
    - Email is something@example.com

- intent: country
  examples: |
    - Lebanon
    - USA
    - UAE
    - Palestine
    - Syria
    - Iraq
    - Kuwait
    - United States
    - United Arab Emirates
    - Kuwait
    - Bahrain
    - Saudi Arabia
    - germany

标签: formsrasa

解决方案


我有一些观察可以帮助您找到正确的答案:

  • 您能否提供更多有关您所面临问题的背景信息?你在尝试什么命令,错误堆栈跟踪是什么?rasa shell --debug如果您可以在问题中运行并发布完整的调试日志,将会很有帮助。
  • 如果您在 中指定表格domain.yml,则不需要根据文档拥有单独forms.yml文件
  • 如果您将influence_conversation属性指定为false,则不需要type: unfeaturized特别使用,因为它已被弃用。也许这些都应该是type: text
  • 您如何使用storiesand中的表格rules?你也能分享这些文件的内容吗?formbot示例是一个很好的指导方针。

推荐阅读