[alicebot-general] Fwd: AIML conflict solving

mehri foreverlinux at yahoo.com
Fri Sep 22 07:08:01 PDT 2006


When looking at the spec you see this algorithm which describes the matching behvaior:


					Given:
					
							an input starting with word X, and
						
							a Nodemapper of the graph:
						
				
					Does the Nodemapper contain the key _? If so, search the subgraph rooted at the child node linked by _. Try all remaining suffixes of the input following X to see if one matches. If no match was found, try:
				
					Does the Nodemapper contain the key X? If so, search the subgraph rooted at the child node linked by X, using the tail of the input (the suffix of the input with X removed). If no match was found, try:
				
					Does the Nodemapper contain the key *? If so, search the subgraph rooted at the child node linked by *. Try all remaining suffixes of the input following X to see if one matches. If no match was found, go back up the graph to the parent of this node, and put X back on the head of the input.
				
					If the input is null (no more words) and the Nodemapper contains the <template> key, then a match was found. Halt the search and return the matching node.
				
In your example below, this is the one that is suppose to be matched.  It is not suppose to be a greedy matcher:

> <category><pattern>* IS *</pattern><template>GOOD</template></category>

The key is in line #4

4) 
					Does the Nodemapper contain the key *? If so, search the subgraph rooted at the child node linked by *. Try all remaining suffixes of the input following X to see if one matches. If no match was found, go back up the graph to the parent of this node, and put X back on the head of the input.

Here's the key part of that line which makes it *not greedy*, "Try all remaining suffixes of the input following X to see if one matches. If no match was found, go back up the graph to the parent of this node, and put X back on the head of the input"

Both RebeccaAIML and programD follow the least greedy approach as outlined above.  

A good approach when in doubt of the spec is to check out programD's behavior since Noel co-authored the specification and wrote that interpreter.


---------- Forwarded message ----------
From: Houssem BDIOUI <houssem.bdioui at gmail.com>
Date: Sep 22, 2006 8:27 AM
Subject: AIML conflict solving
To: Alicebot and AIML General Discussion <alicebot-general at list.alicebot.org>


Hi all,

Being the developer/maintainer of ProgramQ (a new release is planned very soon)
I'm interacting a lot with Charles Chevalier (charlix inventor:),
and this was our last discussion:

For the following test case, when entering "programq is cool but not
yet perfect" in ProgramQ

> <?xml version="1.0" encoding="ISO-8859-1"?>
> <aiml version=" 1.0.1 " xmlns="http://alicebot.org/2001/AIML-1.0.1";
>       xmlns:html=" http://www.w3.org/1999/xhtml";
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
>       xsi:schemaLocation="http://alicebot.org/2001/AIML-1.0.1 http://aitools.org/aiml/schema/AIML.xsd";>
> <!-- Free software (c) 2006 Charlix.   -->
> <!-- This program is open source code released under -->
> <!-- the terms of the GNU General Public License     -->
> <!-- as published by the Free Software Foundation.   -->
> <!-- Complies with AIML 1.01 Tag Set Specification -->
> <!-- as adopted by the ALICE A.I. Foundation.  -->
>
>
> <category><pattern>* IS *</pattern><template>GOOD</template></category>
> <category><pattern>* BUT *</pattern><template>WRONG</template></category>
> <category><pattern>*</pattern><template>No answer</template></category>
>
> </aiml>

The result was WRONG.

This is a second example. Trying "I went to Paris" with the following aiml file:

> <?xml version="1.0" encoding="ISO-8859-1"?>
> <aiml>
>
> <category><pattern>* WENT TO *</pattern><template>first </template></category>
> <category><pattern>* TO *</pattern><template>second</template></category>
> <category><pattern>*</pattern><template>none </template></category>
> </aiml>

gives 'second'.

My first impression is that ProgramQ is behaving correctly since
there's nothing in the spec
that permits to resolve such a conflict (by forbidding
"greedy-matching" for instance).

What do you think guys?

Regards,
Houssem

-- 
-----------------------------------------------------------
                   Houssem BDIOUI
             EDA Development Engineer
Tools Team Leader - OCCS - IP & Design - HPC
               STMicroelectronics Tunis

TINA:    157 5107
Public:  +216 70 10 51 07
mobile: +216 97 42 24 87
e-mail:   houssem.bdioui at st.com
             houssem.bdioui at gmail.com
-----------------------------------------------------------

-- 
-----------------------------------------------------------
                   Houssem BDIOUI
             EDA Development Engineer
Tools Team Leader - OCCS - IP & Design - HPC
               STMicroelectronics Tunis

TINA:    157 5107
Public:  +216 70 10 51 07
mobile: +216 97 42 24 87
e-mail:  houssem.bdioui at st.com
             houssem.bdioui at gmail.com
-----------------------------------------------------------
_______________________________________________
This is the alicebot-general mailing list
Reply to alicebot-general at list.alicebot.org
Unsubscribe and change preferences at http://list.alicebot.org/mailman/listinfo/alicebot-general
Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html
Learn to read at http://www.literacy.org/







More information about the alicebot-general mailing list