AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Writing a bot from scratch
 
 
  [ # 31 ]

Hi,

Here are my thoughts on the statement “In America a woman has a baby every 15 minutes.”

1) I’m thinking my bot will lean toward generalizing. It will accept ‘a woman’ as something intended to ‘not’ be specific.

2) If the sentence had ‘the woman’ it would search for information in the conversation to learn her identity. If her identity cannot be gleaned from conversation it might ask for a clarifying question.

3) The thing about point 2 above is it may not be necessary to know who ‘the woman’ is.  That may only be important to the chat bot if his curiosity is piqued. My wife has a high detailed personality. She’s my opposite. She would be inclined to learn the woman’s identity when I would most likely not be interested.

4) The ‘has a’ in the statement above is a link between the woman and the baby. In the general knowledge database, I hope to store abstract relationships between the thing (in this case a woman) and other entities (such as the baby). 
Of course this leads to encoding concepts such as sexuality, conception,  gestation into the general database…which I have not yet figured out. =)

I’m interested in seeing if you or others are considering how to store these relationships.

Regards,
Chuck

 

 
  [ # 32 ]

Ok, I give up.  But before I do, I’d like to present a clip of text (excuse my copyright infringing) similar to many examples given in A.I.

“Introspect while you read the following passage of text. What meaning is conveyed?
A: The boy went to school.
B: He received a D for his paper and was unhappy.

There is a lot of information conveyed in this simple text; but, there is even more implicit information that your mind can conjure from it!

Dependencies
Boy is a young human, male; child. (A, B)
Boy was not already at school at some time t1. (A)
Boy was capable of traveling to school. (A)
Boy arrived at school at some time t2. (A)
Boy was owner of the paper. (B)
Boy traded his paper for a letter. (B)
Boy was unhappy at some time t3. (B)

Implications
Boy is student.
Boy submitted paper for grade.—> Letters can be used as a form of grading.
Boy was unhappy with the grade he received.

2nd-Order Implications
Boy expected higher grade than he received.—> Human goal failure leads to unhappiness.
Boy was concerned about achieving a high grade.—> This is one of the goals of students.
Boy expected A, B or C.—> He expected a higher grade; these are the only options.
Boy attends middle school.—> Use of `boy’ suggests he is younger than college level.
Receiving a graded paper suggests that he is older than primary school levels.
Boy is unhappy with school, teacher, or himself.—> He received a grade below his expectation. Human psychology predictably tends to blame either external or internal causal factors when aflicted with disappointment.
...
Dependencies of the text are simple representations of the agents, objects, environment, and their relations, which are described therein. These are basic axioms of meaning that are implied by the syntax and words on the paper. Other than literal ambiguity, most of these can be processed by algorithmic procedures. Note that these are not terms we normally think in, because they are often too simple to be useful.

Implications are the basic straightforward meanings of the passage, which reply on human-like common sense representations to be uncovered. For example, we can assume that the boy is a student based on a few components in the text. When there are ambiguities on the dependency level, key topics on the implication level can be consulted for determining which among various interpretations is/are the most relevant.

2nd-Order Implications can go on almost indefinitely, using previous implications which, in turn, use other general common sense facts. There is probably a negative correlation between amount of meaning and certainty. In other words, there are fewer simple facts than complex facts; and simple facts are more certain (either true or false) than the multivariable high-level implications. Multivariable is just a naive way of saying: more factors that can go wrong.”


Even before the following input is submitted (C), we can imagine it in our understanding of the already given input.  Maybe not correctly, but it seems logical and common sense.

“C: Johnny knew his mother would be angry.”

 

 
  [ # 33 ]

Oh, for fun…

What if that woman having so many babies is mother earth?  Now that is thinking outside the box!

 

 
  [ # 34 ]

Mother earth “has” babies?  Ok, I’m not a chat bot, and that makes no sense to me!

If you mean that mother earth, in some indirect way produces human life, then perhaps.  But then why not be more general and say our solar system has children, our galaxy, our universe has children ?  it gets ridicoulus.

Besides, if a chatbot was to ‘fail’ to make that assumption, it would not prove it was not intelilgent.  Humans, many times, do not understand what each other means annd have to say “What do you mean by that?”, and it is in the understanding the response which will be the key functionality we have to target.  “Oh, I just mean that, in a way the earth facilitates human procreation, in an indirect way”.

So yes, if must generate these possiblites, and then pick the most likely.  Usually when we talk about “having children” or “has chidlren” with “woman” being the subject, we assume a human woman.  But if that assumption wasn’t generally assumed, then it may fall back on the second interpretiaion.  So it is all about finding a way for the chatbot to be able to generate all possible interpretations and, rule out some altogether, and then of the remaining, pick the one that is usually assumed to be correct.

Perhaps we should start 100% literal, and, also considering context of the conversation, if we find a possible interpretation, go with that.  If we cannot, we could get less and less literal, until we find, at whatever level of indirection, a possible meaning, and assume, and possiblity ask the user if we were correct.

Now I know you are going to ask what happens when :

[1] user input : X
[2] computer : clarifying question for [1]
[3] user input: response to [2]
[4] computer :clarifying question for [3]

etc….

yes, when your chatbot is very ‘young’ and doesn’t know much, you wuold be probably getting a lot of this . . .it would “recurse” most of the time until it would fully understand a fundamental sentence completely.  But then it would know a more complex sentence, and work its way up.  This is the method I am using in my bot.  I am going to “boot strap” it with some english sentences and their corresponding parse trees, along with defintion of words, to get it started.  My first milestone will be able to define a new sentence structure based on explaining it with one or more existing, known ones.  No small job, but I’m certainly going to try!!!

 

 
  [ # 35 ]
Gary Dubuque - Jun 7, 2010:

“Introspect while you read the following passage of text. What meaning is conveyed?
A: The boy went to school.
B: He received a D for his paper and was unhappy.

I allowed myself to enumerate the following deductions for better reference:

1. Boy is a young human, male; child. (A, B)
2. Boy was not already at school at some time t1. (A)
3. Boy was capable of traveling to school. (A)
4. Boy arrived at school at some time t2. (A)
5. Boy was owner of the paper. (B)
6. Boy traded his paper for a letter. (B)
7. Boy was unhappy at some time t3. (B)

1) lexical lookup, common sense knowledge. If you don’t have it pretty much nothing makes sense in the 2 statements above. However, if you DO have it, you have to have a LOT more common sense knowledge (CSK). Like. Where do boys come from? COncept of parents, family, life, death,...

2) Except he went from one school to another. Also CSK tells us, that attending school is a periodical event, so he was at school at some time t0…

3) We do not know that. “Went to” can perfectly mean he was driven there by his mother.

4) We do not know that. He might have got stuck.

5) Well - he could have submitted the paper the day before. In fact that’s more plausible because teachers need a day or so to rate papers. So probably at the time the paper was not even in his posession.

6) Yes.

1. Boy is student.
2. Boy submitted paper for grade.—> Letters can be used as a form of grading.
3. Boy was unhappy with the grade he received.

1 & 2) Yes.
3) No. If it’d been “he received D which made him unhappy”, then Yes. Else he could also suffer from depression.

1. Boy expected higher grade than he received.—> Human goal failure leads to unhappiness.
2. Boy was concerned about achieving a high grade.—> This is one of the goals of students.
3. Boy expected A, B or C.—> He expected a higher grade; these are the only options.
4. Boy attends middle school.—> Use of `boy’ suggests he is younger than college level.
5. Receiving a graded paper suggests that he is older than primary school levels.
6. Boy is unhappy with school, teacher, or himself.—> He received a grade below his expectation. Human psychology predictably tends to blame either external or internal causal factors when aflicted with disappointment.

1) No. He expected a bad grade and got it, which confirmed his mediocrity despite his efforts.
2) Whatever
3) No way. Grade Z is the best, Grade A the worst. Except our CSK tells us otherwise.
4) He probably attends a school somewhere where numbers are not used as a qualitative measure of achievment.
5) Maybe. Except he is highly talented and attends a class far above his age. Which partly invalidates hypothesis 1), so he is certainly not mediocre, but probably not as talented as everyone thought.
6) Uh…

After 14 years in AI research I’ll share some of my n-th order implications about the field with you:

1) There is a high correlation ratio between the texts in scholarly AI books. Which doesn’t make the content more true. Its just the usual culture of “academic transcription”. I have some 200 AI-books or so here to fund that finding.

2) Because no one has a clue how to tackle the AI-complete problem, they either follow the path of “academic transcription” wink or start babbling at levels which are several orders of complexity above the steps that yet remain unsolved.

3) If someone indicates a slight innovation and writes abook about “a modern approach to AI” (higher-order “academic transcription”), he gets employed as CTO by Google. Ok that was a pun at Peter - I hope he doesn’t mind. wink

4) Despite this I’m not sure whether the ad-hoc approaches I can see from highly motivated individuals are a good or a bad thing. While I think that some of the approaches I have seen are doomed, I also do not yet have the full-grown AI at my disposal - so “who am I to judge”?

Currently, I’m happy that my bot does the following:

User: A parrot is a bird.
Bot. Ok.
User: A fish is not a bird.
Bot: Ok
User: A shark is a fish.
Bot: Ok.
User: A shark is a bird.
Bot: I have contradicting information.
User: A parrot is a fish.
Bot: I have contradicting information.
User: A Red Lory is a parrot.
Bot: Ok.
User: A Red Lory is a bird.
Bot: I knew that.

Of course arbitrary chains/depths. Just shortened for brevity here. That is so not easy. I have yet to see any bot/system that masters this in the general case. Before this seemingly simple task is not mastered, theres IMHO not much point in talking about seemingly more complex things.

Richard

 

 
  [ # 36 ]

Maybe I should have tried mother nature having babies.  My bad.

But, of course, it is ridiculous.  And how would the chat bot know? Is mother earth more likely than mother nature? I guess it doesn’t matter since we probably didn’t intend anything like that in the first place. I mean, how are you going to find mother nature and stop her?

For that matter, how is the chat bot to understand that there is no way to find such a woman having so many babies? I know it and you know it. I’m pretty sure we don’t need to clarify that. It is plain old common sense.

The chat bot only knows that we need to find her as given in the input.  I would ask “how?” The bot might ask “what?” since it has this disconnect within the input, that is, “what woman can have a baby every fifteen minutes?”

 

 
  [ # 37 ]

Not the best choice of words, by ridiculous, I really meant ‘much more unlikely’.  One (of the many of course) challenges we face is how to ‘calculate’ the level of likely hood of one of a bot’s interpretations as being the correct one.  Perhaps favouring the more literal interpretations first, unless they don’t make sense, and then ‘relaxing’ the rules of inference.

For the bot knowing that there is no way to find a woman that can have so many babies:

start with axioms:

1. you cannot find what does not exist
2. there exists no woman that can have a baby in less than about 9 months

objective is : answer question

can we find a woman that can have a baby every 15 minutes

applying axiom 1, we can rewrite the objective:

if we can prove that “a woman that can have a baby every 15 minutes” does not exist, we can deduce we can’t find her.  If we can’t , then we at least know that we cannot figure out if we can find a woman that can have so many babies.. until perhaps we learn more facts/axioms, and inference rules.

since 15 minutes is less than 9 months, applying axiom 2 we get

“a woman that can have a baby every 15 minutes” does not exist,
thus, since axiom 1,
we cannot find “a woman that can have a baby every 15 minutes”

That kind of reasoning, involving not only arbitrary number of statements but arbitrary STRUCTURE of natural language representation (in any parse tree structure representation of a natural language statement(s), THAT is, I believe, the ultimate goal of a chat bot.

Richard, the “A is a B, B is a C, thus A is a C” is a good start, but the bot needs to reason on any sentence structure, and not just a template like “<variable_1> is a <variable_2>” ..  and not even a huge set of templates, but completely free form natural language.  This is why I had to refuse your challenge - i don’t want to code something that is too rigid and fixed, and limited to a “IS A” , or “HAS A” type algorithm only.

Instead, I want to dedicate my time to a general algorithm which will self-discover correlations of rules coded as parse trees, and dynamically figure out how they relate in order to deduce statements.  That is, the axioms/facts and the IF-THEN rules will be parse trees created by ‘digested’ user input sentences - not fixed logic.

I’m wondering, does your bot know the semantics of the following, if it does, it is a really good start…

User: A ham sandwich is better than nothing
User: Nothing is better than a million dollars

Would it deduce that a ham sandwich is better than a million dollars?  Or would it know that a million dollars is better than a ham sandwich?

 

 
  [ # 38 ]

@Erwin:  Perl is like C Language for the internet.  It is possible to use C or any language in place of Perl.  A few years back I wrote a C program from scratch which output a webpage with CGI (Common Gateway Interface).  However, in my opinion, Perl is the most powerful internet language in practical terms.  My favorite language is PHP, which may be less powerful than Perl, but is still a very strong reliable language which I totally enjoy.

@Victor:  I wouldn’t bother converting Perl to Java or C++, because I feel you already made the best decision in terms of programming languages for robots.  You’ve got it all, or your bot has it all…. With its own webserver and database server.  I read a news report about Oracle laying off more former sun engineers.  Who knows, they may shutter Java soon.

 

 
  [ # 39 ]

Agreed !  Until a complete working proof of concept of all of the bot’s functionalities are completed and it can reason by correlating complex rules represented in parsed natural language statements, I’m not even going to think about C/C++/Java.  Perhaps a few years in the future to speed it up, but I think writing the algorithm so it can parallel process/multi-thread will be good enough.

 

 
  [ # 40 ]

Let’s see if this works (another copyright crime)...

“Salary Theorem” states that “Engineers and Scientists can never earn as much as Business Executives and Sales People.”

This theorem can now be supported by a mathematical equation based on the following two postulates:

1. Knowledge is Power.
2. Time is Money.

As every engineer knows:
Power = Work / Time

Since:
Knowledge = Power
Time = Money

It follows that:
Knowledge = Work / Money.

Solving for Money, we get:
Money = Work / Knowledge.

Thus, as Knowledge approaches zero, Money approaches infinity, regardless of the amount of work done.

Conclusion:
The less you know, the more you make.

That’s sounds about right.  That just proves my chat bot will be rich.

(Sorry, but I couldn’t resist with all this logical analysis going on.  It is just a joke, no offense intended.)

 

 
  [ # 41 ]

lol, that’s clever Gary.  But my bot will be instantly suspicious of ‘over simplified’ expresssions like “X is Y”.  We use these expressions everyday, but they don’t really make a lot of sense.  ‘Knowledge is Power’ is really short for ‘Having knowledge gives you power’.  By the true English grammatical definition of the verb ‘is’ ,  ‘Knowledge is power’ would mean ‘knowledge’ is currently in the state of ‘power’.

‘Bob is angry’—subject - Bob.  Bob’s state is ‘angry’.  (the predicate ‘is angry’ with predicate verb ‘is’ and predicate adjective ‘angry’).  This is the correct usage of the English verb ‘is’.  Knowledge is power would mean the current state of knowledge is power—incorrect (because ‘power’ is a noun, not an adjective).  Thus, right from the start you would be feeding it false information - garbage in, garbage out.

Unless of course there are the proper rules and knowledge in which it can infer and ‘expand’ the abbreviation of

Knowledge is power —short for something like ‘The more knowledge one has, the more power he possess’

That is a useful statement at that point.  The challenge is—based on sentence structure and meanings of the words knowledge and power, there must exist some algorithm for generating the full sentence the user must have meant.

This is why my bot is very focused around grammer.  Also, keep in mind that ‘is’ is not synonymous with ‘=’

 

 
  [ # 42 ]

Excellent Gary…

I was just having a discusssion with my friend who likes to refer to himself as an old man. My friend thinks he has noticed a trend in many years of working, that if you are good in your job the company tends to keep you in that job and you don’t move up.  While others who are not necessarily that smart, get promoted to management.

Victor…
Have you heard about Linux Supercomputer on a bootable CD, or looked into Active State Perl on Windows HPC Server?  I am thinking the one thing they may have in common is support for Perl. However, I’ve yet to confirm that , since I don’t have 8 identical PCs to boot up onto at the moment.

 

 
  [ # 43 ]

Not much of a Microsoft fan, more of an open-source linux guy, but I will check it out.

 

 
  [ # 44 ]

Hi,

Being able to answer questions might not be all that a chat bot should do.  But if you are starting there you might be interested in playing Jeopardy…

Here’s a link about how IBM is going on television to showcase their Jeopardy playing “Watson”.  It also adds some discussion about what more than just answers/questions entails…

New York Times Article about “Watson” playing Jeopardy

The article (kind of) discusses much of the stuff already in this thread!

- Gary D

 

 
  [ # 45 ]

Gary,

Thank you!  That was a terrific article.  It makes me feel better to know that even I.B.M. hits a “blind spot” when pushing the envelope by creating advanced A.I.

Victor,
If I could just get my hands on a used Local Area Network, liquidated from an office upgrade or something, with all CPUs the same exact configuration, then I may have all the hardware to build a Linux Supercomputer.

 

 < 1 2 3 4 > 
3 of 4
 
  login or register to react