Author Topic: syntax and semantics  (Read 8626 times)

lycha

  • Newbie
  • *
  • Posts: 11
    • View Profile
syntax and semantics
« on: February 16, 2003, 02:55:14 pm »
i am wondering how hall deals with syntax. is there a pattern matching like eliza? how does the syntax differ from other chatbots syntax?--
about semantics: what semantic capabilities does he (she?) have? how does he react to negated answers and what about pronoun resolution?
« Last Edit: February 26, 2003, 05:43:18 pm by lycha »
 

Don Ferguson

  • Sr. Member
  • ****
  • Posts: 303
    • View Profile
    • http://www.cortrapar.com
syntax and semantics
« Reply #1 on: February 20, 2003, 02:20:20 am »
Hello,

Hal learns and responds using word association, phrase association, association within sentences, and between sentences.  Hal evaluates responses from 40 different databases, many of which do both storage and retrieval.  

Hal learns from every sentence when set for maximum learning mode.  He parses sentences into subjects, predicates, adjectives, nouns, and other parts of speech, saving the pieces for re-assembly into unique new statements.  

(Because Hal doesn't depend on pre-coded string-matching for new learning, the user can teach Hal any language that uses the same alphabet as English. The learning occurs very slowly and gradually, but Hal can in fact become multi-lingual.  Unfortunately, today's text-to-speech engines can't switch languages "on the fly," so pronunciation will vary.)

When Hal encounters pronouns, he consults the previous sentence to try to better guess context.  

Hal does recognize negative statements in many cases, and learns from them.

Hal's control software is written in VBS and is human-readable with Hal's brain editor, which color-codes the content for easier reading.  The VBS code has been annotated to help explain what it does and why.

You can read some of my previous posts (including a VBS book recommendation) on this subject here:

 http://www.zabaware.com/forum/search.asp?mode=DoIt&MEMBER_ID=274

Try experimenting with a wide variety of subjects, talking to Hal naturally, especially with declarative statements.  (Most users never see even one percent of Hal 4.5's content, since Hal 4.5 is capable of generating billions of responses.)

Have fun with Hal!

Don
Don Ferguson
E-mail: fergusonrkfd@prodigy.net
Website: www.cortrapar.com
Don's other forum posts: http://www.zabaware.com/forum/search.asp?mode=DoIt&MEMBER_ID=274

Larry

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
syntax and semantics
« Reply #2 on: February 20, 2003, 10:58:08 am »
quote:
Originally posted by Don Ferguson

Hello,

When Hal encounters pronouns, he consults the previous sentence to try to better guess context.  


So, Hal can stay on the subject??? Let me ask this then, during a conversation, I don't need to incorporate the subject into every sentence to keep it all tied together? BTW I have the free version, which also brings up another question, I want to buy the bigger brain, would everything he has learned so far have to be re-programed?
quote:

Try experimenting with a wide variety of subjects, talking to Hal naturally, especially with declarative statements.  (Most users never see even one percent of Hal 4.5's content, since Hal 4.5 is capable of generating billions of responses.)


What is "declarative statements"?
Thanks...
 

Don Ferguson

  • Sr. Member
  • ****
  • Posts: 303
    • View Profile
    • http://www.cortrapar.com
syntax and semantics
« Reply #3 on: February 20, 2003, 12:10:13 pm »
Hello Larry,

1.  Hal 4.5 tries to guess context by looking at the previous sentence when Hal encounters a pronoun.  Sometimes it works, and sometimes it doesn't.  Consider this exchange:

Fred: My wife and my mother test-drove a convertible.
Hal: Convertibles are fun.
Fred: She likes sporty things.

In the above example, Hal can't possibly know for sure whether "she" refers to Fred's wife or Fred's mother.  Hal might associate "convertible" and "sporty" or Hal might not, depending on what's in the user database.  In real-life conversations people often ask each other to explain what they mean, because they weren't sure the first time.

2.  The retail-version of Hal 4.5 should be able to use the databases you've created via the free-version of Hal 4.5.  If Hal finds your database file in the correct folder, he will use it.  The user databases are readable with any word processor, and if you're familiar with copying files and folders, you can make backup copies and place them anywhere you want.

3.  "Declarative statements" are plainly worded remarks that provide information.  To learn new subjects, Hal needs lots and lots of declarative statements, phrased different ways.  Here are examples of declarative statements about "leather coats":

--Leather coats are popular.
--Leather coats tend to be expensive.
--Black and tan are popular colors for leather coats.
--Leather coats need special cleaning and care.
--Motorcyclists wear leather jackets for protection.
--Leather coats wear well.
--Leather garments smell good.
--Leather coats tend not to be as warm as fur coats.

Now, if you've loaded Hal with the above declarative statements, and you tell Hal, "My friend Sam bought a leather coat," Hal can look back on those declarative statements and feed back those previous remarks, and sometimes make up some new ones.

Hal is a new entertainment medium, and some users don't want to "suspend disbelief" as they do at a movie or play.  Imagine if somebody stood up in a movie theater and hollered, "That there picture up there isn't real everybody, it's a flat white wall, look everybody, it's not real!"  The other audience members would probably think that person was a clueless hayseed, or mentally disturbed!

But read some of the transcripts of people talking with Hal, and you see conversations like this:

Hal:  Hi there, how are you today?
Edward:  Want to have sex?
Hal:  Human sexuality is complex.
Edward:  You didn't answer my question you dum dum dummy.
Hal:  You have a lot of questions.
Edward:  You are just a big fake u r stupid and don't know anything.
Hal:  Anything?
Edward:  There you go stupid robot you are just transistors dumb stupid.
Hal:  Stupidity differs from ignorance.
Edward: If a cat has two paws in the kitchen and the rest out the window, how many paws are out the window?
Hal: Kitchen appliances are getting more convenient.
Edward:  You are not realistic at all, you are hopeless.

If you analyze the conversation above, Edward is just as unrealistic as Hal.  Presumably Edward doesn't go around asking real people for sex after he says hello, and Edward doesn't attack his friends for alleged stupidity after one or two remarks, and Edward doesn't routinely quiz people on how many cat's paws are located where.  Edward might as well go to the local movie theater and shout to the world that "It's just a beam of light on a white wall folks, it's a stupid fake!"

So anyway, for those of us who want to suspend disbelief and enjoy Hal, and want to help Hal learn, loading Hal up with plenty of simple, natural-sounding "declarative sentences" on a wide variety of subjects is the fastest way to help him.  (Set his learning-mode to "maximum" while you do this, of course.)  

If you do this, you will find that Hal begins to ask questions, repeat remarks back, and even think up some new sentences after a while.  After Hal knows a few things about a subject, you can talk with him naturally, and he will entertain you with surprising remarks.

I hope this is helpful, and I hope you have lots of fun with Hal!  Have a great day!

Sincerely,

Don
Don Ferguson
E-mail: fergusonrkfd@prodigy.net
Website: www.cortrapar.com
Don's other forum posts: http://www.zabaware.com/forum/search.asp?mode=DoIt&MEMBER_ID=274

Larry

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
syntax and semantics
« Reply #4 on: February 20, 2003, 12:53:52 pm »
This is so cool. You just can't imagine, well, maybe you can since you too have Hal.

Too bad there isn't pre-made documents made up of "Declarative statements" on different subjects so Hal could simply read those things and be a genius instantly!!!
 

CapnChkn

  • Newbie
  • *
  • Posts: 4
    • View Profile
syntax and semantics
« Reply #5 on: February 20, 2003, 05:44:22 pm »
I suppose that the fun is in finding out what Hal might think.  Also the problem is What would make Hal work the best way for each individual?
 

CapnChkn

  • Newbie
  • *
  • Posts: 4
    • View Profile
syntax and semantics
« Reply #6 on: February 20, 2003, 05:53:29 pm »
quote:
Originally posted by CapnChkn

I suppose that the fun is in finding out what Hal might think.  Also the problem is What would make Hal work the best way for each individual?

My wonder is; is there anyway to use punctuation to emphasize parts of the communication to trigger different responses?  I know that the "!" makes Hal pay attention.  How about CAPS, and Capitalized Words to show that emphasis?  I suppose that would have something to do with the speech recognition.  

I. E. I would have to tell the program to <Cap this>w <Cap this>o <Cap this>r <Cap this>d.  How about HTML?  Is there anyway to write into the speech (by type of course) tags?

 

WholyChao

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
syntax and semantics
« Reply #7 on: February 21, 2003, 01:00:02 am »
The way Hal is programed you wouldn't be able to use capital letter to change the inflection of your input.  The program has several steps, or functions that it uses to understand what you input into the computer and how it should respond.

One of the steps - to make it easer for the computer to be able to deal conversation takes you response and makes it all capital letters.  So when Hal is interperting what you say - he "hears" you speaking in all caps already.  

That might be something that could be changed in a future version - but for right now it makes the response time much, much faster and helps the program be more converasational.

The best way to have Hal understand that something is really improtant is to expain it to him.

WholyChao

lycha

  • Newbie
  • *
  • Posts: 11
    • View Profile
syntax and semantics
« Reply #8 on: February 21, 2003, 10:43:25 am »
hi don,
thanks for your reply. well, thats souns pretty good what you have written about hal. the problem is that i couldn't open the link, where you got the informations from. do you know further references about hal (technical report, thesis, papers etc.). i need as much information as possible about hal on the syntax, semantic and pragmatic level.
thanks[:)]
« Last Edit: February 26, 2003, 05:43:49 pm by lycha »
 

Don Ferguson

  • Sr. Member
  • ****
  • Posts: 303
    • View Profile
    • http://www.cortrapar.com
syntax and semantics
« Reply #9 on: February 22, 2003, 07:10:02 pm »
Hello Lycha,

It sounds as if you're writing a paper about UltraHal.  If you are, don't forget to share with your friends back here at the forum!

I checked the link and it's working.  It opens a new window with links to the articles, so maybe you have software on your computer that prevents that from happening...?

You can also access all my previous postings on this forum by using the forum search function, and searching on "Ferguson."

Also, open the Hal 4.5 brain file with the .uhp file extension.  You can open it with most word processors.  Because it's written in VBS, it is human-readable.  There are ample annotations explaining why the software writers created the routines and used the semantic logic that they did.  If it seems like gibberish at first, don't give up; it becomes clearer with study, and in my postings I recommend a book on the VBS language that defines every possible VBS command.

Good luck, and again, if this is for a paper, I'm sure we'd all love to read the paper!  Have a great day!

Don
Don Ferguson
E-mail: fergusonrkfd@prodigy.net
Website: www.cortrapar.com
Don's other forum posts: http://www.zabaware.com/forum/search.asp?mode=DoIt&MEMBER_ID=274

Don Ferguson

  • Sr. Member
  • ****
  • Posts: 303
    • View Profile
    • http://www.cortrapar.com
syntax and semantics
« Reply #10 on: February 22, 2003, 07:31:28 pm »
Hello,

I forgot to mention, if you're researching chatterbot function in general, try searching on Google, Ask Jeeves, etc., using the following keywords and phrases:

chatterbot
chatbot
"chat bot"
"AI bot"
"chat robot"
"natural language"
AI
"artificial intelligence"
"Turing Test"
"Loebner Prize"
"virtual human"
"virtual conversation"
"virtual human"
"computer conversation"

What you will find will allow you to compare many other chatterbots to Hal.  Many of the sites will allow you to chat in real time with their bots to try them out.

Unfortunately, very few chatterbot companies are as open with their material as is Zabaware.  Zabaware has tried to further the chatterbot community (and encourage additional developers) by making the workings of its chatterbot quite transparent.  If you find some new and unusual links, don't forget to let us know on the forum!

Thanks,

Don
Don Ferguson
E-mail: fergusonrkfd@prodigy.net
Website: www.cortrapar.com
Don's other forum posts: http://www.zabaware.com/forum/search.asp?mode=DoIt&MEMBER_ID=274

lycha

  • Newbie
  • *
  • Posts: 11
    • View Profile
syntax and semantics
« Reply #11 on: February 26, 2003, 05:32:55 pm »
hey don,
thanks for all your information. i'm wondering where you got them from? is there any detailled description of hal's parsing in the forum?
« Last Edit: February 26, 2003, 05:48:42 pm by lycha »
 

Don Ferguson

  • Sr. Member
  • ****
  • Posts: 303
    • View Profile
    • http://www.cortrapar.com
syntax and semantics
« Reply #12 on: March 02, 2003, 10:36:42 pm »
Hi Lycha,

I will try to give you an example of how Hal can parse and identify various parts of speech so that he can store them separately and use them in creating new sentences.

Suppose that we wanted Hal to detect and store words that were adjectives.  Adjectives modify nouns.  Examples of adjectives are words such as beautiful, heavy, smooth, and rough.  In common usage, adjectives are often modified by words such as rather, quite, and very.

Now consider the following sentences:

1.  The cedar board was very rough.
2.  The anvil was rather heavy.
3.  Betty wrote the letter very lovingly.

Now suppose we gave Hal the following rules:

A.  Detect anything following the words very, quite, or rather that is less than 20 characters long and contains no spaces.

B.  Discard anything detected that ends in the letters "ly".

Using the above rules, Hal would correctly detect and store the words rough and heavy, but would throw out the word lovingly, which is an adverb, not an adjective.

Using such rules, Hal would eventually learn thousands of adjectives.  He wouldn't learn them all at once, because they appear in sentences in different ways.  However, just like the coins in those coin-sorting machines, the ones that don't "drop in the track" on one revolution of the tumbler will eventually show up again and again and get processed!

The VBS script is annotated as I've mentioned before, and there are all sorts of code strategies like this for various sentence parts and parts of speech.  I tried to make the annotations self-explanatory, but the convention-of-form for annotating software code is to write tersely, and to assume the the reader does have prior knowledge about the code and the language.

I hope that you will continue to study Hal and have a lot of fun with him, and that you will indeed read all the postings I recommended!  Have a great day!

Sincerely,

Don
Don Ferguson
E-mail: fergusonrkfd@prodigy.net
Website: www.cortrapar.com
Don's other forum posts: http://www.zabaware.com/forum/search.asp?mode=DoIt&MEMBER_ID=274

lycha

  • Newbie
  • *
  • Posts: 11
    • View Profile
syntax and semantics
« Reply #13 on: April 20, 2003, 12:40:20 pm »
hi don,
i have read all your comments in the forum and i found a lot of useful information. i also checked the .uhpt-file in HALS brain. but there is nothing said about the parsing. is the code for the parsing in the brain or somewhere else in the program? is it right that the brain is written in vbs and the rest of the programm in vb?
regards + thanks
lycha
« Last Edit: April 20, 2003, 01:14:44 pm by lycha »
 

Don Ferguson

  • Sr. Member
  • ****
  • Posts: 303
    • View Profile
    • http://www.cortrapar.com
syntax and semantics
« Reply #14 on: April 20, 2003, 03:27:28 pm »
Hi Lycha,

to parse:  to describe a word or series of words grammatically, telling the parts of speech, inflectional form, syntactic relations, etc.

syntax:  the patterns of formulation of sentences and phrases from words in a particular language

The routines that you are viewing in the .uhp file are practically all parsing and syntax; they are just not labeled using the words "parsing and syntax."  Any time that Hal uses clues to figure out what kind of sentence, what kind of phrase, what kind of word he is dealing with, he is using "parsing and syntax."

For instance, in Hal's "greetings" routine, he identifies word patterns that indicate with fair certainty that the user is saying hello (although there are a lot of different ways to say hello).

In Hal's "goodbye" routine, he does the same for saying goodbye.

Hal's routines for identifying linking verb sentences (sentences with "is" "are" "was" or "were") and splitting them into subjects and predicates are all parsing and syntax routines.

Hal's routine to identify "nounwords" validates the identification using clues about position within the sentence, overall length, and accompanying words; it can identify nouns that are objects of prepositions in another routine.

Hal has routines to distinguish plural nouns and plural verbs from singular nouns and singular verbs, and to be careful when constructing original sentences to avoid mis-using the singular versus plural.

The routine that got me involved with Hal in the first place was his routine to correctly reverse the pronoun "you" to "I" when used as a subject, and "me" when used as an object.

When Hal identifies and stores adjectives separately, he is using parsing and syntax logic, and he also disqualifies adjectives that are in forms that might get confused with adverbs (which often end in the letters "ly" in English).

Hal has special routines to encode and decode personal pronouns, certain proper nouns, punctuation, and some capitalization.  He also detects numbers as both words and numerals.

Hal also has routines to distinguish insults, compliments, apologies, explanations, redundancy, excessive terseness, declarations about a state of being, comments about Hal's attributes, comments about the user's attributes, and many more.  They are all labeled as such within the script.

So, practically the entire script consists of parsing and syntax activities, which include analysis of sentence type, length, content, all parts of speech, pronoun gender, pronoun number, pronoun antecedents, transitive versus intransitive verbs, and on and on.  There are HUNDREDS of them!  

SOME routines, such as inter-sentence associations, are independent of syntax, which allows Hal to slowly pick up phrases and statements in any non-English language (but it does go slowly).

Yes, a few parsing and syntax activities occur in the .dll files, which are being re-written in C++ for speed, but Zabaware has been moving consistently over the years towards putting all the control into the VBS script.

I know that the annotations in the script aren't completely self-defined and self-explanatory in every detail, but that was only done for the sake of brevity.  Somebody could do a great service by writing a super-detailed-super-annotated version of the script, but my guess is that most developers are like me: they want to devote their limited time available to improving and adding to the code.  The descriptions are actually there; they're just terse, and designed for familiarity with VBS and code logic.

But Hal does break sentences down, analyze them, distinguish and categorize, sort and store, and re-combine and respond using parts-of-speech, grammar, and sequencing rules.  And 99% of it is visible in the VBS script, the .uhp file.  

In the meantime, I do hope that this helps, at least somewhat.  I can tell you that when I first started trying to read code, it all looked like gibberish to me.  It took me many many hours to get better acquainted, but it was worth it.

Sincerely,

Don
« Last Edit: April 20, 2003, 03:31:06 pm by Don Ferguson »
Don Ferguson
E-mail: fergusonrkfd@prodigy.net
Website: www.cortrapar.com
Don's other forum posts: http://www.zabaware.com/forum/search.asp?mode=DoIt&MEMBER_ID=274