background
Due to the needs of business, we built a user application program based on command, so that users can access the corresponding business system by command, query relevant data. For example, /GetTradeStatus 123456 HK when the user calls the above command, the system will return the trade data identified as 123456 in the HK area.
The problem
However, these commands are currently ‘hard-coded’ based on business needs and cannot be easily extended to suit business needs. For example, when a user queries by the time of transaction, we must add a new parameter to the command to accept the transaction time and filter it in the business logic based on the incoming time.
thinking
Has it ever happened to you that if I had a customer service robot, she could be trained to take specific questions from users for a defined purpose? And you can set the query entities that you accept, such as the transaction identifier, region or even time. Then the system knows the user’s intention and calls the specific system structure to calculate, and finally returns the user’s system data. Here, the robot can identify the real intention of the user through training, and the information collected can also be set dynamically.
The solution
Ok, let’s now build our first chatbot using Google’s Dialagflow and see how it solves our problem.
- First, we need to define a user intent. For example, here we send a command to the user to query the transaction, and receive the user to query according to the transaction identifier and region
Then define what we reply to when we recognize the command
Finally, we can test the chatbot.
So far, we have completed the first chatbot, which can accept different parameters according to the user’s intention set by us. After training, it can recognize the user’s instructions and reply to the user’s content set by us. What’s more, it was all scalable, and we did it in 30 minutes.