Ai Dreams Forum

Chatbots => A.L.I.C.E (AIML) => Topic started by: 8pla.net on March 19, 2018, 11:09:16 pm

Title: Plain Text
Post by: 8pla.net on March 19, 2018, 11:09:16 pm
On this original thread:  http://aidreams.co.uk/forum/index.php?topic=12940

Our discussion was about "simple things rarely stay simple"

That discussion inspired me to focus on making an easier chatbot, which implements plain text for creating natural language software agents.

Demo Page:

http://chatbot.ml/easier

Plain Text Source Code:

http://chatbot.ml/easier/source.php

NOTE: The original A.I. JSON project continues.  I just thought a plain text version deserves a new thread of its own.

« Edit Notes: Fixed broken links from domain name aihax.com to new domain chatbot.ml
Title: Re: Plain Text
Post by: ivan.moony on March 19, 2018, 11:20:10 pm
Nice, I like things simple.

It is interesting how much we can simplify things by narrowing a domain range we want to deal with. That is why I think domain specific languages will never be beaten up by general purpose languages.
Title: Re: Plain Text
Post by: infurl on March 19, 2018, 11:30:43 pm
Quote from: Albert Einstein
“Everything should be as simple as it can be, but not simpler.”
Title: Re: Plain Text
Post by: 8pla.net on March 22, 2018, 11:25:35 pm
I put it up on a GitHub repository:

https://github.com/chatbots/chatbot
Title: Re: Plain Text
Post by: infurl on March 22, 2018, 11:40:22 pm
Very nice and elegant.

You number the patterns from $2 so I assume that $1 would be the whole sentence, like \0 in a regular expression substitution?

Code
In = I.replace(/'d\b/gi, " would");
In = I.replace(/'s\b/gi, " is");

You need to expand these two rules a bit as they are not nearly specific enough.

Apostrophe-S could denote genitive case far more often than it is a contraction of "where is" or "what is" or "<pronoun> is" etc wouldn't it? The number of cases where it is a contraction are small enough to enumerate. Likewise, apostrophe-D could equally be had or would but that's a bit more complicated to disambiguate.
Title: Re: Plain Text
Post by: 8pla.net on March 24, 2018, 03:07:50 am
Very nice and elegant.

More so, I think, thanks to you.

You number the patterns from $2 so I assume that $1 would be the whole sentence, like \0 in a regular expression substitution?

I was capturing the whole pattern, but there was really no need to, so I stopped capturing that.  The patterns are now numbered from $1.


You need to expand these two rules a bit as they are not nearly specific enough.

These rules were not being reached in the plain text, so they were removed for now.

Apostrophe-S could denote genitive case far more often than it is a contraction of "where is" or "what is" or "<pronoun> is" etc wouldn't it? The number of cases where it is a contraction are small enough to enumerate. Likewise, apostrophe-D could equally be had or would but that's a bit more complicated to disambiguate.


The number of cases equals two.  Only "DO NOT" and "CAN NOT" are reached in the plain text.  So by handling these two cases, the genitive cases are no longer being treated as contractions, which is an improvement.

Thanks for your excellent suggestions, infurl.

 
Code
            °º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,          ¸
Title: Re: Plain Text
Post by: 8pla.net on April 02, 2018, 11:55:13 pm
Thanks for the like infurl

Many thanks to:  therealjackson

who forked therealjackson/chatbot-1 from  chatbots/chatbot (https://github.com/chatbots/chatbot)

on github.com
Title: Re: Plain Text
Post by: 8pla.net on April 03, 2018, 09:07:27 pm
Thank you Ivan for becoming a "Watcher" on GitHub.

Title: Re: Plain Text
Post by: 8pla.net on April 03, 2018, 09:33:17 pm
With 8 Followers on GitHub so far, "Plain Text" may yet grow into an AIDreams forum of its own some day, rather than  piggy backing off of the AIML forum, which was a bit unused lately.  Hopefully Dr. Wallace does not mind lending a thread to a new, small A.I. system.  Understandably, it takes time to become as well known as the big A.I. systems like  AIML, RiveScript, ChatScript, ElfScript.  If that is even possible any more, with the loss of Hugh.  Assuming it is ( and I hope it is)  The big A.I. systems all started out the same way "Plain Text" is starting out right now.





Title: Re: Plain Text
Post by: Freddy on April 03, 2018, 10:27:14 pm
Hehe, well I wouldn't call my ElfScript one of the big ones or even well known, but I did like seeing it mentioned in the same sentence as those that are  :)

I hope the Loebner Prize can keep going without it's main character and driving force.
Title: Re: Plain Text
Post by: Don Patrick on April 11, 2018, 10:27:00 am
I don't have a lot to add since the code is already very concise. One thing I'd advise is to change the ".*" regexp into ".*?" for later patterns where something might follow the wildcard:
https://blog.mariusschulz.com/2014/06/03/why-using-in-regular-expressions-is-almost-never-what-you-actually-want

If you want less lines of code, which in my opinion doesn't matter, you may be interested to know that you can do "x = x.replace().replace();" without having to assign "x = " twice. For the sake of code clarity I don't advise it, however.

Lastly, converting all " 's " to "is" will not be accurate because it can have multiple meanings.
let's = let us
's + got = has
what/who/how/etc + 's = is/has
he/that/it + 's = is/has
noun + 's = is/has/possessive
I'd consider not converting " 's " to "is" by default but to substitute "is" in the patterns with "(is|'s)" automatically using replace(), and "has" with "(has|'s)".
(Note: I initially posted this in the original thread, so I'd overlooked Infurl's similar comment here)
Title: Re: Plain Text
Post by: 8pla.net on April 11, 2018, 11:14:47 pm
Thank you, so much Don.

Let me start by responding over on the other thread to what you posted there.

And, then I will return here, to respond to what you posted on this thread.
Title: Re: Plain Text
Post by: 8pla.net on November 16, 2018, 04:23:01 am
Don Patrick, who commented and helped here, is worth a mention: http://artistdetective.com/arckon   
Currently scheduled to be online Mondays,  Don's A.I. approach seems unique from other popular A.I. approaches.
It deserves a new thread of it's own.  So this post is a reminder and reference.