How to Integrate AIML into the Akonix Platform (C# Version) - June 15, 2006

 

Natural Language Processing for Instant Messaging

Natural Language Processing for Instant Messaging

IM Interactive Corp., the IMProvCenter site owner, has been asked by Microsoft techies to explain how to connect an AIML engine to Akonix L7 Builder. By doing so, you can create an interactive chat bot utilizing the MSN network. As we have discussed in our Artificial Intelligence resource page, AIML creates the illusion of a reasonably intelligent, natural language human to machine translation process (please note that if you asked an NLP researcher at Stanford or MIT they would probably take some issue with that characterization). Notwithstanding academia, AIML is pretty darn cool and using freely available open source response patterns, it takes little time to get a Chat bot up and chatting about a fairly diverse range of topics. Except for one slight complication…how do you make AIML operate in the Akonix Builder environment?

Artificial Intelligence for IM Bots - AIML Style Solved

Artificial Intelligence for IM Bots - AIML Style Solved

Here is how to create a test application that utilizes the Alice Bot library for displaying AIML driven response content.

  1. 1. Setup and install Akonix platform (there are instructions and videos to help on the IMI site)
  2. 2. Download GNU sample AIML Application from Nicholas H. Tollervey from the AIMLBot Source Code site (AIML Adapter App)
  3. 3. Convert the AIML Adapter App from .NET 1.1 to .NET 2.0 for use with Visual Studio 2005
  4. 4. Integrate the Akonix Echo Bot Sample Application and AIML Adapter Application
    • a. Open or copy the echo bot sample application from the Akonix applications folder
    • b. Download and extract the AIML Adapter App sample C# application into the Add a reference to the AIMLBot dll that was just downloaded

Add the following to the top of the Akonix sample echo bot application

using System;
using AIMLBot;
using System.IO;
using System.Collections.Specialized;
using com.akonix.l7builder.util;
using com.akonix.l7builder.sdk;
using log4net;
using log4net.Config;

  Add the cBot initializing code right before the Start call (inside the Private Helpers region). This will load all of the aiml libraries

cBot myBot = new cBot(false); // true will turn on debug mode

public void Start(String strConfigFile)

  Modify the code in the SessionMessage call

// Add the cResponse call using the message received
// to generate a response
.

cResponse respMessage = myBot.chat(strMessage, "Default");

this.m_apiBot.SendMessageToAllParticipants(sCurrent, respMessage.getOutput());

return;

 
  1. 5. Copy the \aiml directory to the c:\windows\system32 directory (this is the default directory for retrieving the aiml library files)
  2. 6. Copy the .exe into the new application directory that was created (BotTest.exe in this case)
How to Integrate AIML into the Akonix Platform (C# Version)
 

  1. 7. Install the new application from the Akonix administration screen

GNU Lesser General Public License

GNU Lesser General Public License

The portions of the above code which were created by IM Interactive Corp. are free software code; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, V.2.1 as published by the Free Software Foundation.

This program code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You can review the GNU Lesser General Public License at the following address:

Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor
Boston, MA 02110-1301, USA.

The foregoing license is limited solely to those portions of the above software code created by IM Interactive Corp., and does not extend to any code or works created by third parties. The use of third party works or software code is subject to those limitations and conditions of use imposed by such parties from time to time.

Notwithstanding anything to the contrary in the GNU Lesser General Public License, you understand IM Interactive, Inc. reserves the right to make additions, modifications and derivative works of the license code for its own commercial use and it is not subject to any obligation to make any such additional works freely available and retain all rights to the same.

© 2006 IM Interactive Corp. All rights are reserved to the respective owner parties referenced in this Article.


IM Interactive Corp.