-
Notifications
You must be signed in to change notification settings - Fork 0
Home
We came up with the idea after some co-students of us (That's me and Till Kolter) came up with their idea of writing a chatbot with the AIM-Language for the Linguistics Department of the Potsdam University.
As a chatbot or chatterbot is some kind of dialog system, it can has different purposes. The focus of todays well developed business oriented chatbots is probably to provide users with relevant information as fast as possible. Good examples of chatbots are e.g. those from IKEA. But there are a lot more. On the website to the book "Chatbots in der Kundenkommunikation" there's a list of chatbots available that are in use in professional environments.
We thought that a mobile version of the departments chatbot would be a good idea.
Since the guys providing the "content" wanted to use AIML we had to find an interpreter for AIML. We also needed to find a programming language that we could both agree on. The language was found quickly: Java. The interpreter was kind of an adventure. Some interpreters are listed on the alicebot homepage but there are just a few written in Java. So we tried to get along with Program D which is still available but it seems unmaintained.
It turned out that Program D was not what we wanted. We wanted a maven organized project without providing patched lib jars. Basically we tried to refactor Program D and get rid of all strange libs that are inside the project. It quickly turned out that this wasn't the way to go because of problems with XML and AIML validation.
The interpreter we liked most was [http://pandorabots.com]. Here's why:
- You can host your own bots and change/train them on the platform.
- You can keep track of usage of your bot.
- You have logs of the conversations.
- There are a couple of different bots already hosted so you can start right away.
The instibot server provides a RESTful JSON API. It uses the spring application framework to manage the object graph. For building the RESTful web service we use Jersey because it's the reference implementation for JAX-RS and we've worked with it before.
The main work is done in the PandoraBotsWrapper
class. There all requests to the pandorabots website are made and the responses are extracted from the HTML that gets returned.
The pandorabots platform cuts of question answer pairs in the returned HTML after a specific number of interactions. So the wrapper also takes care of keeping track of question answer pairs. That means that the complete interaction between bot and user is kept in memory so the API can provide the whole thing.
The PandoraBotsWrapper
is used as the converter inside the BotResource
so that it's encapsulated and can be changed and/or enhanced if necessary. Thus it's even possible to use a different interpreter or build your own. In that case the RESTful API stays the same so that you don't have to change the implementation in the clients.
There are a couple of possible deployment solutions:
- Package the application as WAR through
mvn package
and deploy it in your favorite Servlet container like Tomcat. - Run the
Start.java
out of eclipse. That's a good thing for debugging! - Use
mvn package cargo:start
to run the instibot in a Jetty 7 Servlet container. All of the "hard work" is kept from you through the cargo Maven plugin.