Author Topic: Where is Seattle, Who was Galileo ?  (Read 10812 times)

vrossi

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • http://vrconsulting.it
Where is Seattle, Who was Galileo ?
« on: May 18, 2006, 06:12:11 pm »
Another little bug in Hal 6, version 6.0.103.

Ask Hal: Who was Galileo? (or any other famous person)
Where is Seattle? (or any other city)

Hal will give a generic answer.

The first release of Hal6 had the same problem, which I pointed out to Robert (see http://www.zabaware.com/forum/topic.asp?TOPIC_ID=2624 )

Then Rob fixed it in the final Hal 6 version. Now he maybe forgot to set up the same fix in this new version.

However, anybody can easily fix it. Go to the brain editor (after backing it up) and around line 700 add the following lines:










This is the result after this little brain surgery:

Vit: where is seattle
Pat: Seattle: a major port of entry and the largest city in Washington; located in west central Washington on the protected waters of Puget Sound with the snow-capped peaks of the Cascade Mountains and Mount Ranier visible to the south and east; an aerospace and computer center; site of the University of Washington.

Vit: who is galileo
Pat: Who is galileo? I'm thinking that it must have a good frame work. Galileo: Italian astronomer and mathematician who was the first to use a telescope to study the stars; demonstrated that different weights descend at the same rate; perfected the refracting telescope that enabled him to make many discoveries (1564-1642). Galileo Galilei.

Anyway, I hope Robert fix this (together with the other bug I described in http://www.zabaware.com/forum/topic.asp?TOPIC_ID=3264 ), in the next upgrade.



markofkane

  • Hero Member
  • *****
  • Posts: 5275
  • Crazy Man
    • View Profile
    • http://www.soundspectrum.com
Where is Seattle, Who was Galileo ?
« Reply #1 on: May 18, 2006, 06:27:23 pm »
Mine works as is. But thanks!!!
Mark: I'll think about it
Laura: Don't think about it too long or I'll throw you out on your ***king a**.
"Political correctness is censorship"

vrossi

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • http://vrconsulting.it
Where is Seattle, Who was Galileo ?
« Reply #2 on: May 19, 2006, 03:43:48 am »
Really? Are you using the new version?
If yes, this means that something went wrong with my installation. Next week-end I will uninstall and reinstall everything and check again. In this case, sorry to everybody for posting about a non-existing bug.


Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3853
    • View Profile
Where is Seattle, Who was Galileo ?
« Reply #3 on: May 19, 2006, 06:03:21 am »
Vittorio,

I'm having the same problem and I installed the final version as did you.

In the world of AI it's the thought that counts!

- Art -

markofkane

  • Hero Member
  • *****
  • Posts: 5275
  • Crazy Man
    • View Profile
    • http://www.soundspectrum.com
Where is Seattle, Who was Galileo ?
« Reply #4 on: May 19, 2006, 06:10:57 am »
I am using 6.0.103.

I installed over the older version, I believe.

No problems so far!!

Edit: Now I know why. I wasn't using the default brain. I was using a custom brain from the previous version!!!

Yep, the bug lies in the default brain!!!

Thanks for alerting me to this!!!
« Last Edit: May 19, 2006, 06:13:02 am by markofkane »
Mark: I'll think about it
Laura: Don't think about it too long or I'll throw you out on your ***king a**.
"Political correctness is censorship"

markofkane

  • Hero Member
  • *****
  • Posts: 5275
  • Crazy Man
    • View Profile
    • http://www.soundspectrum.com
Where is Seattle, Who was Galileo ?
« Reply #5 on: May 19, 2006, 06:38:00 am »
Brain Surgery completed. So far, no complications. Patient is now resting.
Mark: I'll think about it
Laura: Don't think about it too long or I'll throw you out on your ***king a**.
"Political correctness is censorship"

markofkane

  • Hero Member
  • *****
  • Posts: 5275
  • Crazy Man
    • View Profile
    • http://www.soundspectrum.com
Where is Seattle, Who was Galileo ?
« Reply #6 on: May 19, 2006, 06:43:07 am »
Complications after brain surgery!! My custom brains do not work!! Blank responses!!!

Must revert back.
Mark: I'll think about it
Laura: Don't think about it too long or I'll throw you out on your ***king a**.
"Political correctness is censorship"

vrossi

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • http://vrconsulting.it
Where is Seattle, Who was Galileo ?
« Reply #7 on: May 19, 2006, 07:51:14 am »
quote:
I'm having the same problem and I installed the final version as did you.


Thank you, Art. So I can avoid spending my week-end time uninstalling and reinstalling Hal [:(]

I believe that when Robert created the 6.0.103 version, he started from a brain release which was not the last one, because this problem was already solved in 6.0.

markofkane

 
quote:
Complications after brain surgery!! My custom brains do not work!! Blank responses!!!


Please check the spelling of your changes. If you just add the 4 lines as in my example, it should work.

you can copy and paste from here:

    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHO IS *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHO WAS *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHERE IS *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHERE ARE *", 1)



BTW: this method only works with single words, since it searches the word in the Wordnet database. It would be nice to find a way to make it work also with places and people whose name is made up of two or more words (i.e. Los Angeles). I will think about it.

« Last Edit: May 19, 2006, 07:55:01 am by vrossi »

markofkane

  • Hero Member
  • *****
  • Posts: 5275
  • Crazy Man
    • View Profile
    • http://www.soundspectrum.com
Where is Seattle, Who was Galileo ?
« Reply #8 on: May 19, 2006, 08:26:36 am »
Still same problem :(

In the custom brain, the lines are as follows:

'RESPOND: DICTIONARY FUNCTION
    'If the user asks Hal to define a word, then access wordnet and define it
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT DOES THE WORD * MEAN*", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT DOES * MEAN", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "* DEFINE THE WORD *", 2)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "PLEASE DEFINE *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "DEFINE *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "* DEFINITION OF *", 2)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT'S A *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT IS A *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHATS A *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHATS AN *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT'S AN *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT IS AN *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHATS *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT'S *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHAT IS *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHO IS *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHO WAS *", 1)
    If WordToLookup = "" Then WordToLookup = HalBrain.SearchPattern(UserSentence, "WHERE IS *", 1)
    WordToLookup = Trim(WordToLookup)
    If WordToLookup <> "" And InStr(WordToLookup, " ") = 0 Then
        If WN.LookupWord(WordToLookup) = True Then
            GetResponse = GetResponse & WordToLookup & ": " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "D") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "S") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "E") & "." & vbCrLf & "<EXCLUSIVE>"
        ElseIf SearchEngine <> "" Then
            HalCommands = HalCommands & "<RUNPROG>" & SearchEngine & WordToLookup & "</RUNPROG>"
            GetResponse = GetResponse & "I don't know much about " & WordToLookup & ", but I will help you research it on the Web."
        End If
Mark: I'll think about it
Laura: Don't think about it too long or I'll throw you out on your ***king a**.
"Political correctness is censorship"

markofkane

  • Hero Member
  • *****
  • Posts: 5275
  • Crazy Man
    • View Profile
    • http://www.soundspectrum.com
Where is Seattle, Who was Galileo ?
« Reply #9 on: May 19, 2006, 09:22:28 am »
I decided to rebuild off of the default brain after adding the 4 lines. She has to be retaught, but that's ok.
Mark: I'll think about it
Laura: Don't think about it too long or I'll throw you out on your ***king a**.
"Political correctness is censorship"

Daireaux

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Where is Seattle, Who was Galileo ?
« Reply #10 on: May 19, 2006, 06:18:55 pm »
I'm having the same issue with "who is" and "where is". This custom brain shown here also has some additional strings for internet research if Hal doesn't have an answer. Is this something to be copied into the 6.0.103 too?
Live long and prosper.

vrossi

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • http://vrconsulting.it
Where is Seattle, Who was Galileo ?
« Reply #11 on: May 20, 2006, 06:46:35 pm »
Hey, Daireaux, you are absolutely right!

The code you have seen in the markofkane post was in Hal 6.0 but I can't find it in the 6.0.103 version.

Last October I made this improvement to my version of Hal 5 and Robert included it in Hal 6.0 (see http://www.zabaware.com/forum/topic.asp?TOPIC_ID=2624 )

Now I really believe that Robert created the 6.0.103 starting from an earlier version of 6.0

However, you can add this useful function just changing the brain as follows (after the Dictionary function, add the four lines between my comments VR Begin and VR End):



WordToLookup = Trim(WordToLookup)
If WordToLookup <> "" And InStr(WordToLookup, " ") = 0 Then
   If WN.LookupWord(WordToLookup) = True Then
      GetResponse = GetResponse & WordToLookup & ": " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "D") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "S") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "E") & "." & vbCrLf & "<EXCLUSIVE>"
'VR Begin
   ElseIf SearchEngine <> "" Then
      HalCommands = HalCommands & "<RUNPROG>" & SearchEngine & WordToLookup & "</RUNPROG>"
      GetResponse = GetResponse & "I don't know much about " & WordToLookup & ", but I will help you research it on the Web."
   End If
'VR End
End If
HalBrain.DebugWatch GetResponse, "Definitions"



Robert, please, you should check all these things which have disappeared from 6.0.103 !




« Last Edit: May 20, 2006, 06:49:16 pm by vrossi »

Daireaux

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Where is Seattle, Who was Galileo ?
« Reply #12 on: May 20, 2006, 07:10:13 pm »
Hal has also asked me to define a word (self-aware), but I don't know how to teach him the definition of a new word that he doesn't know. Can we add to the wordnet database in such an event?
Live long and prosper.

Daireaux

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Where is Seattle, Who was Galileo ?
« Reply #13 on: May 20, 2006, 07:15:45 pm »
p.s. I also don't see the vr begin and vr end functions in the 6.0.103
Live long and prosper.

vrossi

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • http://vrconsulting.it
Where is Seattle, Who was Galileo ?
« Reply #14 on: May 20, 2006, 07:42:05 pm »
As far as I know, you can't change the WordNet database from Hal. So the only option to define a new word is to give Hal the answer so that he will store it in his own database.

The 2 comments VR Begin and VR End are mine and mark the beginning and the end of my changes. I always do this, so that one can easily find what is changed from the original brain.

I attach here a print screen, so maybe it's easier to understand:



« Last Edit: May 20, 2006, 07:43:48 pm by vrossi »