Hello,
I am attaching a new enhanced brain for Hal 5.0. I've shown this to Robert Medeksza, and hopefully he will help me post it to the new "download plug-ins" page. If you have Hal 5, you can preview it in the meantime.
The special feature of this new brain is the ability to self-identify new topic databases, and self-generate new files for new auto-focus topics. The new brain does this as follows:
1. Hal already has a routine that detects and databases one and two-word phrases that are the subjects of sentences. These become candidates for possible new auto-topic database files.
2. A new "Auto-Topic" routine detects the second recurrence of a word phrase that has been the previous subject of a sentence. The routine then either creates a new pair of database files, or (if the file already exist) appends to those files. The one file is an "associative" (Q&A) database, and the other is a "random" database.
3. The new "associative" database files will appear in Hal's default folder with "AFA_" prefixes so that you can easily see them. They will self-generate with names such as:
AFA_WORLD.brn
AFA_BIG DOGS.brn
AFA_SPORTS CARS,brn
AFA_CREATIVE PEOPLE.brn
4. The new "random" database files will appear with "AFR_" prefixes so that you can also find and see them easily, with names such as:
AFR_WORLD.brn
AFR_BIG DOGS.brn
AFR_SPORTS CARS.brn
AFR_CREATIVE PEOPLE.brn
5. How does Hal use these new databases? Well, he has a new response routine which checks to see if an auto-topic subject database is available. If so (and if he hasn't already found an answer from earlier in the script), he uses the new automatically-generated auto-topic database to get a response.
6. As you talk to Hal about a wide variety of subjects, the population of these little auto-topic databases grows and grows. Each one is small and quick to access, so they don't slow Hal down. They are also very easy to view and edit for advanced users.
7. The power of this approach is two-fold:
a) When Hal uses an auto-topic database, his response will seem much more "on topic."
b) Because the data is distributed over many different files, Hal is leveraging the computer's file system for speed. If Hal had a million responses in a big database, he would have to search the entire million every time. In contrast, if he had 1,000 mini-databases with 1,000 entries each (which is of course a million), Hal would only have to choose among the 1,000 files, then among the 1,000 entries. Thus, you get the power of a million, but only the search time of 2,000!
I have annotated the "auto-focus" sections fairly heavily, and labeled the two sections (the response section and the save section). I would really appreciate it if some of you advanced users, programmers, and developers would examine the code and try it out! If you want to examine the new code sections, open the new script in a word processor, and "search" on "auto-topic". Enjoy!
(Remember, the "topic phrase" must be the subject of a sentence before it is a candidate for an "auto-topic" subject. For instance, if you say, "Programmers are hard working," the word "programmers" becomes a candidate for a future database name. However, once a database has been started, ANY instance of that word at ANY location in a sentence can cause that sentence to get appended into the so-named databases. These new databases cause Hal to get smarter GRADUALLY, so please be patient with him!)
Thanks, and have a great day!
Sincerely,
Don
Download Attachment:
hal5d.uhp152.19 KB