This project is not covered by Drupal’s security advisory policy.

Below is a chatbot that we have created using AIML Parse module:
drubot
See full animation here
If you are interested how we created this chatbot, read further:

Synopsis

AIML Parser module lays down a foundation for introducing AIML in Drupal and creating Chatbots. A program which can chat with users automatically. It is a small effort but this will go a long way.

A parser for converting AIML tags and upload them to drupal database.

What you need to know before using this module.

1) WHAT is AIML? AIML (Artificial Intelligence Markup Language) is an XML-compliant language that is easy to learn,and makes it possible for you to begin customizing a chatbot(Drubot) or creating one from scratch within minutes..

The XML dialect called AIML was developed by Richard Wallace and a worldwide free software community between 1995 and 2002.

The AIML pattern syntax is a very simple pattern language, substantially less complex than regular expressions and as such less than
level 3 in the Chomsky hierarchy. To compensate for the simple pattern matching capabilities,

AIML interpreters can provide pre-processing functions to expand abbreviations, remove misspellings, etc.

2) What is a chatbot?

A chatter robot (chatbot) is a type of conversational agent, a computer program designed to simulate an intelligent conversation with one or more human users via auditory or textual methods.

This chatbot can be used as a knowledge agent in place of FAQ,

Or they can be used as call center agent.

3) What is AIML file?
AIML file is just like an xml file with it's own tags. AIML files are available as open source you can find them on web for free.We have uploaded some of them as zip, ( Download Sample AIML files ).

Example of AIML file and understanding it's content:

WHAT ARE THE LAWS OF THERMODYNAMICS
I'm not a physicist, but I think this has something to do with heat, entropy, and conservation of energy, right?

Now in above example the pattern is: "WHAT ARE THE LAWS OF THERMODYNAMICS"

And the template is: "I'm not a physicist, but I think this has something to do with heat, entropy, and conservation of energy, right?"

So if you upload this aiml file through aiml parser module, module will parse the file and store the respective tags in database.

Later you can access them by query and your chat bot can answer the question :
"WHAT ARE THE LAWS OF THERMODYNAMICS"
by answer:
"I'm not a physicist, but I think this has something to do with heat, entropy, and conservation of energy, right?

We are also working on a chatbot in DRUPAL here is the sandbox:
https://www.drupal.org/sandbox/saurabhtripathics/2826282
Which will use AIML parser as a dependent module.

Some Basic Tags which are present in aiml file and can be parsed by this module."

aiml - defines the beginning and end of a AIML document.

category - defines the unit of knowledge in knowledge base.

pattern - defines the pattern to match what a user may input to an Drubot.

template - defines the response of an Drubot to user's input

Who creates AIML tags?
They are opensource, a number of communities and companies do that.

So now that you know about chatbot and AIML you must be wondering how chatbot works?

Chatbot needs aiml files as a knowledge source. A database from where chatbot can
pick responses for asked pattern.

Use Case of this module:

After the aiml tags are parsed and stored in the database, you are ready to create a chatbot,
We are already working one chatbot called drubot.

How to create a chatbbot using AIML parser:
There can be a lot of ways to do it, below is the process:

Step1: Create a custom block.
Step2: Add a robot image to the block (any of you choice).
Step3: Create a form in the block with a text-field.
Step4: This text field will accept input from user.

Now this accepted input is pattern. Query this in the drupal database and get the response.

Sow now if some types: WHAT ARE THE LAWS OF THERMODYNAMICS in to the text field, you get a response :
I'm not a physicist, but I think this has something to do with heat, entropy, and conservation of energy, right?

How will AIML parser module help chatbot to learn?
There are open source AIML files available example:
science.aiml, sports.aiml, love.aiml
Each AIML file has questions and answers related to each category, so if you want to teach your chatbot about science than upload science.aiml and your chatbot can than use the responses stored in the database to answer question related to science to end users.

Congrats you have created a basic chatbot in Drupal 7.
Till date there is no chatbot in drupal.

Requirements

No contributed module dependency.

Roadmap

Parsing of all the tags in an AIML file.

Known problems

Support of the other AIML tags will be in included in next version.

Credits

* Vipul Patil
* nupurlohokare
* saurabh.tripathi.cs

Issue page

AttachmentSize
example_AIML_FIles.zip442.16 KB

Project Information

Downloads