PHP & mySQL AIML Chat Bot – Artificial Intelligence Markup Language

Download the code here:cyberbot

A long time ago I created this little bit of intelligence, which at the time was pretty good. It’s based on AIML

From wikipedia:

The XML dialect called AIML was developed by Richard Wallace and a worldwide free software community between 1995 and 2002. AIML formed the basis for what was initially a highly extended Eliza called “A.L.I.C.E.” (“Artificial Linguistic Internet Computer Entity”), which won the annual Loebner Prize Competition in Artificial Intelligence[3] three times, and was also the Chatterbox Challenge[4] Champion in 2004.

To download the sourcecode, click on this link.

To set it up, you need something like xampp. If you’re using Windows, then typically you’d install this software in c:/xampp/htdocs/cyberbot (or replace cyberbot with something else).

 

Edit the settings.php file. You want to replace the following parameters with your server settings. Typically your password would be blank, so remove that.

 

<?php
$website_directory = “c:/xampp/htdocs/cyberbot/”;

$database_server = “localhost”;
$database_port = 3306;
$database_database = “cyberbot”;
$database_user = “root”;
$database_password = “root”;
?>

To open the application, you open your browser and navigate to http://localhost/cyberbot (or your equivalent name used above).

I’ve included a “poor” attempt at teaching the app to learn. Each time it can’t find a response, it stores it in the database, however it matches sentences as they’re written. You open the file unknown.php and type responses beside each question. As you do that, they’ll disappear off this page. Now when you open the main index.php page the questions are answered.

 

Drop a comment below if you need any help.

 

3 comments

  • Juraj Vysvader

    An error has occured. Report being generated now…
    Error:
    This is the SQL error:
    Table ‘cyberbot.sessions’ doesn’t exist

    This is the SQL:

    INSERT INTO sessions (session_id) VALUES ( ‘l056ns2mgscj4dbjil6vo5cvo3’ )

    Notice: Undefined index: db in C:\xampp\htdocs\cyberbot\classes\mysql.php on line 94
    Report generated. Please go back and continue. The problem will be resolved soon.

    Reply
    • admin

      Did you install the database? If not it won’t be able to write to the sessions table.

      Reply
  • Link appears to be broken.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *