Teacher Gavin's Transformer Live Lessons - Rasa Dialogue Robot Debugging Project Actual E-commerce Retail Dialogue Robot Running Process Debugging Demonstration (79)

   This article continues to focus on Rasa, an industrial-level business dialogue platform and framework, to analyze the problems that occur during the operation of the Rasa project's e-commerce retail customer service intelligent business dialogue robot, and use the Rasa interactive mode to demonstrate how to step-by-step debugging and solving problems.

1. The operation process of the Rasa project's e-commerce retail Customer Service intelligent business dialogue robot and the whole process demonstration of project bug debugging

  1. Use Rase shell --debug mode to test e-commerce retail Customer Service projects and think about bugs

Run the command rasa shell --debug to start the Rasa server in debug mode:

Run the command rasa run actions –debug to start the action server:

Continue to check product inventory status:

The feedback received is as follows:

From the above information, although the previous user input information has stated that the size is 8, the dialogue robot still requests the size, indicating that the dialogue robot may not correctly extract the entity information about the size, check the output information, and find that the size information has been extracted correctly. But there is no value set in slot "size":

Continue to enter size information:

When entering size directly, slot "size" is correctly filled with values:

It means that there is a bug in the filling of slot "size", and it cannot be automatically filled to "size" according to the extracted entity value.

 2. Use Rasa Interactive to try to fix project bugs

For the bug that the slot "size" is not correctly filled in the above bug, run the command rasa interactive to start the interactive mode to debug:

The Rasa server is started and enters the dialog interactive mode:

In addition to helping locate problems, Rasa interactive mode can also correct for unexpected dialog prediction behavior.

Enter the information, and then according to the feedback, you can see that the value of size is correctly extracted:

Enter Yes to continue execution. According to the output information, you can see that the value of slot "size" is None, indicating that the extracted value is not filled into this slot:

Since the action to be performed by the dialog bot is not expected, enter No:

At this time, the dialogue robot gives the following action list:

We expect to execute form "product_stock_form", so select this form to execute:

You can see that requested_slot is "size"

Enter size information:

Confirm that the intent is correctly identified, enter Yes to continue execution, and you can see that the slot "size" has been correctly filled with the value:

Continue to execute the form "product_stock_form", then you can see that the requested_slot is "color", and the dialog robot asks the user to enter the product color information:

Enter the information and you can see that the color entity information is correctly extracted:

Enter Yes to confirm to continue execution. From the output information, you can see that the slots "color" and "size" have been filled correctly:

Enter Yes to confirm running the form "product_stock_form", you can see that since the information required by this form has been collected, set the active_loop to null to make the form inactive:

Execute the microservice action "action_product_search" according to the prompt, and you can see that the query result is returned:

You're in luck! We have those in stock.

Note that the previously populated slots "color" and "size" are reset to None, ready for the next query:

Finally run the form "survey_form" and select rating option 5:

The output information is as follows:

 3. Adjust the slot configuration test and analyze the problem solution

Check the slot mapping in the domain.yml file:

It can be found that the filling of the slot "size" must satisfy the condition that the form "product_stock_form" is activated, but from the definition of the rule, the form is not activated when the intent is identified as "product_stock".

You can adjust the size of the mappings, as shown in the figure below, copy the original mapping to add a mapping, and then specify the intent: product_stock in the conditions of the new mapping, so that when the intent is identified, the extracted entity will be The value of is mapped into slot "size".

Save the training data:

Guess you like

Origin blog.csdn.net/m0_49380401/article/details/123673997