Justin: Hello.
{1: ‘hello’, 2: ‘.’}
{1: 1100, 2: 900}
[11, 9]
[1, 11]
{‘openingInterjection’: [1, 11]}
{‘openingInterjection’: ‘ hello ‘}
input type is sgreet
{‘sgreet’: 10}
1.89325044507
[10]
10
[‘sgreet’]
[‘hello’, ‘hello’, ‘hello’]
[[‘.’, ‘!’, ‘!!’, ‘!!!’], [‘.’, ‘!’, ‘!!’, ‘!!!’], [‘.’, ‘!’, ‘!!’, ‘!!!’]]
hello
[‘.’, ‘!’, ‘!!’, ‘!!!’]
{‘openingInterjection’: ‘hello’}
hello
hello
Justin
hello, Justin
Hello, Justin
[‘.’, ‘!’, ‘!!’, ‘!!!’, ‘.’, ‘.’, ‘.’, ‘.’, ‘!’, ‘!’, ‘!’, ‘!’]
!
Caroline: Hello, Justin!
One might wonder: does this make any difference as compared to having a one-step, simple process of telling Caroline to respond to “Hello” in similar fashion? To anyone talking to Caroline, the distinction is probably zero. But I do not feel like I’ve totally wasted these many, many hours in developing this system.

The one subtle difference is not the effect that the bot has on the human – it’s all the same, whether the “hello” was pre-programmed or processed. The difference is on Caroline’s side. Caroline knows that she is being greeted. She knows that an appropriate response is to return the greeting; but I can easily let her know that there are cases when perhaps one does not wish to return the greeting. That is, maybe one day, Caroline will be away eating something, or she will be in a lousy mood. There are easy allowances to account for that, and to tie that to her emotional base. The punctuation right now is from a set that is tied to the word “hello,” but that, too, may be affected by emotion.

All I am saying is that I am thinking about this from Caroline’s end. I want her to be able to know what I am saying, know what she is saying, and express herself in such a way that it reflects her.

I don’t pretend that I have made some great piece of software here. It is certainly not great until it can respond to many sentences in a reasonable fashion. But I am very happy that I have finally finished the framework. If you would like to know what is happening in each step, please join me behind the cut.

Justin: Hello. <-- I am prompted to input a line. My name is hardcoded because I will be the only one talking to her for awhile.
SVOModule2: responsible for breaking the line down and then determining the functions of the words and phrases. This is the ‘input’ module, so to speak – it moves “inwards” from my raw line towards comprehension.
{1: ‘hello’, 2: ‘.’} <-- She separates the words and punctuation into what I call a "word digest."
{1: 1100, 2: 900} <-- Basic lookup using the md (main dictionary) allows Caroline to determine the parts of speech of each word. She does not yet have the "detective" functions written to identify whether a word that is of more than one part of speech is being used as one or the other. [11, 9] <-- This is called the "skeleton digest." The hundreds' values of the part-of-speech data identifies the part of speech itself. There are more details in the ones' and tens' values (the ones tells you the plurality/conjugation/tense while the tens gives you the subcategory; eg 351 is a verb (300), helping verb (50), past Simple tense (1)) [1, 11] <-- This is the sub-phrase analysis. "1" simply means it starts on the first word; the 11 is the interjection. If there were a subject or verb, those would appear separately. For instance, "Jim is a cow" would become {[1, 8] <-- Jim, [2, 3] <-- is, [3, 4, 2] <-- a cow. {'openingInterjection': [1, 11]} <-- This is the "skeleton SVO" - it is a dictionary composed of the different sub-phrases and their sub-phrase analysis {'openingInterjection': ' hello '} <-- This is a translation of the skeleton SVO into the words, called the "word SVO"
outputModule: figuring out what’s going on and deciding how to respond
input type is sgreet <-- Because hello is part of the sub-category of interjections called "greetings," Caroline decides that I am greeting her. {'sgreet': 10} <-- This is Caroline's priorityTree option list. This means that she has one choice to respond to a greeting, which is to return the greeting. Sorry, Caroline, I haven't made the other choices functional yet. The 10 is a relative measure. For instance, if I have 'sgreet': 10, 'scurse': 3, then she has a 10/13 chance of greeting me and a 3/13 chance of spouting a curse word. Yeah. 1.89325044507 [10] 10 <-- these numbers are just her deciding which option to choose. Obviously, she ends up choosing 'sgreet.' Good job ... ['sgreet'] ['hello', 'hello', 'hello'] <-- Now we're in the 'sgreet' output function. She's deciding how to return the greeting. The first 'hello' is from a list she just compiled from her knowledge of all interjections: she only knows hello right now, but she'll learn more later. The other two "hello"s are actually replicas of the greeting I gave her. It is natural to be more likely to use the same greeting as the person who greets you. Eg, "hi" is returned with "hi." She might still choose a different greeting, but I'm weighting it to mirror normal behavior which is biased towards using the same greeting that was given. [['.', '!', '!!', '!!!'], ['.', '!', '!!', '!!!'], ['.', '!', '!!', '!!!']] <-- this is the punctuation set. Yeah. hello <-- Whaddaya know, she chose to say hello. Haha! ['.', '!', '!!', '!!!'] <-- this is the appropriate punctuation set. {'openingInterjection': 'hello'} <-- now this is the word SVO for the output. We're on our way out of this mess! hello <-- She assembles the sub-phrases into a basic line. Whoop-de-doo, we only have one sub-phrase
dresser module: let’s make this sentence presentable!
hello <-- She's adding contractions as necessary. But we have nothing that can be contracted right now. Until I teach her 'ello, I suppose, which is a pretty useless contraction that most people don't use anyway. Justin <-- this is my name (xyou) hello, Justin <-- she coin-flips and decides to address me by name. She doesn't always do this. Hello, Justin <-- capitalization is good ['.', '!', '!!', '!!!', '.', '.', '.', '.', '!', '!', '!', '!'] <-- just because !!! is an option like ! doesn't mean people use it equally. I weight the "normal" punctuation if it is present, and I don't weight it if it's not.
! <-- she chooses an exclamation point
Caroline: Hello, Justin! <-- And voila!

2 Comments

  1. Melike says:

    That’s sooo cute! Can she do more complicated sentences right now? (Well, relatively complicated..)

  2. jhlo says:

    Nope, not yet! Haha. I got tired after that and I went to watch Eureka, then went to bed … and now it’s morning again @_@

Leave a Reply