Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<that> not working #16

Closed
newdev7 opened this issue Feb 26, 2017 · 11 comments
Closed

<that> not working #16

newdev7 opened this issue Feb 26, 2017 · 11 comments

Comments

@newdev7
Copy link

newdev7 commented Feb 26, 2017

Hi,

I'm trying to use <that> tag for my project and it doesn't seem to work other than in the coffee.aiml in the tutorial.sh .

Can you please guide me with the proper procedure to use <that></that>

@newdev7
Copy link
Author

newdev7 commented Feb 28, 2017

Hey,

I tried the code for <that> tag. After checking the python code and aiml code for <that>, I fixed some of the issues related to this one.

  1. In the <template> tag, the message is given in the lowercase. But in the <that> tag, the same messages are given in uppercase. So while sending for parsing, I changed the messages to uppercase.
  2. Some of the questions in the <template> tag ends with '?'. But in the <that>, the '?' is missing for those messages. I added '?' in <that> tag.

After changing this two, I'm able to get answer for some <that> tags.

But one more issue is there.
In the that.aiml file, we are using '* YEARS' for one question. Also in other aiml file, there is one category with <pattern> as '* YEARS'. Here the conflict occurs. It has to return the message present in the that.aiml but it returned the answer in the other aiml file pattern.

Like this if any of the messages with * is available both in the <that> tag and other <category> tag, then it returns the answer in the other <category> tag instead of <that> tag.

This issue occurs only if the <pattern> tag has * in the message. Otherwise it returns the correct answer.

Can you please tell me how to fix this issue.

@keiffster
Copy link
Owner

Just back from an overseas biz trip, let me write some tests and see what is happening

@newdev7
Copy link
Author

newdev7 commented Mar 7, 2017

@keiffster welcome back mate. A little change in the issue. There is no issue if the same pattern available in <that> tag and other <category> tag. It returned the message from <that> tag only. The issue is different here.

In the that.aiml file, we are using '* YEARS' for one question. In another aiml file, there is one category with <pattern> as '3 *'. Here the issue occurs. If I send '3 years', it responded with the <template> present in the '3 *' <pattern> instead of '* YEARS'.

@keiffster
Copy link
Owner

Check out the new release 0.5.0 which has a rewritten pattern matching parser which is much better at topic and that handling

@newdev7
Copy link
Author

newdev7 commented Mar 16, 2017

Hi @keiffster I tested the latest version. Still you didn't add '?' symbol at the end for some of the tag. So it is returning the wrong answer only.

For my issue, I tested with the same message. Now it is returning the message from that tag. But when I checked the aiml files it seems like you removed the other category in the aiml file.

Can't we use both the categories and get the answer from that tag?

@keiffster
Copy link
Owner

keiffster commented Mar 16, 2017 via email

@newdev7
Copy link
Author

newdev7 commented Mar 20, 2017

Hey @keiffster check the following flow

Hi, how can i help you today?
>>> I'm married
How long have you been married ?
>>> 3 years
Just three?
>>> 

In the that.aiml, we have one category with pattern * YEARS for <that> tag How long have you been married ?. It has the template Congratulations!. So if the user gives 3 years for the previous question like in the sample, it has to return Congratulations!. But it is returning Just three?. Because in other aiml file, we have one category with pattern 3 * and it has the template Just three?. Instead of returning Congratulations!, it is returning Just three?. I have tested in the latest version also. It is returning like this only.

And the second one is about ? symbol at the end of the text. Check the following example.

Hi, how can i help you today?
>>> zzz
Are you tired?
>>> yes
Hmmmm.
>>> 

In the category for pattern zzz, it has the template Are you tired?. But in the that.aiml file, in the category with pattern yes for <that> tag Are you tired, it has template Maybe you should get some rest. I will still be here later.. But it is returning different answer. Because ? is missing in the <that> tag. If you add ? at the end in <that> tag, then it is returning correct message.

@keiffster
Copy link
Owner

keiffster commented Mar 20, 2017 via email

@keiffster
Copy link
Owner

keiffster commented Mar 20, 2017 via email

@keiffster
Copy link
Owner

keiffster commented Mar 20, 2017 via email

@newdev7
Copy link
Author

newdev7 commented Mar 22, 2017

Hi @keiffster

In the AIML 2.0 specification, they mentioned that the removal of punctuation is not required. If you remove the punctuation. then you have to remove it in <that> tag also. So we have to remove all punctuations like '.', ',', '?', '!', etc., in <that> tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants