3 ms·
In this case, why even use api.ai? The sample cases seems very simple to just do some basic regexp instead? I've done my own Raspberry "bot" using speak synthe
by nergal 9y ago
In this case, why even use api.ai? The sample cases seems very simple to just do some basic regexp instead?
I've done my own Raspberry "bot" using speak synthesizer and STT and some basic plain ruby. Using regexp it handles _a_lot_ of scenarios just by simple regexp for words such as "rain", "weather" (which then is enough to understand that I'm asking for the weather). Combined with "today" or "tomorrow" it can tell weather at different times.
I was also intrigued by using api.ai in my case but It just felt overkill.
(Perhaps I've just missed the whole point here).
- aravind_mc 9y agoI will make the disclaimer that I don't think I am an "expert", but I do some coaching for API.AI and have been helping a couple of clients build out simple chatbots. I keep hearing this question a lot, and I think right now the best way to teach chatbot programming seems to be by using the simplest examples and this is a little misleading (is that all?). You can use regexp to build out a chatbot, but it might be a good idea to consider some pros/cons of using a service like API.AI. Under the hood, API.AI (and similar bot programming frameworks) allow you to go much further: 1. Their entity matching system will let you start with a few examples and then keep matching many more similar examples (remember Google Sets?) without you explicitly defining every single one of them. The best example for this seems to be the food/recipe & geographical locations stuff for now, but if they can get it right for more domains that can be quite useful. 2. There is a way to use templated definitions of "here is what the user might say" which is quite powerful. Sure, you could probably do the same yourself, but think about it: you will be handling so many corner cases with such a system that if there were a prebuilt service already doing that work for you (and which is improving quite rapidly) you could probably build it out faster with the external service. 3. There is also enough flexibility where you can add webhooks (like the author has done) and basically put a lot of business logic into your chatbot. 4. Assuming API.AI will soon be acquiring some of the ML knowledge which Google already has, it is reasonable to expect that the intent mapping (the process of figuring out what the user said) will only keep getting better. Having said that, here are some advantages of rolling out your own: 1. You don't typically get the full picture of what is going on under the hood with an external service. Unlike the case where you write your own code, this means when things fail (and they will), you sometimes don't know what is the cause, and worse, how to get around it. 2. There is always the inherent risk that the service you rely on might shut down some day :-( 3. The current tooling around moving your chatbot from staging to production in API.AI is fraught with risk. I don't know if it is the same with the other ones too. If you roll out your own chatbot, you don't have such issues. 4. There are also some features which have been added to API.AI which are sort of all or nothing. A good example is the small-talk feature which you can import into an agent. The trouble is, you cannot really customize it much, so when it doesn't give you the behavior you expect, it can become a bit of a liability. Hope that helps!