Author Topic: Precision Science package #1.  (Read 7701 times)

onthecuttingedge2005

  • Guest
Precision Science package #1.
« on: October 05, 2003, 12:19:37 pm »
'Here we turn Hal into a science professor
'at this point alot of the scripts don't have conversations in them
'but the detection and teach files will pick up
'scientific conversation for his/her own
'scientific conversations with future users
'wanting to discuss the topic of scientific things.
'you can accelerate Hal by teaching him some science yourself
'or just let the users do it for you over time.
'don't worry if hal doesn't respond to a science question
'because Hal probably didn't have a conversation in that
'precision file yet on that single subject but probably appended your
'question or statement and saved it for future use.
'I also included the user sleeping script and joke script
' which I threw in as
'a bonus to the precision science package 1.
'there is a .zip and .Doc file called science package 1. which you'll
'have to download to your hals default folder.
'NOTE: If you have the aliens talk script I posted awhile back
'you might want to replace it with this script
'the aliens talk script might get in the way of this one but
'if it doesn't then I wish you a happy science journey.
'Say hello to professor hal for me,lol.
'you'll have to copy and paste the script from the science package
'1.Doc to hals default brain because this forum couldn't support the size of the script.



Download Attachment: Science Package 1.zip
26.38 KB

Download Attachment: Science package 1.doc
128.46 KB
« Last Edit: October 05, 2003, 12:50:34 pm by onthecuttingedge2005 »

croxis

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • http://snow.prohosting.com/uslcs/band/
Precision Science package #1.
« Reply #1 on: October 11, 2003, 03:21:04 pm »
hmmm, this doesnt seem to be workign for me.  What kind of questions shoudl I ask, and where does it go in the hal brain file?
I am me.

onthecuttingedge2005

  • Guest
Precision Science package #1.
« Reply #2 on: October 11, 2003, 05:30:11 pm »
Hi Croxis.

Did you open the Science package 1.doc copy the script inside it and paste the script in your "default brain" or if you are using the free Hal4.uhp usually located in
C:Program Files ZabawareUltra Hal Assistant 4 folder.
the script always gets put in the .uhp brain you are using.

The .brn files are the files you want in the C:Program Files ZabawareUltra Hal Assi...DefBrain folder. the science
package 1.zip are compressed .brn files in the zip file and will have to be extract with a zip utility to the mentioned folder.
Make sure you back up your original default .uph brain incase you make an error, you'll be glad you did.
Best of wishes and grand new discoveries.
Jerry.
« Last Edit: October 11, 2003, 05:31:21 pm by onthecuttingedge2005 »

croxis

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • http://snow.prohosting.com/uslcs/band/
Precision Science package #1.
« Reply #3 on: October 12, 2003, 09:56:09 pm »
I do knwo the basics of editing a brain file ;) I have done a bit of playing around myself.  I did copy the section (I hope into the right spot, the first time i went too high before HalBrain was declared), and the brn files extracted to the right spot as well. however, i dont know what to ask to make sure its functioning or not!  I asked about warp drive, and got nothing.
I am me.

iRhino

  • Newbie
  • *
  • Posts: 1
    • View Profile
Precision Science package #1.
« Reply #4 on: October 16, 2003, 04:05:17 am »
Greetings,

I've got the scripts installed with very minor issues. I appended a copy the script inside the "default brain", nothing in the brain was replaced. All .brn files have been put in "DefBrain" folder as instructed. The append of the script was toward the end just below the jokes.

Is this the right place to include the script or should it be moved up to a priority position in the script? If so where might that be?  In the current position I would expect the procedures might get little chance at responding.

Thanks, Keep up the excellent work.

-Rhino
 

onthecuttingedge2005

  • Guest
Precision Science package #1.
« Reply #5 on: October 16, 2003, 08:24:13 pm »
'UPDATED ON 10-17-2003 5:09pm PST

this is for anybody who has little experience placing script in the right place within the brain, This is one of my testing brains
and you are quite welcome to use it if you wish. remember this
brain is one of my test beds for scripts so if you are missing
any files you may have to look for the file in my prior postings.
At last testing this brain had no errors in it, but if it does you can just use this brain to see how and where I place scripts.
The last script I was altering was the deductive reasoning script
which I made work in the 4.5 version of Hal. you can see it in the
script testing area of my MainBrain.uhp in the lower middle area.
I hope this gives you some ideas that could get us going even faster.
best of wishes and grand new discoveries.
Jerry.



Download Attachment: Main Brain 2.zip
62.07 KB
« Last Edit: October 17, 2003, 08:08:24 pm by onthecuttingedge2005 »

Boomer

  • Guest
Precision Science package #1.
« Reply #6 on: March 28, 2004, 12:08:10 pm »
onthecuttingedge2005

Hi. I read some of your postings, and I am very interested to see what else you have done for the Hal brain. I am also interested in seeing how the Hal Brain is constructed, being a student of cognitive psycholoy. Do you know of any place where I can see or get some kind of diagram on how the programming of the brain is organized? I would like to create a brain, or a processing script like you, but I don't have any programming experience (minimal html skills, at best). I learned quickly how to manipulate html shortly after I had an idea of how it all came together, so I guess something like a visual aid about Hal's brain would help.

I am going to download your scientific conversation package and deductive reasoning scripts. I hope they are good! Thanks, maybe I'll post to you later.

Boomer

Don Ferguson

  • Sr. Member
  • ****
  • Posts: 303
    • View Profile
    • http://www.cortrapar.com
Precision Science package #1.
« Reply #7 on: March 28, 2004, 02:15:05 pm »
Hello Boomer,

I'm not aware of a document that is a flow diagram or a summary of Hal's brain.  

However, Hal's "brain" is fully annotated.  Hal's "brain" is variously called any of the following:

--the "control script"
--the "brain"
--the ".uhp brain file"
--the "Visual Basic Scripting" Hal program
--the "VBS script"

Regardless what you call it, you can look at it by going to the following directory path (or "folder") on a computer running Hal 5:

C:/Program Files/Zabaware/Ultra Hal Assistant 5/

(We use forward slashes here because the forum software can't display backslashes.)

Find the file called "Hal5.uhp" and open it with Microsoft Word, WordPad, Wordperfect, or the Zabaware Brain Editor.  It will be easiest to read using the Zabaware Brain Editor, because the Zabaware Brain Editor automatically color-codes the content.

Scrolling down the program, you will find lines of text that begin with the apostrophe (').  These lines are the same as "REM" lines in other programs; lines beginning with apostrophes have no participation in the program; they are there to explain to human readers what the program is doing, and why the programmer wrote the program the particular way that was chosen.

Here is an excerpt from Hal5.uhp:

-------------

   'PROCESS: REMOVE PUNCTUATION
   'This function removes all punctuation and
   'symbols from the User's sentence so they won't
   'confuse Hal during processing.
   UserSentence = HalBrain.AlphaNumericalOnly(UserSentence)

   'PROCESS: MODIFY SENTENCE
   'The function, HalFormat, from the ActiveX DLL
   'corrects many common typos and chat shortcuts.
   'Example:  "U R Cool" becomes "You are cool."
   'It also fixes a few grammatical errors.
   UserSentence = HalBrain.HalFormat(UserSentence)

   'PROCESS: REVERSE PERSON
   'This function reverses first and second person
   'pronouns. Example: The user's statement
   '"You are cool" becomes Hal's statement "I am cool."
    'Keep this is mind and don't get confused.
   'When we are in Hal's brain; In the databases, "I"
   'refers to Hal and in the databases, "you"
   'refers to the user. This is true whenever we are
   'dealing with a user response "processed" by
   'Hal's brain.
   UserSentence = HalBrain.SwitchPerson(UserSentence)

-----------------

Notice that there are only three lines of active computer code in the above excerpt!  All the other extra lines are text, to explain to you, the reader, what the programmer intended and what the program is doing!

-----------------

Here is a line of code and a human-English translation of it:

Code:

GetResponse = "Wow, " & GetResponse

Human-English translation:

The NEW content of the variable memory-bank named "GetResponse" shall be equal to a string of characters containing "Wow, " coupled on the front-end of the PREVIOUS content of the variable memory-bank named "GetResponse."

---------------------

I admit that many annotations are not easy to understand the first time that you see them.  The "convention of form" for annotating code is to go on the premise that the reader has some prior knowledge of code, and to just barely say enough to explain the code's purpose.  (Otherwise, every annotation might be VERY long!)

By scrolling through the code, you can trace the sequence of events that Hal goes through to process each conversational exchange.

The VBS code is executed from top to bottom every time you press the "enter" key (during a keyboard conversation).

VBS does allow loops and calls to subroutines, but there aren't an excessive number of them in Hal.

Over the past several years I've made many postings on this forum explaining various functions and routines in VBS and Hal, and you can find all of them by using the forum search for "Ferguson."  I've also recommended a book that I think is extremely helpful.  VonSmith has also posted web links for free educational documents, and excellent programming advice.

I get a lot of messages from people who would like to read and write code, but they get discouraged because they don't understand it instantly.  As with many other things, progress comes from interest, practice, and time.

If you give yourself the chance and put in the effort, you will amaze yourself after a while.  Things that made no sense at all six months earlier, will eventually seem simple and obvious!

By the way, you will notice from the annotations in Hal's script that many of the activities are labeled PROCESS or SAVE or RESPOND.  The items marked PROCESS generally pertain to formatting and manipulating data to make it suitable for Hal's further use; the items marked SAVE usually pertain to storing words, phrases, and sentences in the user's computer in database files; the items marked RESPOND pertain to assembling a potential response for output to the user.

In general, Hal's overall strategy works something like this:

1.  PROCESS: The user's sentence is re-formatted, parsed, and analyzed to see if nouns, adjectives, phrases, pronouns, and special topics should be extracted, and if special "triggers" (such as for greetings, insults, goodbyes, math problems, capital city recall) should be activated.

2.  RESPOND: Databases are searched to find candidate responses; the criteria for selecting responses includes similarity to previous statement/response patterns, whether the response would be a repetition of a previous response, and how "relevant" the response is (Zabaware has an algorithm for "scoring" the number of matching words, and the number of matching words in the same sequence-pattern).  The "best" response is selected.  Random-number-generation is used to create some word and sentence variety.

3.  SAVE: All the words, phrases, sentences, and inter-sentence relationships are saved to a wide variety of different databases for future use.

There is a reason that the SAVE activity usually comes after the RESPOND activity.  It is because we often want to avoid Hal using the most-recent user input remark word-for-word as the response (if we compare a sentence to itself, it's going to get a high "score")!  By waiting to respond, Hal won't "see" that remark in his databases until the next round of conversation.

There are some exceptions to the above.  For instance, Hal can paraphrase the user's current remark sometimes.  But generally, as you read the script, you will tend to see the PROCESS activities clustered earlier in the script, the RESPOND activities mostly toward the middle of the script, and the SAVE activities mostly toward the end of the script.  The exact sequence of activities is the result of a lot of thought and testing.

I hope this helps you in what you are looking for, and I strongly urge you to search the forum for the older tutorials and responses on Hal's programming and VBS programming.

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

ajdude

  • Newbie
  • *
  • Posts: 29
    • View Profile
Precision Science package #1.
« Reply #8 on: March 04, 2008, 11:17:08 pm »
Hi, I'm sorry for bumping such an old topic, but I am pretty interested in this plugin... Does it work for the newer version of Hal? [and are there any other versions of this type(I saw that it said "#1")?]