Once we’re done analyzing the problem, William came up with the design, and I came up with the engineering architecture. The bot uses a combination of rule-based and NLP to guess what the user needs, and responds accordingly giving links or informations needed to help them.
This is done by downloading the entire dataset of the customer service chat. And for each chat log, I label the message as one of the 6 issues that the bot handles. This is not done manually of course, there are some tags in the chat log that can be leveraged. Once the data are labeled, I cleaned the dataset by taking out private data and unnecessary words. Then I trained a model to recognize the chat words with the issues as the label. This way when a user reach out to the bot’s messenger with a phrase like “A merchant charged me the wrong amount” the model could guess that it’s likely to be a dispute issue.
The hardest part building this is to design ambiguous cases, for example cases like when the user came with “I don’t recognize this transaction” could lead to multiple potential outcomes. The user account could have been hacked, or it could be an error from the merchant. But then we solve this by introducing tree-based logic in the bot’s algorithm. This means that when the bot arrived at this kinds of ambiguity, it should be smart enough to ask for more clarification such as “were you initiate this transaction?” or “do you recognize the merchant?” which could lead the user to one solution.