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

Two questions - two answers
 
 

Hello,

I decided to ask you again wink

I was once wondering if it would be possible to answer if we could have following situation:


Example:
HUMAN: How tall are you ?  What is your weight ?
BOT: I am 176 cm tall and my weight is 70 kilo.

Is it possible to read the two questions at once and prepare more or less intelligent answer?

Sorry if it is kinda stupid question but I was just wondering…......

cheers,
eitv

 

 
  [ # 1 ]

No, as AIML takes each sentence and works on it separately. Your bot will take “how tall are you?” and answer before processing “What is your weight?”. This will give something like:

HUMAN: How tall are you ?  What is your weight ?
BOT: I am 176 cm tall. My weight is 70 kilo.

which doesn’t seem too bad to me. The only way I can think of to produce the result you are after is to use some prescreening to remove the question marks, thus treating the input as one sentence. This may be difficult to code though, as you now have a lot more work:

How tall are you What is your weight
How tall are you How old are you
How old are you What is your weight
How old are you How tall are you
What is your weight How tall are you
What is your weight How old are you

and so on…

 

 
  [ # 2 ]

Wouldn’t it be a nice addition to AIML to have AIML connect those two answer though a ‘and’ ?

 

 
  [ # 3 ]

I can think of a solution using Pandorabots custom HTML.  The custom HTML feature allows you to embed AIML

<template

expressions in an HTML file.  The server evaluates these AIML statements before serving the page as a normal HTML file.

You can use

<that index="1,1"/> 
and
<that index="2,1"/> 

to access the two sentences in the response.

You can set up something like this in the custom HTML file:

RESPONSE 1 = <template><that index="1,1"/></template>
<
br/>
RESPONSE 2 = <template><that index="2,1"/></template>
<
br/>
CONJUCTION = <template><srai>CONJUNCTION <that index="1,1"/> CONJOIN <that index="2,1"/></srai></template>
<
br/> 

The CONJUCTION category is:

<category>
<
pattern>CONJUNCTION CONJOIN *</pattern>
<
template><star/> and <star index="2"/></template>
</
category

I’m using this CONJUNCTION category to eliminate the setence-splitter “.”.

The bot’s original response is:

Human: How tall are you ?  What is your weight ?
ALICE: My anticipated body size is over 2 meters. As a software program, my weight is zero.

The custom HTML returns:

RESPONSE 1 = As a software program, my weight is zero.
RESPONSE 2 = My anticipated body size is over 2 meters.
CONJUCTION = As a software program my weight is zero and My anticipated body size is over 2 meters


This sketch of a solution is limited because it’s assuming that all the outputs have exactly two sentence responses.  It seems straightforward to elaborate a variety of

<condition

items that would take appropriate action depending on one, two, three or an arbitrary number of response sentences (would you really want the bot to say “I’m six feet tall and I weigh 200 pounds and I am 30 years old and I live in California and my favorite color is green”?—maybe not).  Perhaps this solution may give you some ideas.


 

 
  [ # 4 ]

Hi, thank you very much for help. I am going to test that in the near future. Cheers wink

 

 
  login or register to react