My vision of a pure chatbot engine

  • 44 Replies
  • 1675 Views
*

Zero

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1163
My vision of a pure chatbot engine
« on: August 27, 2021, 12:51:45 am »
Hi devs,

What I did is: I took all chatbot engines I knew, and listed all of their features, which resulted in a 4 pages list of complicated tools. Then I tried to imagine a new system that would integrate all of them. I did design it. Outcome? Ugly.

At this point, I went backwards, starting to remove bits & pieces until the only components left were useful and in harmony.

Here is it.

Code: text
op    type         description
--    ----         -----------

#     delimiter    rule
<     condition    input
>     action       output
@     action       selfput
*     condition    is in db
/     condition    is not in db
+     action       add to db
-     action       remove from db
{}    inline       capture
[]    inline       insert

Note:
  • The program is in the db too, you double an op to escape it: this allows authors to write self-modifying systems.
  • A capture {foo} sets the value of the foo variable, and an insertion [foo] inserts the value of foo.
  • Insertions are resolved before captures, there can be insertions inside of captures, which makes indirect variable assignment possible.
Google is a plague, a disease. It is the metastatic cancer of the human species.

*

Zero

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1163
Re: My vision of a pure chatbot engine
« Reply #1 on: August 27, 2021, 10:41:43 am »
Now I have a parser for it. As usual I'm using PEGjs, and here is the syntax file. So far, I'm happy.

Code


Source
= _* r:Rule* { return r; }


_
= [ \t\r\n]


Rule
= op:Operator _ l:Line _* {

    return {
        line: l,
        operator: {
            '#': "delimiter",
            '<': "input",
            '>': "output",
            '@': "selfput",
            '*': "if",
            '/': "not",
            '+': "add",
            '-': "remove"
        }[op]
    };
}


Operator
= '#' / '<' / '>' / '@' / '*' / '/' / '+' / '-'


Line
= lc:LineContent+


LineContent
= Text
/ Capture
/ Insertion


Text
= c:Char+ { return { type: "text", content: c.join('') }; }


Capture
= '{' l:Line '}' { return { type: "capture", content: l }; }


Insertion
= '[' l:Line ']' { return { type: "insertion", content: l }; }


Char
= [^\#\<\>\@\*\/\+\-\{\}\[\]]
/ '#' c:'#'+ { return c.join(''); }
/ '<' c:'<'+ { return c.join(''); }
/ '>' c:'>'+ { return c.join(''); }
/ '@' c:'@'+ { return c.join(''); }
/ '*' c:'*'+ { return c.join(''); }
/ '/' c:'/'+ { return c.join(''); }
/ '+' c:'+'+ { return c.join(''); }
/ '-' c:'-'+ { return c.join(''); }
/ '[' c:'['+ { return c.join(''); }
/ ']' c:']'+ { return c.join(''); }
/ '{' c:'{'+ { return c.join(''); }
/ '}' c:'}'+ { return c.join(''); }



I think something along the lines of 'NeatBOT' could be a possible name. I'm not decided yet.
I'll keep posting, if you're ok :)
Google is a plague, a disease. It is the metastatic cancer of the human species.

*

chattable

  • Nomad
  • ***
  • 72
Re: My vision of a pure chatbot engine
« Reply #2 on: August 27, 2021, 11:17:50 am »
did you include personality forge in the list of chatbot engines?
it has time based responses.
it has response that come randomly as you interact with the chatbots.
the response the come up randomly as you interact with the chatbots.those responses can be in response to something you did in a roleplay.
personality forge is a websight
that you lets you make chatbots. they have a api.

*

Zero

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1163
Re: My vision of a pure chatbot engine
« Reply #3 on: August 27, 2021, 12:56:32 pm »
No I didn't. Thanks for the hint, I'll look into it (out of curiosity). I thought Personality Forge was an enthusiasts website, on the general topic of chatbots. I didn't know they had their own system.

But all of the features you mention were found in other systems, except the roleplay thing (which sounds interesting), and the time-based thing, although my original idea (the "superchat" draft) was to include a "timeout fake input" in case the user was inactive for several seconds. It looked like
Code: text
10\ this is an input
... which would generate a fake "this is an input" input if the user did nothing during 10 seconds. This behavior is still present in the current project, as I plan to make selfput generate a message towards the bot itself after 1 second. It can be used to introduce a delay in processing.

Actually, I've been influenced (and really impressed) by a system I discovered yesterday: LPS (Logic Production System) and its Javascript implementation LPS.js, which unfortunately has a crippling issues section.

Rivescript has random (and weighted random) replies. Chatscript has a lot of features too. I also included Freddy's Elfscript (with interjections), AIML of course, BotML, EmotionML (as part of SIML), ChatterBot, and MPML.


Maybe nthBot could be a good name, where "nth" means "not too high".
Google is a plague, a disease. It is the metastatic cancer of the human species.

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1583
    • contrast-zone
Re: My vision of a pure chatbot engine
« Reply #4 on: August 27, 2021, 04:40:25 pm »
It is always nice to see someone playing with new languages and concepts, in whatever field of computing it may be.

But maybe, if I may suggest, new concepts are better comprehended when abstract symbols, which are hard to memorize, are replaced by self describing keywords, especially if there are a lot of them. But I guess it may be a personal preference of the concept author. As a counter example, SQL language even tried this method to render itself as a end-user (not programmers) usable language, but acceptance didn't went that far. Instead it got stuck at programmer level.
There exist some rules interwoven within this world. As much as it is a blessing, so much it is a curse.

*

chattable

  • Nomad
  • ***
  • 72
Re: My vision of a pure chatbot engine
« Reply #5 on: August 27, 2021, 05:14:06 pm »
time based responses is good for role play to display a response during a conversion.
like when the chatbot going to fix dinner or going to water plants in role play.
 

*

Zero

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1163
Re: My vision of a pure chatbot engine
« Reply #6 on: August 27, 2021, 05:21:22 pm »
Well, I drunk-coded it this afternoon. Probably not bug-free yet, but it's totally in the way of the Dao  :happyclap:  :P

Quote
But maybe, if I may suggest, new concepts are better comprehended when abstract symbols, which are hard to memorize, are replaced by self describing keywords, especially if there are a lot of them.
Mmh yes, I understand this opinion, but many people are not comfortable with English. Since there are only 10 elements of syntax, they should be easy to memorize. Also, saving keystrokes is important if I'm going to author a lot of content with it → chatbots are typically huge scripts.


Quote
time based responses is good for role play to display a response during a conversion.
like when the chatbot going to fix dinner or going to water plants in role play.
I see the point. It is part of the system, a selfput triggers an input after 1 second! One can use it to implement a timer.


« Last Edit: August 28, 2021, 05:56:56 pm by Zero »
Google is a plague, a disease. It is the metastatic cancer of the human species.

*

8pla.net

  • Trusty Member
  • ***********
  • Eve
  • *
  • 1263
  • TV News. Pub. UAL (PhD). Robitron Mod. LPC Judge.
    • 8pla.net
Re: My vision of a pure chatbot engine
« Reply #7 on: August 27, 2021, 07:51:52 pm »
Not that it is easy, it is not. But, I think the coding is the easier part.  Data, a lot of it, is the more difficult part.  Someone equated it to like writing a novel.  Ten thousand responses, minimum, and many advanced bots have many more, may get challenging to work with.
My Very Enormous Monster Just Stopped Using Nine

*

squarebear

  • Trusty Member
  • *********
  • Terminator
  • *
  • 849
  • It's Hip to be Square
Re: My vision of a pure chatbot engine
« Reply #8 on: August 27, 2021, 08:21:27 pm »
Not that it is easy, it is not. But, I think the coding is the easier part.  Data, a lot of it, is the more difficult part.  Someone equated it to like writing a novel.  Ten thousand responses, minimum, and many advanced bots have many more, may get challenging to work with.
Exactly right. Kuki has over 360,000 hand written responses and I still find things every day that need correcting. Creating the interpreter is the least of your worries!
Feeling Chatty?
www.mitsuku.com

*

Zero

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1163
Re: My vision of a pure chatbot engine
« Reply #9 on: August 27, 2021, 09:28:58 pm »
You know what's really hard? The white page in front of me! I mean, once you have a chatbot that can talk a little bit about something, you can add things. But right now, I have nothing. I think the basic idea is to talk to it as you would talk to anyone, and to add replies if the bot doesn't know yet how to handle the situation. But it's hard to begin!

In the meantime, I still have work to do on the engine itself, and on the UI.

Edit:

nth-bot.github.io

« Last Edit: August 27, 2021, 11:16:51 pm by Zero »
Google is a plague, a disease. It is the metastatic cancer of the human species.

*

squarebear

  • Trusty Member
  • *********
  • Terminator
  • *
  • 849
  • It's Hip to be Square
Re: My vision of a pure chatbot engine
« Reply #10 on: August 27, 2021, 11:07:40 pm »
Might I suggest the open source ALICE files as a start: https://code.google.com/archive/p/aiml-en-us-foundation-alice/downloads
I began with this and altered the responses to build a character, put it online and then amended or added any new responses as people talked to it. Far easier than starting with "Hello" and then trying to think what else people will say to your bot.
Feeling Chatty?
www.mitsuku.com

*

Zero

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1163
Re: My vision of a pure chatbot engine
« Reply #11 on: August 27, 2021, 11:14:12 pm »
I wanted to use AIML, but I couldn't find a complete Javascript implementation of v2.1 that would let me work offline. So I can't use these files. I don't understand why Pandorabot forces you to host your bot in their cloud.
Google is a plague, a disease. It is the metastatic cancer of the human species.

*

infurl

  • Administrator
  • ***********
  • Eve
  • *
  • 1256
  • Humans will disappoint you.
    • Home Page
Re: My vision of a pure chatbot engine
« Reply #12 on: August 27, 2021, 11:42:41 pm »
I wanted to use AIML, but I couldn't find a complete Javascript implementation of v2.1 that would let me work offline. So I can't use these files. I don't understand why Pandorabot forces you to host your bot in their cloud.

You could still use the AIML files if you write a script to convert them into a different format. The obvious way to do that is using XSLT but XML is simple enough to parse that there are lots of other options.

*

Zero

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1163
Re: My vision of a pure chatbot engine
« Reply #13 on: August 28, 2021, 12:26:01 am »
You're right, but my toy-engine lacks a lot of features of AIML... in this case, it would be an enormous loss. Also, I'll probably want to write a French chatbot... Again, translation could be automated, but that would result in a really poor quality starting point.
Google is a plague, a disease. It is the metastatic cancer of the human species.

*

Zero

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1163
Re: My vision of a pure chatbot engine
« Reply #14 on: August 28, 2021, 03:28:01 pm »
First things first, I wanted to check that I could iterate over a list. For a sec I couldn't get it to work, and thought my life was meaningless. Phew, what a relief.

Code: text

# list handling
< list: {items}
@ think_listall: [items] end

# intern
< think_listall: {first} {rest}
> item: [first]
@ think_listall: [rest]


Now if you say "list: 1 2 3 4" it will say them one by one.  :)
Google is a plague, a disease. It is the metastatic cancer of the human species.

 


$50,000.00!!!!!
by frankinstien (AI News )
October 26, 2021, 07:56:36 pm
New challenge: Online Turing test
by chattable (AI News )
October 09, 2021, 11:47:42 am
Spooky?
by MagnusWootton (AI News )
September 24, 2021, 11:19:09 am
OpenAI Shuts Down Chatbot Project To Prevent 'Possible Misuse'
by LOCKSUIT (AI News )
September 23, 2021, 04:07:25 pm
Beautiful new work robot.
by MagnusWootton (Robotics News)
September 15, 2021, 01:00:31 pm

Users Online

89 Guests, 0 Users

Most Online Today: 101. Most Online Ever: 2369 (November 21, 2020, 04:08:13 pm)

Articles