AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

AIML patterns - combine categories to concise the knowledge base
 
 

Hi all,

I am having a problem regarding creating AIML categories in the knowledge base.

Actually my project knowledge base has a restricted domain where it is to answer user queries regarding university course details (acts as a virtual counselor).

So my problem is, say I have an atomic category as follows:

<category>
<
pattern>WHAT ARE THE ADMISSION REQUIREMENTS FOR WEB DEVELOPMENT COURSE</pattern>
<
template>The qualifications required for admission are 2 Passes at GCE (Advanced LevelExamination and 5 Passes inclusive of 2
Credit Passes 
for English and Mathematics at GCE (Ordinary LevelExamination.
(
Please contact Student Admissions Office for details.)</template>
</
category


And what I do is I am writing other possible ways of asking the same question and direct the answer to this atomic category.I write them identifying certain keywords that can be in a particular user question, which will result in giving the same answer; inserting ‘*’ wildcard in between.Some of the categories can be shown as follows:

<category>
<
pattern>* ADMISSION REQUIREMENTS WEB DEVELOPMENT *</pattern>
<
template><srai>WHAT ARE THE ADMISSION REQUIREMENTS FOR WEB DEVELOPMENT COURSE</srai></template>
</
category>


<
category>
<
pattern>* ADMISSION REQUIREMENTS WEB DEVELOPMENT</pattern>
<
template><srai>WHAT ARE THE ADMISSION REQUIREMENTS FOR WEB DEVELOPMENT COURSE</srai></template>
</
category>

<
category>
<
pattern>* WEB DEVELOPMENT ADMISSION REQUIREMENTS</pattern>
<
template><srai>WHAT ARE THE ADMISSION REQUIREMENTS FOR WEB DEVELOPMENT COURSE</srai></template>
</
category>

<
category>
<
pattern>* WEB DEVELOPMENT ADMISSION REQUIREMENTS</pattern>
<
template><srai>WHAT ARE THE ADMISSION REQUIREMENTS FOR WEB DEVELOPMENT COURSE</srai></template>
</
category

But the same question can be asked using other key words also.Then I have to replace may be for an example replacing the ADMISSION REQUIREMENTS to ENTRY REQUIREMENTS.Therefore then there will be four more categories like that and I will have to write like this for all possible keywords inputs.

QUESTIONS:
———————-

*Is there a way that I can make the knowledge base concise by writing a category like
“if the user type these two key words anywhere in a user input, give this answer” which will allow in the above example the possible 4 categories in to one simple category???

* And also something like “if the keyword ADMISSION REQUIREMENTS found with WEB DEVELOPMENT then this answer else if with COMPUTING this answer and etc “. What I want to ask simply is combination of list of patterns in a one category??

*I did not find any particular tags or anything to use for that purpose. Is there any special ways of doing it?? Or the AIML simply does not provid that facility where we will have to write all the patterns as it is??

*Anyone came across with this problem when developing a knowledge base with a restricted domain where simply had to write all the knowledge base files from the scratch??

*Any particular software or an API available to write the categories in to AIML files to solve this particular problem??

I know the question is too long and too many questions I am asking sorry for that but if anyone has any ideas or solutions please le me know.

Thank you very much all….smilesmile:)

 

 
  [ # 1 ]

Hi Umesha,

My knowledge and experience of AIML is very limited, but as far as I understand it, AIML patterns are based on a regular expression grammar (type-3). To concisely capture the complexities of natural language it is necessary to use at least a context free grammar (type-2). There are many software tools available for working with context free grammars, but unfortunately they are also a bit more complicated to use, and I am not sure yet how well any of these could be integrated with an AIML based system. However I am in the process of investigating this approach to the problem and perhaps I will have something more concrete to offer in the future.

Cheers,
Andrew Smith

http://asmith.id.au
http://wixml.net

 

 
  [ # 2 ]

@Andrew: Welcome to Chatbots.org! And thanks for thinking along grin

 

 
  [ # 3 ]

@Andrew:Thanks for the idea but I am doing my project and I have a very limited time.I am not much focusing on the NLP and its issues into much detail.But I will have to try later with enhancement .Thank you.smile

Did anyone come across above problem when writing categories in the knowledge base??Any solutions??
How to handle this problem when writing domain specific knowledge bases??
Any example .aiml files??...help me.

Thank you very much.smile

 

 
  [ # 4 ]

Hi Umesha,

In that case you should consider using an Augmented Transition Network (ATN) to solve your problem. It is possible to implement a powerful ATN very quickly for narrow domains where there is little ambiguity in the terminology. They are ideal for providing a “natural language” interface for a database system. There is a very thorough introduction to ATNs in Paul Graham’s book “On Lisp” including complete source code.

http://www.bookshelf.jp/texi/onlisp/onlisp_24.html#SEC141

While that is all in Common Lisp the principles would be easily transferred to your programming language of choice.

Cheers,
Andrew Smith

 

 
  [ # 5 ]

Umesha,

This sample is untested, for the sake of discussion only.
So I encoded it in Unicode Transformation Format for display purposes
which, please note, a copy and paste of it may not execute directly:


<category>
<pattern>WHAT ARE THE *<∕pattern>
<template>The <star∕> are 2 Passes at GCE (Advanced Level) Examination and 5 Passes inclusive of 2 Credit Passes for English and Mathematics at GCE (Ordinary Level) Examination. (Please contact Student Admissions Office for details.)
<system>
lynx -dump -source -image_links http:∕∕www.google.com∕search?q=<star∕>
<∕system>
<![CDATA[><a target=“_new”  href=“http:∕∕www.google.com∕search?q=<star∕>”>]]>  Google Search <![CDATA[><∕a>]]>
<script language=“JavaScript”>
var myVar = “<star∕>”;
alert(myVar);
<∕script>
<∕template>
<∕category>


NOTES:

<star∕> = ADMISSION REQUIREMENTS FOR WEB DEVELOPMENT COURSE

I am mostly sticking to the sample code on the reference site for simplicity.
Basically, the system tag gives you access to the server side and the
Javascript and CDATA tags give you access to the client side. 

So it does not take much to do Javascript, or redirect to a webpage based
on a conditional branch on the value of <star∕> ... Maybe your own ASPX
which handles the url variable (instead of Google in the sample code).
Maybe a Javascript document▪write(myVar) will do the trick. 
There are many possibilities to try.

FYI: “lynx -dump -source -image_links”... etc ...  is a 100% text based webbrowser.
It is an example of running a program that prints text in console mode on the server.

Reference: http://www.alicebot.org/documentation/aiml-primer.html

 

 
  login or register to react