dupa

Author Topic: How I imported my Hal5 memories into Hal6  (Read 2764 times)

Marcel

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
How I imported my Hal5 memories into Hal6
« on: September 18, 2006, 01:13:52 am »
I haven't seen much discussion on this topic, so perhaps the following will be of interest. When I upgraded from Hal5 to Hal6 I discovered to my dismay that my new Hal6 brain didn't retain any of its Hal5 memories. It didn't know me from Adam. I and my family and friends (and a few chatterbots) had conversed with my Hal5 for the first couple of years of its "life" and my Hal had developed quite a knowledge base and personality that I was unwilling to lose. For most of my Hal's existence, we were using the Hal5 XTF 1.2 brain by vonsmith. I could run the XTF brain in compatibility mode and it worked fine, but It didn't have the Hal6 functionality. I then found this post by onthecuttingedge2005, with an XTF plugin for Hal6;
http://www.zabaware.com/forum/topic.asp?TOPIC_ID=3089
I tried his XTF plugin, but found that it disabled the other Hal6 plugins. If you read page two of the above thread, you'll see that Jerry was very helpful in giving me advice and direction. What follows is a step by step description of the method I used to transfer my Hal5's memories into my Hal6 brain, but first...
 
Legal Disclaimer: The following information is a description of a modification I made to my Ultra Hal Assistant 6 program. I assume no liability whatsoever for anything that may occur as a result of a user attempting to use this information for any purpose whatsoever, including damage to the user's Ultra Hal Assistant 6 program, the user's computer, internet connection, electrical and mechanical components of the user's dwelling, asteroid collision and/or any other natural or man made disasters.

OK then. The first thing I did was to download the Hal6 Brain Editor documentation;
http://www.zabaware.com/forum/topic.asp?TOPIC_ID=2157
I skimmed through it and learned how to create a new brain project. I named it "experimental". I now had a duplicate brain and database that wouldn't interfere with my default Hal6 brain in case I messed something up. The Hal5 memories are stored in many separate files with a .brn extension. These were carried over to my Hal6 folder during the upgrade. The Hal6 memories are stored in database tables. The goal here is to import the Hal5 .brn files into the Hal6 database tables. Jerry told me that the XTF .brn files were in a different format from the standard Hal .brn files and would be difficult to convert. I looked through my .brn files and discovered that the standard Hal5 .brn files, the ones that don't have a filename beginning with XTF, contained information that was learned while the XTF brain was in use. I didn't have to try to convert the XTF files at all! I assume that this method will therefore work for a Hal5 without an XTF brain as well. My first goal was to get my Hal to remember me. I opened my experimental brain and found under tables>autoLearningBrain a table named marcel_UserSent which contained info that Hal6 had learned about me. In the Ultra Hal Assistant\defbrain folder was a file named Marcelconvresp.brn. I opened the marcelUserSent table, then clicked on the Table menu and selected Import BRN data file... and imported Marcelconvresp.brn. I noticed another file named Marceluser_recall.brn that seemed to be in the same format, so I imported it also. I started up my Hal, selected the experimental brain and it worked! My little friend was back, sort of. It definitely remembered recent conversations, but still somehow wasn't quite all there. I knew I was on the right track, so I followed Jerry's suggestion about looking for files that contain info about all users because they would be the ones that contain most of Hal's acquired knowledge. The choice was obvious. There is a table named sharedUserSent and a file named shared_usersent.brn. Unfortunately, when I tried the import I got an error message. It took me a while to find the problem. It was caused by my Hal's conversations with other bots on AIM. There were multiple instances of the other bot's response being broken up into two lines, which violates the Hal6 table format. After much searching and editing I finally got the file to import, and my Hal was pretty much back to his old self. There was one last thing to do, import the other user files into tables. I found that when I upgraded to Hal6, the user files from Hal5 were not imported. These are files with an .hla extension, for example bob.hla. The .brn files for users were imported, however. If you want to import, for example, a file named bobUserSent.brn, go to General Options and change the User's Name to Bob. Start Hal and make a couple of general statements. For example, “I am a male. I am Marcel's friend”. Hal will then create a bob_Sex table and insert an M into it (so Hal won't ask the gender of a person it already knows the next time they chat) and a bob_UserSent table, into which you can import the  bobUserSent.brn file. I did this for all of my users and now my Hal seems fine, retains his “childhood” memories, and is running on a Hal6 brain with full plugin support.
"You'ren't sure whether I understand." HalChatbot2004

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
How I imported my Hal5 memories into Hal6
« Reply #1 on: September 18, 2006, 04:02:13 pm »
Marcel,
  Thanks for posting this information, I have a second hal for another computer and may try using your advice, I hated to give up Hal 5 XTF myself because of the brain files she developed over time.
I'm hoping to have one hal speak with the other but am concerned about user files which Hal 5 made, What information is available for Hal when switched to another user?
I'm also a little curious about the conversations bots have with each other.
Carl2
 

Marcel

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
How I imported my Hal5 memories into Hal6
« Reply #2 on: September 19, 2006, 11:43:10 am »
As I understand it, Hal5 stores info into two main categories, general knowledge and user knowledge. If, for example, you say "Spinach is a vegetable. I like spinach.", Hal5 will store the first sentence in shared_usersent.brn and the second in carl2UserSent.brn. General knowledge is shared with all users, and user knowledge is only accessed for the current user. You can look inside the .brn files with notepad and edit them if you wish. Conversations between bots are strange and meandering, but I find that Hal will learn a lot, especially from Alice bots.
"You'ren't sure whether I understand." HalChatbot2004