July 17th, 2017
Building with Rasa: Yellow Pages Canada Chatbot
Rasa
Interested in chatbots, NLU & conversational AI? Join our community chat!
Nathan Zylbersztejn helps companies to make the most out of conversational interfaces. He told us about how he used Rasa NLU framework to build Yellobot, a chatbot for Yellow Pages Canada. Read on to find out more about his project, and check out Rasa NLU on GitHub & Gitter.
Hi Nathan, tell us a little bit about yourself.
I am a software engineer, my primary background is economics. I worked in communications and film production before I realized that software is my favorite creation tool. I now do consulting (Mr. Bot) and help companies to figure out how to get the most out of conversational interfaces. Every problem resolution starts with a good conversation :)
What project did you work on using rasa_nlu?
I use Rasa to parse search queries in the Yellow Pages Canada chatbot. People ask questions like "find me a good plumber in Verdun" or "where is the nearest bar" - and come up with new ways to formulate the same questions every day.
We started with Wit.ai but we decided that we would build a service that could eventually scale to other services using search engine. We estimated that the max load on the search API was 1000 requests per seconds, so we needed an on premise solution. I ran a stress test on a Macbook Pro at 1000 rps, and even if the fans were spinning like crazy, Rasa handles it just fine.
At the same time, Rasa was becoming more mature, it was supporting synonyms which was essential, and duckling support was in the works. So I gave it a try. I submitted a couple of issues (I was working with the dev version, not the released one) and I was impressed by how the team took them seriously and solved them. I understood then it was a serious product and I suggested it to my client over other SaaS solutions.
What was the most interesting and challenging part of the project?
The interesting and challenging part was using synonyms. Several cities or neighborhoods have the same name. If you're looking for an electrician in Westmount, you could be looking in 6 different Canadian provinces.
To facilitate disambiguation, I wanted Rasa to return an array of all possible cities in the most explicit format for the API. For ex: ["Westmount, Montreal, QC", "Westmount, West Vancouver, BC",...].
That is how I used synonyms: "Westmount" is the synonym of the whole stringified array of Wesmount's. Then I wrote an emulator to return the array as an object (an not a stringified array).
How did you go about training data?
I mostly generated it as we didn't have any data. I used templates like "Need a {what}
in {where}
" and filled them with common search queries and all our Canadian cities and neighbourhoods. To get the synonyms trick to work I needed to make sure every city was at least in one example.
What do you think about the future of chatbots / NLU technology in general?
I think their near future lies in areas where they help solve a bigger problem and automate high costs / low value work flows. One obvious example is the first line customer service, or asking background questions to a patient in a clinic or a pharmacy.
Another good use case is when the UI is unnatural. I think it's easier to say a date/time than picking it on a calendar. Data manipulation ("Show me the nearest bar open tonight") is also easier and more intuitive than filtering a table or a result set. The big question for me is where those conversation will be hosted (Messenger, web, native apps, voice, or even something new?)
Thanks Nathan!
Interested in conversational software, natural language processing & building chatbots? Join the Rasa community on Gitter!