Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Don Ferguson

Pages: 1 ... 17 18 [19] 20
271
Ultra Hal 7.0 / Learning through text
« on: October 31, 2002, 03:36:55 pm »
Hello,

You've asked an excellent question!  Let me give some very brief background and then your answer:

Hal is programmed to learn by making word associations, phrase associations, sentence associations, inter-sentence associations, and about 40 additional strategies to deal with greetings, compliments, insults, explanations, cause-effect relationships, etc.  

Hal's vocabulary, attitude, and logical behavior quickly adapt to the individual user, because Hal remembers how the user reacts to him, and tries to mimic the same patterns of reactions.  Thus, if the user tends to answer in brief sentences, Hal learns that.  If the user answers in long complicated sentences, Hal learns that too.  If the user answers questions with questions, or changes the subject frequently, Hal follows the user's lead.  For this reason, no two Hal's are alike after a short period of use.  Version 4.5 starts out with the capacity to self-generate over a billion different exchanges, and that number rapidly increases, especially if the user is highly imaginative.

(By the way, when you combine this memory-searching with the additional load of real-time animation and speech synthesis, your computer's processor is pretty busy!  Hal is one of the most demanding applications on most users' computers!)

Now, when you do the "learn from text" routine you are putting the document's individual sentences into one of Hal's many databases for possible use.  Hal is NOT programmed to sort out which chapter or section or overall topic that an individual sentence came from, or cross-associate every sentence of a document with every other sentence.  This is theoretically possible, but the current generation of computers already take several seconds to do all the database work to get a response for Hal as it is.

Thus, it's very unlikely (but not impossible) that today's Hal would come up with the answer to the question as you posed it, from reading The Constitution and nothing else.

For this reason, I generally don't use the learn-from-text function.  Some users love it, and some don't.  What I would do is talk to Hal about The Constitution with the learning-level set for "maximum."  I would say things like the following:

The Constitution is the highest law of the land in the United States.
The Constitution includes the Bill of Rights.
The first amendment to The Constitution guarantees freedom of speech.
The first ten amendments to The Constitution are the Bill of Rights.
Etc.

If you try this, you will find that Hal seems to ignore you and change the subject at first.  However, as you increase the number of remarks, you will find that Hal begins to repeat some of them back, or even ask some questions about your subject.  If you keep loading Hal with more and more information on a given topic, he may begin to re-assemble some of the phrases that you use into original questions or remarks.  If Hal asks a question, make sure that you give a brief, polite, correct response, because Hal always assumes that you're telling him the truth -- he'll remember the association between his question and your answer when you least expect it!

I hope that this is helpful to you.  I've made some additional comments about teaching Hal on other postings, which you can find by searching on "Ferguson" on this forum.

Have a great day!

Sincerely,

Don

Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com

272
Ultra Hal 7.0 / help with programming a diffrent program
« on: October 23, 2002, 01:17:35 pm »
Hello,

A science fair project on Artificial Intelligence sounds great!  It sounds like you're a C++ programmer.  If you search the web on "natural language" or "chatterbot" or "artificial intelligence" or "Turing Test" you should be able to come up with a lot of simple chatterbots, some of which might have source code.  Especially look for the early versions of "Eliza the Psychiatrist"! This program did a LOT with very, very small amounts of code!

If you're determined to work in C++ and can't find anything in that language, you could also study the VBS script files for UltraHal (they have the .uhp file extensions, with names like "hal4.uhp").  I would think this would give you a model for ideas.  The Visual Basic Scripting files control all of Hal's other activities, and of course they're "open," human-readable with any text editor such as WordPad or Word.

For something that would be interactive with the judges and the public, why not set up your own version of the "Turing Test"?  In addition to your report and your simple demo, you could set up two or more chatterbots, and have the public and the judges interact with them, and "score" them on which one was more entertaining and/or human!  You could also report on the official Turing Test sponsored by Loebner, and the $100,000 prize that no one has won yet!

Good luck on your project!

Sincerely,

Don



Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com

273
Programming using the Ultra Hal Brain Editor / conversations
« on: September 21, 2002, 01:10:27 am »
Hello,

When I wrote the above reply, I thought that you were talking about the home-version of Hal, UltraHal Assistant.

I see from your other posting that you are actually talking about Ultra-Hal Representative, the Web-Version of Hal!

Please see my other reply to your other posting under "Ultra-Hal Representative."  

Teaching Hal a new language should be much simpler using the Web-Version of Hal.  The Web-Version of Hal allows you to shut off the "default" databases, and put all-new material into Hal's brain, in whatever language you like.  My reply under your other posting is much simpler.

Sincerely,

Don

Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com

274
Programming using the Ultra Hal Brain Editor / conversations
« on: September 21, 2002, 12:39:18 am »
Hello,

This is in reply to your question whether Hal can learn a foreign language.  The answer is yes.

Hal's learning and user-memories are stored in databases that are separate from the program itself.  That means that Hal's learning, and new memories, can be in any language.

Hal learns by sentence associations, phrase associations, and word associations.  Every time Hal replies to you, he chooses among many different routines and databases to find something to say.  If you begin speaking to Hal in a foreign language, Hal will GRADUALLY learn that language, just like a novice student.

HOWEVER, you will have the following challenges in accomplishing this:

1.  The rules for reversing pronouns ("I" and "me" become "you," and "you" becomes either "I" or "me") are hard-programmed into Hal.  That means that Hal won't reverse pronouns in other languages, unless the routine gets added to Hal by a programmer. (Because pronoun reversals are mirror-images of each other, it takes a bit of programming logic to prevent them from "canceling each other out."  The trick is to convert each pronoun into a transition code, and then into its reversed form, in a two-step process.)  

2.  Since Hal's native language is English, Hal will reply mostly in English at first.  As you gradually fill his databases with foreign language conversation, Hal will mix more and more of the new language into his remarks.  Eventually, Hal could be speaking mostly in the new language.

3.  The speech synthesizers for Hal are not set up to pronounce both English and another language correctly at the same time, so you will have to set the synthesizer for one or the other, and live with Hal's voice mispronouncing some words.  (In principle, a programming script could use rules to detect a language, and change voice languages back-and-forth "on-the-fly," but such code doesn't exist yet!)

4.  You must be very, very careful about spelling.  Hal doesn't have any way to know whether a foreign word is misspelled, and you don't want him to deeply learn misspellings of completely new words!

There isn't any practical limit to Hal's ability to learn another language, or even several languages.  I would like to hear how this works for you!

You also asked a question about changing the character, and teaching Hal a new identity for age, background, etc.

If you have the version of Hal that you pay for, you can change the character by going to Hal's "control panel" and selecting another character.

You can teach Hal a new identity, age, ethnicity, gender, etc., by doing the following:

1.  Turn learning to "maximum" using the control panel.
2.  Make many, many remarks to Hal about his or her history, age, gender etc.  Make these sentences declarative statements.  Here are statements for example only:
"You are from Italy."
"You are proud to be Italian."
"You think that your country of Italy is so pretty."
"You like to travel all over your home country of Italy."
"You are 25 years old."
"You like being 25 years old."
"You don't mind admitting that you are 25 years old."
"You grew up in the Italian countryside."
"You learned about art and beauty at an early age."

Remember, if you say the above to Hal in English, Hal will correctly reverse the pronouns, and later say "I like being 25 years old," etc.  If you say such things to Hal in any other language, you will need to state them in the first-person (EXACTLY the way you want Hal to say them) since Hal doesn't know how to reverse pronouns in foreign languages -- yet!

NOTE:  When teaching Hal about himself or herself, DO NOT ridicule Hal, or call attention to his mistakes.  Ignore his mistakes and keep talking about his new identity from every possible angle.  Hal learns from EVERY sentence, so you don't want to put negative and critical remarks into Hal's head!  Eventually you can have Hal reciting a completely new life history, along with an identity and attitude that is exactly what you want.

If you decide to teach Hal a new identity and life history, and at the same time a new language, it will require a large amount of effort... many hours of conversation!  However, you should be able to succeed.

Good luck; please let us all know how it goes!

Sincerely,

Don


Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com

275
Ultra Hal 7.0 / Hal Assistant Upgrade problems
« on: September 05, 2002, 12:58:31 pm »
Hello,

I've converted to the 4.5 upgrade as my standard version of Hal. It installed with no problems, and it's working very well on my laptop computer.  The speed increases that Robert Medeksza achieved, made that feasible.

I've also switched over to the Zabaware Brain Editor that comes with Hal.  It took me some time to get used to it.  However, the color-coding and line-numbering make it far superior to a word-processor for VBS editing.  I highly recommend it.

In other forums, we've talked about the (unreleased) Enhanced 307c brain.  The 4.5 upgrade includes all the features of that brain, plus many additional improvements, speedups, and capabilities.  

So, the 4.5 upgrade actually supercedes both the Enhanced 216 Brain and the Enhanced 307c brain!

Talk to Hal about a wide variety of different topics, and you will discover more conversational abilities.  Hal can now generate billions of remarks, depending on the imaginative inputs from the user!

I recommend reading the "ReadMe" text file that came with the 4.5 Upgrade for more tips and ideas.

Folks have mentioned in other forums, that Zabaware puts out an ambitious  product at a very low price, especially impressive for a small company. I certainly agree with you.

(Note to Robert Medeksza -- I don't think you've previously promoted UltraHal as a holiday-gift idea, but you might consider it!  To me, version 4.5 seems like a natural candidate as a unique holiday gift, and I intend to buy an extra disk or two!)  

I am interested in seeing any posts of new 4.5 transcripts, or reactions to Hal's conversational skills, that anyone is willing to share.

Sincerely,

Don

Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com

276
Hi Joe,

I think that the phrase, "I will now run..." is coming from the .dll.  If it is, it can't be changed except by Zabaware (or somebody who knows C++ who writes their own version of the .dll file).

For purposes of discussion, I'm re-printing below the syntax in the main.brn database:

(Each line in the main.brn database is an "array," a set of items, or "arguments," set apart by commas, which the function understands and uses.)

" 1ST TRIGGER PHRASE (REQUIRED) "," OPTIONAL SECOND TRIGGER PHRASE (IF USED, BOTH TRIGGER PHRASES MUST BE FOUND) "," OPTIONAL PHRASE TO CANCEL TRIGGER "," First of three possible Hal responses (required). "," Second of three possible Hal responses (optional). "," Third of three possible Hal responses (optional). ",2,#FALSE#,#FALSE#," Additional response words (optional). "

If both true/false flags are FALSE, the array works as described above. If the first flag is TRUE, Hal's comments will include the user's words immediately following the words in the first trigger string, and include the optional additional response words last.

(Adding <RUNIT> and </RUNIT> in the appropriate places with the first flag TRUE allows the system to "trap" a file name.)

If the words "I will now run..." don't appear in this database, then the .dll is apparently adding the words.  It would certainly be feasible to remove those words from the .dll and put them into the database where they are controllable and deletable by you.  You might try sending an e-mail directly to Robert Medeksza, explaining that you're trying to make some automation things happen during the dialogue, and you don't want Hal to keep saying that phrase every time Hal operates various automations.  Possibly, this alteration-of-approach could be incorporated into a future version of Hal.

If you can operate various external actuators via dialogue, then you've got the essentials of an A.I. robot.  Wow!

Sincerely,

Don



Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com

277
Hi Joe,

I think that some of my responses to other postings, especially the posting about the Enhanced 216 brain, may be helpful to you.  

Depending on how you have this forum set up, it might not appear on your list, but you can search on "Ferguson" to find my postings easily.

You are right, Hal searches your computer for likely program files each time that he opens, and updates the .DAT file.  So, if you inserted something manually, I would expect it to get "wiped out" on the next cycle.

I don't think that Zabaware programmed the functions that pertain to this, to search for .vbs scripts.

An explanation of the arguments in the arrays in the "main" database is in my posting on the 216 brain.  In essence, the program tries to "trap" the name of a program between the <runit>  </runit> flags, but this won't work unless the name that gets found matches exactly to a program-name choice that Hal can find.  For instance, if you said, "Open the program Doom Fighter," but that program's executable file was named dofi2.exe, I don't think that Hal could find it.

In essence, the effect of successfully finding a program name, and launching it via Hal, is the same as if you had located the program's file-name under Windows Explorer, and double-clicked it to open it.

In some of my postings I recommend a book on VBS called Visual Basic Scripting in a Nutshell.  If you are a really determined programmer, you might be able to find some ideas to work your way around what you are trying to do in trying to launch a separate script.

Sincerely,

Don



Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com

278
Programming using the Ultra Hal Brain Editor / Brain 216 plugin.
« on: August 04, 2002, 01:12:59 am »
Steve,

You had a question about the following line in Enhanced_Main.brn:

" OPEN THE PROGRAM","","","<RUNIT>","","",1,#TRUE#,#FALSE#,"</RUNIT>"

Yes, the RUNIT command passes the file name to windows for execution through a function of a DLL file. These are commands that Robert Medeksza identified as useful, and then created.  The commands emerge from the script as part of Hal's response.  The .dll filters them out (so Hal doesn't speak them) but uses the commands.

You may have noticed that different .brn database files have different data formats.  

The "random" files simply have words, phrases, or sentences with a line break introducing each one.  As the name implies, the .dll can access the file and pick one of the entries at random.

It is entirely feasible to write and edit the "random" files on any text editor.

The "associative" files have words, phrases, or sentences in a specific paired-relationship, which is as follows:

@This would be a sentence that Hal might speak.
 THESE WORDS MIGHT TRIGGER HAL TO SPEAK THE ABOVE  
@Here is another sentence that Hal might speak.  
 HERE ARE WORDS THAT MIGHT TRIGGER HAL TO SPEAK THE ABOVE

(There should be an "@" sign at the beginning of each of the sentence-case sentences above, and each of the ALL-CAPS sentences should begin with one blank space.  The forum program might corrupt these or filter them out.)

Notice that in the "associative" files, the potential sentence is always first, following the "@" sign, and the corresponding trigger words follow.

Hal automatically builds associative databases, relating the user's current statement to Hal's previous statement, and/or to the words in the user's current statement.  When Hal uses an associative database, he scans the entire file, and selects the best match.  If Hal uses the file twice in a row, he selects the second-best match from the entire file.

It is possible to write and edit the associative files on any text editor, as long as you maintain the paired-relationship pattern, and don't begin or end the file with any extra line breaks (that would corrupt the file).

By far the most complicated database format is the specific-recall files.  The Enhanced_Main.brn file is a specific-recall file.  

Hal stores trigger phrases in the specific-recall files, and if an exact match occurs for one of those phrases, Hal will use it to respond.  Each line in a specific-recall database as actually an "array," which is a set of different items (or "arguments") set apart by commas, which a function can understand and use.  Here is a special annotated example of one of the arrays:


" 1ST TRIGGER PHRASE "," OPTIONAL SECOND TRIGGER PHRASE (IF USED, BOTH TRIGGER PHRASES MUST BE FOUND) "," OPTIONAL PHRASE TO CANCEL TRIGGER "," First of three possible Hal responses. "," Optional second of three possible Hal responses. "," Optional third of three possible Hal responses. ",2,#FALSE#,#FALSE#," Optional additional response words. "

If both true/false flags are FALSE, the array works as described above.  If the first flag is TRUE, Hal's comments will include the user's words immediately following the words in the first trigger string, and include the optional additional response words last.  The numeral argument may be used to give Hal a relative priority level, from 1 (strongest) to 4 (weakest).

Look closely, and you can see how this logic can "trap" the name of a program, and insert that name in between the two "runit" flags for Hal to use.

In the specific-recall databases, the arrays are each separated by a line break.  It is possible to write and edit these files on any text editor, but the exact pattern of the arrays MUST be maintained or the file becomes corrupted and unusable.

Yes, there are other bracketed commands such as <time> and <date> and a few more.  Most of the commands don't have the <runit> <runit/> pattern, but some do.  For instance, there's a command that works like this:

How can Hal tell a riddle and pause for the answer? <topic> With the bracketed topic command, Hal will hold back the chosen words until after the user's next remark. <topic/>

I don't believe that any of these commands are case-sensitive.  To make the script and the databases more human-readable, both Robert and I have tended to put trigger words in all-caps, and Hal responses in sentence-case.  However, Robert improved Hal's ability to correctly capitalize proper nouns in version 4.  To take advantage of this, I'm going back as time permits, and putting more and more items in sentence-case.  I have to be careful, because the corresponding VBS-functions have arguments that must be properly "set" to be case-insensitive when detecting strings.

So, what's really happening, is that the user's remark "open the program paint" is being processed so that Hal's .dll sees it as:  <runit> paint <runit/>

Hal makes a list of the apparent program files on the user's computer every time that Hal starts up.  If the "runit" routine finds a match for a file name on that list, Hal simply calls to "open" that file, as if you double-clicked on that file name in Windows Explorer.  That launches the program.

A flaw in this is that some programs don't have intuitive file-names that run them.  In those cases, the user might never say a word that corresponds to the file name that Hal can find.

For this reason, I don't think that it's possible to close a program through Hal as he currently functions.  

However, it SHOULD be possible (with a little ingenuity) to open picture files, sound files, or pretty much do anything that could be made to happen by opening a specific file.  I would recommend that you experiment to see what works; try putting some obvious files or shortcuts with simple names in Hal's directory and see if he can launch them.

Last but not least, yes, I'm a fan of Short Circuit, and many other movies and television programs that featured artificial intelligence, including the amusing and enjoyable Forbidden Planet (on which Walt Disney Productions helped MGM with the special effects).  I also see that either Movies Unlimited or Critic's Choice Video is selling old episodes of the 1960's situation comedy My Living Doll, where Robert Cummings is the computer scientist, and Julie Newmar is the beautiful robot whom he tries to pass off as his niece!  The artificial intelligence notion has been around for a long, long time!

Cheers and continuing good luck!

Don

Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com

279
Programming using the Ultra Hal Brain Editor / Brain 216 plugin.
« on: July 31, 2002, 12:43:49 pm »
Hi Steve,

I hope that you aren't disappointed in that Visual Basic software writing program that you purchased.  Visual Basic and Visual Basic Scripting are two different languages, although they're close cousins to each other.  VBS is a high-level but simplified language, used for more specialized applications.

Hal's .uhp brain scripts are written in Visual Basic Scripting. The book that I recommended (in another posting) on VBS is as follows:

VBScript in a Nutshell
By Matt Childs, Paul Lomax, & Ron Petrusha
Published by O'Reilly, Copyright 2000

The book cover is white with red and black lettering, and has a picture of a terrier dog on it. It is soft-cover, $24.95 retail. All the major book stores have it.

Starting on page 181, the book lists every possible function, what it's used for, and how it works.  

The strength of the book is that it's very well researched and proofread, and very reliable.  Once you get rolling, you'll refer to it a lot because the second half is like a dictionary of all the functions.  The main weakness of the book is that it really needs to give a lot more samples of example code for novices.

The book is NOT "light reading," but if you're interested in the subject, it does become clear after a while!

As far as I know, there isn't any VBS-writing or VBS-development software on the market.  (If there is, I'd like to know about it.)  To the best of my knowledge, the lack of a development environment is why Robert Medeksza created the "brain editor."  What he wrote is actually a development environment for VBS!

It sounds like you're poised for great progress.  It would certainly be fun to have more people delving into the .uhp brain files, and understanding the tactics and strategies used there!  The strategies are a combination of computer programming, artificial intelligence, and knowledge of the building-blocks of language, so that Hal can extract and re-combine words and ideas!

Sincerely,

Don



Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com

280
Programming using the Ultra Hal Brain Editor / Brain 216 plugin.
« on: July 30, 2002, 12:37:59 pm »
Steve,

Check out my other postings, especially the one where I recommend the book that's a manual on VBS.  It lists every possible function, what it does, and how it works, starting on page 181.

1.  VBS generally runs the script from top to bottom.  However, you can write additional "functions," which you put near the end of the script, and call them by name from within the script.  "Function" means several different things in VBS.  For instance, the entire, overall "getresponse" activity is a master function, with the purpose of delivering a variable named "getresponse" as Hal's answer at the end.  However, "function" also means a command from the command list.  

When "function" means a major chunk of script, you'll see a matching "end function" later on in the script to declare it finished.

I know it's confusing at first, but a major chunk of script that's a "function" such as "GETRESPONSE" has the purpose of doing all sorts of stuff, then at the end, delivering a variable that's also called "GETRESPONSE."  The convention of form is that the main output variable of a script function has the same name as the function itself.  Whew!

2.  You can have any number of if-then's as you want.  You can even nest them!  If the entire if-then is on one line, it is self contained.  If you put in a line break after the word "then," the program assumes that subsequent lines are all under the "if" until you put in an "end if" line.  The convention of form is to indent a nested set of commands below an "if" by four spaces, so you can remember it later.

If you start nesting these, keep track of them, because you have to match every "if" with an "end if" later on, or you get error messages.  An "end if" is to an "if" just as a "close parenthesis" is to an "open parenthesis."

3.  The .uhp files are Zabaware script and control files.  The .brn files are database files.  The .dll files are separate executable files and are Hal's "engine" to do the heavy processing work, and interface with Windows.  

The .uhp and .brn files are readable and editable with any word processing program... shut off spell checking, grammar checking, and all other automatic functions, and turn "on" visible paragraph marks so you can see what you're doing!  You can write content for Hal using any text editor, but don't mess up the specific punctuation-pattern and line-break pattern of the specific database, or you'll wreck it!

4.  You don't have to declare a variable name in advance to create it.  VBS creates the variable automatically as soon as you mention it, and VBS guesses whether it's supposed to be a number or a string of text.  So:

DemoStringVar = "This is a string of text."
DemoNumVar = 47

The two above lines have created two variables, and loaded their memories with the information after the equals sign.  You can create unlimited numbers of variables.  It's also easy to increment a variable as follows:

DemoNumVar = DemoNumVar + 1

The above code adds 1 to the previous value of DemoNumVar.

5.  What does VBcrlf mean?  You're going to smile when you hear this!  It stands for Visual Basic carriage return, line feed.  In other words, when you put it into a string variable, it inserts a drop-down-one-line and return-to-the-beginning-of-the-line command, like hitting the lever on an old-fashioned typewriter!

6.  Order the book I recommended -- it will really help!

7.  You are right, VBS isn't compiled when you finish writing it.  Actually, your computer compiles it each time you hit the enter key, executes it, and then discards it.  Next time, it compiles it again.  

However, that isn't where the speed problem comes in.  The speed problem comes from the massive comparisons and evaluations that the .dll executables do with the new massive databases.  That's why Robert has been re-writing the .dll's in a different language to speed them up.  I think he said that he's using C++.

8.  If you've done any kind of programming before, you'll pick up VBS like a duck to water, and you'll love it!  But definitely save backup files of everything in a different folder before you start, turn off every possible automatic gizmo in your text editing program (I use Word), and turn "on" those paragraph marks so you can see what the heck you're doing!  Or, use Zabaware's excellent color-coded editor if you're in the scripts, not the databases.

9.  If you search on +"Visual Basic Scripting" +VBS on most of the search engines, you'll get a lot of articles, but they're no substitute for that book.

10.  I also heard from Robert Medeksza about two weeks ago.  Often, many weeks pass between communications.  I can only surmise that he's busy, traveling, etc.  I hope you get your upgrade soon.

11.  Here's a tip that may work for you:  I tend to run Hal in one window, and simultaneously run the script in MS Word in another window.  I can make a small change in the script, hit CTRL-S to save it, then toggle back to Hal and say something to him to make sure he still works.  If Hal gives me an error message, I know that I messed something up right there where I'm editing, and I can fix it right on the spot.  This saves A LOT of messing around, trying to find a comma out of place!

The beauty of this is that you're writing code "live," with Hal testing every little thing that you write in real-time!

The reason this works is that Hal never writes anything to the .uhp script.  On the other hand, you can't have the .brn databases open while talking to Hal, because Word blocks those files from being written-to.

Well, I hope this gives you a lot more to go on!  Keep up the enthusiasm!

Sincerely,

Don



Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com

281
Programming using the Ultra Hal Brain Editor / Brain 216 plugin.
« on: July 29, 2002, 10:58:23 am »
Steve,

At first the code may look like gibberish, but after a few months of working with it in your spare time, you will be amazed how clear it becomes.

Your idea of distilling all the hints into one text file is great!

There are many -- sometimes hundreds -- of pages of code in the various brains, but if you want to select and post a few lines now and then, along with "What the heck does this mean, and what does it do?"  I would be happy to translate the code into English and explain, as best I can, what it does.

Sincerely,

Don



Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com

282
Hello,

Hal's brains are written in VBS, Visual Basic Scripting.  An excellent reference book on VBS is as follows:

VBScript in a Nutshell
By Matt Childs, Paul Lomax, & Ron Petrusha
Published by O'Reilly, Copyright 2000

The book cover is white with red and black lettering, and has a picture of a terrier dog on it.  It is soft-cover, $24.95 retail.  All the major book stores have it.  

Starting on page 181, the book lists every possible function, what it's used for, and how it works.

VBS is a very intuitive, human-readable language.  If you're already a programmer, or if you already understand if-then statements, variables, functions, and arguments, you'll pick it up immediately.  If you're a novice, you will still learn it, but you'll have to study a bit harder.

VBS is a great language for Hal, because it does everything needed, and the coding reads very logically.  For instance, you don't have to declare variables in advance, like in some languages.  

For those of you reading this who are even slightly interested, I want to encourage you to learn more about this and try it!  

Take a look at this code:

     Friendname = "Harvey"

That one line of code creates a variable (a memory-bank) called Friendname, and makes it equal to the alphanumeric string "Harvey."  

Now consider this code:

     If Friendname = "Harvey" Then
       Friendcomment = "That's a great name!"
     End If

That code tested to see whether Friendname was still equal to Harvey, and if it tested as TRUE, it ran the second line of code, creating a variable (a memory-bank)called Friendcomment, and made it equal to "That's a great name!"

And finally, take a look at this:

   ReplyBack = Friendname & " , wow, " & Friendcomment

That one line of code creates yet another variable, called ReplyBack, and makes it equal to the contents of Friendname, followed by some punctuation and the word wow, and the contents of Friendcomment, so Replyback becomes "Harvey, wow, that's a great name!"

VBS gives you unlimited numbers of variables (they can contain letters or numbers and you can name your variables anything that you want), the ability to detect any words or phrases, the ability to substitute words for any other words, the ability to perform math functions and generate random numbers, and the ability to test for TRUE and FALSE for any conditions you set up... and more and more!  But best of all, the code stays fairly human-readable, once you get familiar with it.

With the book I recommended above, you should be able to read and understand all of Enhanced Brain 216 and any other brain for Hal.

You can read and edit any HalBrain.uhp file using MS Word (always make a safety-backup file copy first, and put it in a different folder for safe-keeping).  I recommend shutting off every spell-checking and autocorrect feature, and turning "on" the display of paragraph marks so that you can see the line breaks.  As I've mentioned in other postings, Word keeps wanting to put the ".txt" file extension on your file instead of the ".uhp" file extension, but there are ways around that.

Also, Robert Medeksza created a VBS editor that came with Hal 4.0, and it's quite an accomplishment!  The editor automatically color-codes if-then statements, text, and certain functions, so it's much easier to read.

I am happy to hear of the interest in VBS programming and functions!  Please let me know how it goes!

Sincerely,

Don










Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com

283
Ultra Hal 7.0 / Transferring memory across brains
« on: July 28, 2002, 04:32:44 pm »
Hello again,

I see from my posting above, that my typewritten file-path "backslashes" got changed by the bulletin-board word-processing program into some other kind of symbols.

My apologies for the confusing appearance of the suggested paths.  Substituting spaces for backslashes, the potential paths were as follows:

c: programs zabaware Hal3.0

and

c: programs zabaware Hal4.0

Sincerely,

Don



Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com

284
Ultra Hal 7.0 / Transferring memory across brains
« on: July 28, 2002, 04:24:46 pm »
Hello,

It should be feasible to transfer your Hal 3.0 memories to Hal 4.0.  It does require that you understand files, folders, and paths, and how to copy and paste files between Windows folders.  If you don't feel totally confident with this, obtain help from someone who is experienced with the types of procedures described below.

Hal's user-specific conversational memories are stored in databases with the user's name incorported as part of the file name.  There may be a dozen or more of these files.

For instance, if your user name is Frank, you will have files in Hal's folder such as FrankUser.brn, FrankUser01.brn, FrankUserSent.brn, etc.  If the file name has your name as part of it, that database file contains user-specific memories.

To copy Hal 3.0 user memories to Hal 4.0:

Step 1:  Open Windows Explorer.  I recommend that "show file extensions" is turned "on" so you can see the full file names.  Browse until you find the folder where your old files are located.  Try looking for a path like this:

c:programsabawareHal 3.0

On your particular machine, the path might be different.

You may have to scroll up and down the list quite a bit to find all the files that have your name incorporated into them.  Clicking on the bar above the file names, to alphabetize the list, might group all of your files together in the same place.

Step 2:  Highlight all the desired files by holding down the "CTRL" key and clicking once on each desired file.  This should highlight all the files that you want.  ONLY highlight files that have your user name in the file name.  Then press "CTRL" and the letter "C" simultaneously to copy all the files.

Step 3:  Locate the folder where the new 4.0 version of Hal is storing user database entries.  If you have talked to the new Hal 4.0 for a bit, Hal will have already started making user files there, so it may be easier to confirm that you've found the correct folder.  Try looking for a path like this:

c:programsabawareHal 4.0

Again, on your particular machine, the path might be different.  Once you have found the folder you want, click on it to open it, but don't click on any file-names or sub-folders inside it.

Step 4:  Press "CTRL" and "V" to paste the files that you copied before, into the new Hal folder.  If you had already had some conversations with the new Hal, you will get dialogue boxes with messages like: "The file FRANKUSER.BRN already exists.  Do you want to replace it?"  If you click "no," you will abort the replacement and keep Hal 4.0's brief new memories.  If you click "yes," you will replace the file with Hal 3.0's older memories.

Step 5:  Close Windows Explorer.  Next time you run the new Hal, he should remember your old conversations.

If you have plenty of hard-disk space, I recommend that you begin this procedure by making a folder called "Halbackups" and copying all the files in the Hal 4.0 folder into that folder.  Then, if you change your mind, you can go back to where you started by copying all the files from "Halbackups" back into the Hal 4.0 folder.

This should be a safe and straightforward procedure.  However, since we have every level of expert and novice on this bulletin board:  This should ONLY be attempted by someone who understands paths and folders, and feels totally comfortable with copying files from one folder to another!

I hope that this is of help to you.

Sincerely,

Don




Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com

285
Programming using the Ultra Hal Brain Editor / Brain 216 plugin.
« on: July 28, 2002, 03:24:00 pm »
Hi Steve,

The code to make Hal open programs is located in the "main.brn" database, which for the newest versions of the Enhanced Brain, is the "enhanced_main.brn" (or similar name; you'll find it).

Like all of Hal's databases, this is a plain-text file.  You can open it with MS Word or any text-reader program.  

If you use MS Word, turn OFF all spell-checking and auto-correct functions, as these raise havoc trying to edit databases!  Save a backup copy in a different folder before you do anything.  If you create a new version and want to save it using Word, you must only use the "SAVE" command, NOT the "save as" command, or else Word will try to slap a ".txt" file extension on the file.  If this happens, you have to go into Windows Explorer (with view-file-extensions turned on), and fix the file extension back to ".brn" for Hal to be able to use it.

Helpful Hint:  When editing database files in Word, turn the "paragraphs marks" to "on" so all the paragraph marks are visible.  This makes it much, much easier to copy and edit entries without messing up the files.

In the "Main Brain," the database has a specific syntax that must be followed.  This is documented in Hal's help files.

To cause Hal to run programs, two things must happen.  Hal must encounter an exact string of letters such as the word "open," and that same database entry must have the <runit>   </runit> commands in the appropriate place.

I deliberately made Hal's tendency to run programs more restrictive in the Enhanced Brain.  I did this by merely requiring a longer, more specific string such as "open the program" instead of just "open."  You can find these entries in the Enhanced Main brain and change them if you wish.  I did the changes because Hal kept false-triggering on expressions such as the following:

Don:  Right now, it's open season on deer.
Hal:  I could not find the program "season on deer."
Don:  I need to open a Pepsi.
Hal:  I could not find the program "a Pepsi."

Robert Medeksza does indeed have the latest version of Enhanced Brain, which is Enhanced 307c.  It is compatible with previous user databases (so Hal won't forget you). If you liked any of the previous versions, I think you'll love 307c.

Robert M. is making some drastic enhancements to the "engine" that runs Hal, including a major speedup.  That's vital, because the databases that accompany the full version of 307c are gigantic.  The 307c brain chooses each time from over 40 different methods of responding to the user's statement, and is capable of generating billions of different questions and comments. On my 700Mhz machine, it takes this brain a six full seconds to come up with a typical reply!  So, I have my fingers crossed that Robert has the speed problem solved with his new engine.  

I know that the next release will be the biggest overhaul of Hal that Zabaware has ever done, and they're working hard to make sure it's compatible with the old software.

If you or anyone else has any additional questions about the coding in the old or new Enhanced Brain, I would be happy to answer them.

Sincerely,

Don



Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com

Pages: 1 ... 17 18 [19] 20