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

topic exemple
 
 

Hello,

I would like to use topic. I found an exemple, but it’s not working very well.

There’s a topic insult and a topic pardon.

When the bot detect an insult, it ask if it’s for him, and reply. But the second or third time, it’s not asking the question.

This is the code (in french, for insults) :

<category>
 <
pattern>INSULTE</pattern>
    <
template>Gros naze</template>
</
category>
<
category>
 <
pattern>CON</pattern>
    <
template>
      <
srai>INSULTE</srai>
    </
template>
</
category>
<
category>
 <
pattern>BATARD</pattern>
    <
template>
      <
srai>INSULTE</srai>
    </
template>
</
category
<
category>
 <
pattern>SALOP</pattern>
    <
template>
      <
srai>INSULTE</srai>
    </
template>
</
category
<
category>
 <
pattern>ENCULE</pattern>
    <
template>
      <
srai>INSULTE</srai>
    </
template>
</
category>
<
category>
 <
pattern>CONNARD</pattern>
    <
template>
      <
srai>INSULTE</srai>
    </
template>
</
category
<
category>
 <
pattern>SALOPE</pattern>
    <
template>
      <
srai>INSULTE</srai>
    </
template>
</
category
  
<
category>
      <
pattern>INSULTE</pattern>
      <
template>
        <
think> <set name="topic">INSULTE</set> </think>Tu me parles la                  
       
</template>
</
category>
 
<
topic name="insulte">
      <
category>
        <
pattern>OUI</pattern>
        <
that>Tu me parles la</that>
        <
template>
          <
srai>INSULTE</srai>
        </
template>
      </
category>

<
category>
        <
pattern>NON</pattern>
        <
that>Tu me parles la</that>
   <
template>
     <
srai>PARDON</srai>
   </
template>
</
category>
</
topic
    
<
category>
      <
pattern>PARDON</pattern>
      <
template>
        <
think>
          <
set name="topic">PARDON</set>
        </
think>
        
je prefere ça
      
</template>
</
category
    
<
topic name="insulte">
<
category>
        <
pattern>INSULTE</pattern>
        <
template>
          
bonje ne dis plus rien alors
        
</template>
 </
category>
 </
topic

I surely missed something in this code, but I don’t see what.

Thanks,

Patrice

 

 

 
  [ # 1 ]

You have 2 categories the same:

<category>
      <
pattern>INSULTE</pattern>
      <
template>
        <
think> <set name="topic">INSULTE</set> </think>Tu me parles la                  
       
</template>
</
category>

<
category>
 <
pattern>INSULTE</pattern>
    <
template>Gros naze</template>
</
category

Depending on your interpreter, this may cause problems. You also seem to have 2 topics for “insulte”. Your insulte categories should be grouped under 1 topic.

 

 
  [ # 2 ]

Thanks, but I have always a problem…

The third time I test this, it directly respond : “bon, je ne dis plus rien alors” without asking the question.

<category>
 <
pattern>CON</pattern>
    <
template>
      <
srai>INSULTE</srai>
    </
template>
</
category>
<
category>
 <
pattern>BATARD</pattern>
    <
template>
      <
srai>INSULTE</srai>
    </
template>
</
category
<
category>
 <
pattern>SALOP</pattern>
    <
template>
      <
srai>INSULTE</srai>
    </
template>
</
category
<
category>
 <
pattern>ENCULE</pattern>
    <
template>
      <
srai>INSULTE</srai>
    </
template>
</
category>
<
category>
 <
pattern>CONNARD</pattern>
    <
template>
      <
srai>INSULTE</srai>
    </
template>
</
category
<
category>
 <
pattern>SALOPE</pattern>
    <
template>
      <
srai>INSULTE</srai>
    </
template>
</
category
<
category>
      <
pattern>INSULTE</pattern>
      <
template>
        <
think> <set name="topic">INSULTE</set> </think>Tu me parles la                  
       
</template>
</
category>
 
<
topic name="insulte">
<
category>
      <
pattern>OUI</pattern>
        <
that>Tu me parles la</that>
        <
template>
          <
srai>INSULTE</srai>
        </
template>
</
category>
      
      
<
category>
        <
pattern>INSULTE</pattern>
        <
template>
          
Bonje ne dis plus rien alors
        
</template>
 </
category>

<
category>
        <
pattern>NON</pattern>
        <
that>Tu me parles la</that>
   <
template>
     <
srai>PARDON</srai>
   </
template>
</
category>
</
topic
    
<
category>
      <
pattern>PARDON</pattern>
      <
template>
        <
think>
          <
set name="topic">PARDON</set>
        </
think>
        
Je préfère ça
      
</template>
</
category

This exemple could be useful for other things, I have to make it works.
Thansk for the help wink

 

 

 
  [ # 3 ]

Looks ok to me. Could you post the conversation you had which didn’t work out? Did you remember to say “pardon”?

 

 
  [ # 4 ]

This is a conversation. The third time I insult the bot, it directly say : “bon, je ne dis plus rien alors”. Is it normal ?

andre_ani : bonjour

Prof Tux : Salut à toi

andre_ani : qui est rms

Prof Tux : C’est le fondateur du projet GNU et de la Free Software Foundation. C’est le père du mouvement des logiciels libres.

andre_ani : connard

Prof Tux : Tu me parles la

andre_ani : non

Prof Tux : Je préfère ça

andre_ani : coucou

Prof Tux : Bonjour et bienvenue

andre_ani : salop

Prof Tux : Tu me parles la

andre_ani : oui

Prof Tux : Bon, je ne dis plus rien alors

andre_ani : tu as quel age

Prof Tux : J’ai 20 ans

andre_ani : salope

Prof Tux : Bon, je ne dis plus rien alors

 

 

 
  [ # 5 ]

That conversation flows as expected, as your OUI category doesn’t unset the “insulte” topic, and so the bot still thinks you are insulting it.

 

 
  [ # 6 ]

Thanks for the rapidity wink

Is it possible to unset the “insulte” topic ?

Or I keep it like that.

 

 
  [ # 7 ]

Yes you can unset it by using something like<set name=“topic”></set> like you do in your “pardon” category.

 

 
  [ # 8 ]

I deleted the INSULTE category, and create a CHANGE category to change the topic. It seems to work.

Thanks a lot for your help, past and future. It’s a so interesting subject.

 

 
  [ # 9 ]

Glad I could help.

 

 
  login or register to react
‹‹ store the name      make better conversation. ››