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..

how to make <pattern> can receive multiple synonym input
 
 
  [ # 16 ]

u right Steve.

this bot only work if i user input the synonims word by arrangement which mean index=1,2,3,4.
i try to subtitude index=1,2,3,4 to unknown value=n,m,q,w.
sadly it does not work.

i still not understand about the tag that have you post above.
my plan is to make the bot that able to receive any sentence but must have 4 synonims word.

example of sentence: 1.“word1 word2 synonim1 synonim2 word3 synonim3 synonim4”
                      2.“word1 synonim1 word2 synonim2 word3 synonim3 synonim4”
                      3.“synonim1 word1 word2 synonim2 word3 synonim3 synonim4”

Steve did u have any idea for my problem?

 

 
  [ # 17 ]

Sorry, I don’t know what you mean by:

i try to subtitude index=1,2,3,4 to unknown value=n,m,q,w.
sadly it does not work.

Star indexes MUST be a number and relate to the position of the star in the pattern. For example if you had “my name is * I am * years old and I live in *”, <star index=“1”> would contain the person’s name, <star index=“2”> would be their age and <star index=“3”> would contain the person’s location. You can substitute <star> for <star index=“1”> but you cannot use random letters instead of the numbers or how would the interpreter know what order they came in?

Can these synonyms be in any order or do they have to be in the correct order?
The <srai> tag enables you to have many meanings for one word and is commonly used in spellchecking.

For example:

<category>
<
pattern>_ FAVRIT *</pattern>
<
template>
<
srai><star index="1"/> FAVORITE <star index="2"/></srai>
</
template>
</
category

If you want the synonyms in order you will have to code for patterns such as:
syn1 syn2 syn3 syn4
syn1 syn2 syn3 syn4 *
syn1 syn2 syn3 * syn4
syn1 syn2 syn3 * syn4 *
syn1 syn2 * syn3 syn4
and so on (where syn(x) is a synoynym)
as unfortunately there is no wildcard that can do “anything or nothing”.

<category>
<
pattern>SYN1 SYN2 SYN3 SYN4</pattern>
<
template>
<
srai>SYN1 SYN2 SYN3 SYN4</srai>
</
template>
</
category

If the words can be in any order, post back and I will try to devise some AIML for you.

 

 
  [ # 18 ]

hi steve,

my project still problem.i dont know how to show my coding because my coding is in “Malay language”.
before this, i success to find how to make input match with synonims..
but another problem is, i want to condition in index can match to another synonims.

eg 1 :

<category>
my name is alex I am 23 years old and I live in california</pattern>
<template>student of harvard</template>
</category>

<category>
my name is * I am * years old and I live in *</pattern>
<template>
<srai>

<li>my name is</li>

<think><set name=“a”><srai><star index=“1”></srai></set></think>
<condition name=“a”>
  <li value=“name”>alex</li>
</condition>

<li>i am</li>

<think><set name=“b”><srai><star index=“2”></srai></set></think>
<condition name=“b”>
  <li value=“age”>23</li>
</condition>

<li>years old and I live in </li>

<think><set name=“c”><srai><star index=“3”></srai></set></think>
<condition name=“c”>
  <li value=“location”>california</li>
</condition>

</srai>
</template>
</category>

<!—so the answer or output should be “student of harvard”—>

So my problem is when i use coding like above for another sentence the output that always i got is TO MUCH RECURSIVE OF AIML.

eg 2:


<category>
apple have vitamin and good for skin espesially for women</pattern>
<template>tips of beauty</template>
</category>

<category>
* have vitamin and good for * espesially for *</pattern>
<template>
<srai>

<think><set name=“a”><srai><star index=“1”></srai></set></think>
<condition name=“a”>
  <li value=“fruit”>apple</li>
</condition>

<li>have vitamin and good for</li>

<think><set name=“b”><srai><star index=“2”></srai></set></think>
<condition name=“b”>
  <li value=“bodypart”>skin</li>
</condition>

<li>espesially for</li>

<think><set name=“c”><srai><star index=“3”></srai></set></think>
<condition name=“c”>
  <li value=“user”>women</li>
</condition>

</srai>
</template>
</category>

<!—so the output should be tips of beauty—>

Both example above have their own synonims for each index.so when i run the chatbot there not totally success.most the output is TO MUCH RECURSIVE OF AIML.

is’t AIML coding can be much intelligent to respond to many synonims.

Steve plz help me
downer

 

 
  [ # 19 ]

Your code makes no sense and I am surprised it even compiled. You need to <srai> these patterns to “tips of beauty”:

apple skin women
apple skin women *
apple skin * women
apple skin * women *
apple * skin women
apple * skin women *
apple * skin * women
apple * skin * women *
_ apple skin women
_ apple skin women *
_ apple skin * women
_ apple skin * women *
_ apple * skin women
_ apple * skin women *
_ apple * skin * women
_ apple * skin * women *

I have done the first few for you here as an example:

<category><pattern>APPLE SKIN WOMEN</pattern><template><srai>tips of beauty</srai></template></category>
<
category><pattern>APPLE SKIN WOMEN *</pattern><template><srai>tips of beauty</srai></template></category>
<
category><pattern>APPLE SKIN WOMEN</pattern><template><srai>tips of beauty</srai></template></category>
<
category><pattern>APPLE SKIN WOMEN *</pattern><template><srai>tips of beauty</srai></template></category

As for your first example:

<category>
<
pattern>MY NAME IS I AM YEARS OLD AND I LIVE IN *</pattern>
<
template>
<
think>
<
set name="check"><star index="1"/> <star index="2"/> <star index="3"/></set>
</
think>
<
condition name="check">
<
li value="ALEX 23 CALIFORNIA">Student of Harvard</li>
</
condition>
</
template>
</
category

will produce student of Harvard if someone says, “My name is Alex I am 23 years old and I live in California”.

 

 

 
  [ # 20 ]

Can anyone provide me a link to “learn AIML”? I have no knowledge of it.

 

 
  [ # 21 ]

Best place to start is here:
http://www.alicebot.org/aiml.html

 

 
  [ # 22 ]

Thanks for the link, Laura. Being away from my desktop, it’s not always easy for me to keep in touch. smile

 

 
  [ # 23 ]

Thanks Laura, thanks for the link!

 

 
  [ # 24 ]

Hi Abhishek, I created the learn.aiml file and you can download a copy of it along with various other AIML files that I make available for free over at:

http://www.square-bear.co.uk/aiml/

 

 
  [ # 25 ]

Hey Steve, yeah, I’ve already visitded that link containing your free ‘.aiml’ files.
Many of them helped me, and many are still waiting to help me while Ilearn more of the language!

Thanks a ton!

 

 < 1 2
2 of 2
 
  login or register to react