Plain Text

  • 12 Replies
  • 2192 Views
*

8pla.net

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1087
    • 8pla.net
Plain Text
« 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
« Last Edit: November 16, 2018, 04:15:56 am by 8pla.net »
My Very Enormous Monster Just Stopped Using Nine

*

ivan.moony

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1153
    • Some of my projects
Re: Plain Text
« Reply #1 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.
Dream big. The bigger the dream is, the more beautiful place the world becomes.

*

infurl

  • Trusty Member
  • ********
  • Replicant
  • *
  • 644
  • Humans will disappoint you.
    • Home Page
Re: Plain Text
« Reply #2 on: March 19, 2018, 11:30:43 pm »
Quote from: Albert Einstein
“Everything should be as simple as it can be, but not simpler.”

*

8pla.net

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1087
    • 8pla.net
Re: Plain Text
« Reply #3 on: March 22, 2018, 11:25:35 pm »
I put it up on a GitHub repository:

https://github.com/chatbots/chatbot
My Very Enormous Monster Just Stopped Using Nine

*

infurl

  • Trusty Member
  • ********
  • Replicant
  • *
  • 644
  • Humans will disappoint you.
    • Home Page
Re: Plain Text
« Reply #4 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: [Select]
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.

*

8pla.net

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1087
    • 8pla.net
Re: Plain Text
« Reply #5 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: [Select]
            °º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,          ¸
« Last Edit: March 25, 2018, 05:08:52 pm by 8pla.net »
My Very Enormous Monster Just Stopped Using Nine

*

8pla.net

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1087
    • 8pla.net
Re: Plain Text
« Reply #6 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

on github.com
My Very Enormous Monster Just Stopped Using Nine

*

8pla.net

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1087
    • 8pla.net
Re: Plain Text
« Reply #7 on: April 03, 2018, 09:07:27 pm »
Thank you Ivan for becoming a "Watcher" on GitHub.

My Very Enormous Monster Just Stopped Using Nine

*

8pla.net

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1087
    • 8pla.net
Re: Plain Text
« Reply #8 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.





My Very Enormous Monster Just Stopped Using Nine

*

Freddy

  • Administrator
  • **********************
  • Colossus
  • *
  • 6494
  • Mostly Harmless
Re: Plain Text
« Reply #9 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.

*

Don Patrick

  • Trusty Member
  • *******
  • Starship Trooper
  • *
  • 465
    • Artificial Detective
Re: Plain Text
« Reply #10 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)
« Last Edit: April 11, 2018, 10:57:36 am by Don Patrick »
Personal project: NLP -> learning -> knowledge -> logical inference -> A.I.

*

8pla.net

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1087
    • 8pla.net
Re: Plain Text
« Reply #11 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.
My Very Enormous Monster Just Stopped Using Nine

*

8pla.net

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1087
    • 8pla.net
Re: Plain Text
« Reply #12 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.

My Very Enormous Monster Just Stopped Using Nine