KB117: Setting up Program D for use with the Character Server
Program D is one of the most widely used AIML implementations. An AIML engine can be used to "chat"
with a user - it normally takes typed text inputs and generates text responses. It works by matching
inputs to a large number of rules. A common set of rules for use with AIML is the ALICE chatbot, though
many other rule sets are available. You can also create your own rule sets using AIML, a simple XML-based
rule language with a wide following in the AI community. The Character Server comes with a Program D Adapter
that lets you run a Program D AIML chat through an avatar.
Step 1. Installing Java
For Program D to work, you will need to install the "server" version of the Java Runtime Environment. Chances
are you already have the regular JRE installed on your machine, but this is not sufficient. You will need to
install the Java SE (JDK) 6 from http://developers.sun.com to get the
full version of the JRE. The regular "consumer" version of the JRE can coexist with the JDK version on the
same machine, and the Program D adapter will look for the JDK version.
Step 2. Installing Program D
Go to http://aitools.org/Program_D and download the binary distribution
in tar.bz2 format. The Program D adapter has been tested with version 4.6. You will want to use a tool such as PKZip
to "untar" this file into a new c:\Program Files\Character Server\ProgramD folder, i.e. a "ProgramD" folder beneath
your Character Server folder.
Step 3. Test Program D with the Program D Console
Start a command line (Start > Run, then "cmd"), then type:
set JAVA_HOME=c:\program files\java\jdk1.6.0_18\jre
This is only needed for the Program D console. You may need to adjust this line for the actual version of the JRE
that you installed in Step 1 - check the contents of your Program Files\Java directory to be sure the folder exists.
Then from the same command line, enter:
c:\program files\character server\programd\bin\simple-console.bat
You should then be able to type "testatomic" and see a "Test passed" message. This will verify that Program D is
correctly installed on your system.
Step 4. Download an AIML rule set
Program D itself only comes with some test rules. You can download the ALICE rule set from
http://aitools.org/Free_AIML_sets. You can unzip
the original ALICE from to a c:\Program Files\Character Server\ProgramD\AIML\Alice folder.
Then, you can modify c:\Program Files\Character Server\ProgramD\Conf\Bots.xml (using notepad)
to uncomment then line:
../aiml/alice/*.aiml
Then you can restart the shell (see Step 3) and verify that you can chat with ALICE (e.g. "where is the moon" results in "It orbits around the earth.")
Step 5. Ensure the Program D Adapter service is running
With Character Server 4.4 or higher installed, right click on My Computer, open Services, locate Program D Adapter, and start the service. You may want
to set it to start automatically. Note that you will want to stop, then restart the service if you change the bots.
Step 6. Create your CB project
Use the "AI Project" template in the New Project wizard. An AI project is conceptually just like a Dynamic Speech project, except that instead of
passing the text to be spoken by the bot, you are passing the text that the user typed in. With the right parameters, the Character Server will know
to first translate the input to an output using Program D, and then speak that output. Click on the message "Respond" in Outline view, then in the
Properties tab below, click the Build... button.
Be sure the Generate an AI response checkbox is turned on and Program D is selected. Program D is
configured using the ProgramD\Conf\Bots.xml file, and can be set up with multiple "bot" personalities. The personality, e.g. SampleBot, is passed in
as a parameter.
|