简体   繁体   中英

Watson Assistant Slots: how to allow the user to re-enter data using non-dictionary entities?

I want to capture the following input from the user and am using these entities:

  • First and last names: use sys-person (I extract first and last names later using a cloud action).
  • Email address: use pattern entity, name @contactEmail and value "email" pattern \b[A-Za-z0-9._%+-]+@([A-Za-z0-9-]+.)+[A-Za-z]{2,}\b
  • Mobile Number: use pattern entity, name @contactPhone and value "mobileNumber" pattern ^[1-9][0-9]{7}[0-9]+$

Slots

I created a node with slots:

插槽

The setup is as follows:

Check for:

  • Check for: @sys-person.literal Save it as $person If not present: Type your name
  • Check for: @contactEmail.literal Save it as $email If not present: Type your email
  • Check for: @contactPhone.literal Save it as $contactPhone If not present: Type your mobile.

This all works perfectly and I get the name, email address and Phone number.

The Challenge But I want the user to be able to confirm that the details are correct. So I have an intent called #response_yes which is activated by things like "yes", "yep", etc.

And I have a fourth slot that checks for #response_yes.

  • Check for #response_yes, store the value in $confirmed, if not present ask "Got $person, $contactEmail, $contactPhone is that correct?"

确认

If #response_yes is not found, then it displays the values already typed and asks if they are correct and waits for user input.

After the user has responded, then if the #reponse_yes intent is still not found, then:

重新开始

Respond with, "Let's start again". Also, we need to clear the values already typed:

清除值

Here's where it goes wrong When I try the chatbot, the node collects the input correctly and displays the values correctly and asks if they are correct. I type "no", the #response_no intent is correctly divined and I would expect the prompt for the first slot to show again, but it doesn't.

问题

No matter what I type at that point, the assistant bypasses the top three slots and drops to the fourth one again. It's as if I need to clear the entities, not the variables.

What am I doing wrong? How do I make the top slot work again?!

Aaaaargh.

For anyone who's interested, I simply didn't reset the values to null.

I guess I assumed that leaving the value blank was the same as null. Not so. Once I did this, the system worked perfectly:

将值设置为空!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM