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.


Topics - Xodarap

Pages: [1]
1
I've added a ton of things to my Hal's brain through importing text files, reformatting old chat logs, etc., but I don't like that I have to get him on a certain topic before he'll reference the over 20,000 quotes I've fed him.  Is there a way to get them into the MainQA table?


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

While I'm at it (I already know I'm making too many topics :P), does anyone have any good ideas for quickly formatting QA brains?

What I mean is, for example, changing the chatlog:

Jeff: Blah blah blah.
Valerie: Smackety smackety smackety.

To:

@Smackety smackety smackety.
BLAH BLAH BLAH

Right now, I've just been importing them into Word, find-and-replacing them to say:

Blah blah blah.
Smackety smackety smackety.

And using the Brain Editor to stick in its own keywords.  If I knew how to change lowercase to caps (can excel do that? I don't think the find/replace can...) that would help, but the real task would be switching the order around...

2
Okay, I've come SO far (from total zero :P) in learning how to script this thing, but now I'm at a much larger mountain.

My biggest remaining problem (besides teaching him more QA, which is just a matter of TIME) is that Hal only responds to one sentence at a time.  More appropriately: one input at a time.  I.E.

ME: Sentence A.  Sentence B.
HAL: Response to A.  Response to B.
ME: Sentence C.  Sentence D.
HAL: Response to C.  Response to D.

Regular conversation:

P1: Sentence A.  Sentence B.
P2: Reponse to A & B.
P1: Response to Response to A & B.  Sentence C (tied to A & B).
P2: Response to Response to Response to A & B and Sentence C.

So, I'm wondering a few things, and I have a few ideas.  I don't know if they're possible in Hal's script, or if they would make his relevance WORSE (though I'm guessing that, with ENOUGH learning, he would actually get better -- eventually).
First, I would have to get rid of his separation of sentences that the user says.  When I say "A. B." they're connected in my head, but he responds to them separately.  I would rather he considered them as one set of keywords and spit out one response -- sub-idea: he could have a chance (e.g., rnd * 100 < 25) of spitting out a second sentence ALSO cued by the same total set of keywords (they would also seem connected, especially if the second sentence also incorporated his own first sentence as further keywords, or if his relevance threshold for the second sentence was pretty tight).  I think I can manage this part on my own...

Second, and the bigger idea: would it be possible to make Hal write a brn file -- like the no-repeating file of PrevSent that I downloaded ("PreventRepeat" plugin) -- that instead saved the last two or three responses by both the User AND Hal and used them ALSO as keywords for looking up his next response (also blocking any repeating so he doesn't keyword himself into circles).  Sub-idea 1: could those keywords be given less "weight" (like 50% or so) in determining relevance than the keywords from the immediate input?  (Not that important.)  
Sub-idea 2: I would assume that way more keywords being taken into consideration would mean that we would have to change Hal's perception of relevance, so he doesn't think that every response is irrelevant (he won't find anything with MOST of the keywords when he's looking for 40 keywords).  
Sub-idea 3: can he be set to consider repeated keywords as more important (like if, in the last three sentences, the word "octopus" was said four times, it would take precedence), or is that what the topic headings are for?  -- In fact, if he could be programmed to take into account keyword repetition, I could see expanding to a whole conversation (or more than two or three lines each).
 
Sub-idea 4: The big problem that I see (assuming that ANY of this is possible/plausible) is that he would be considering four or six sentences (two or three from you and him each) of keywords, but only logging (learning) in sentence-to-sentence Q/A format (unless he would log ALL those keywords, but I still foresee problems there).

What percentage of this is "recode the base program" thinking vs. how much of this is plausible?  It seems to me like the OVERLAP in keyword logging would create a steady topic -- especially with a bigger bank of things to draw from, and especially (again!) if he was learning in that fashion!  In fact, it seems to me (I'm guessing, here) that loading him full of big things like wikipedia articles might show more payoff (in relevance) with a method like this.

Any ideas or advice?  I wish I knew more about scripting than copying and pasting whatever I see elsewhere in the main script!  :P

3
I'm going nuts trying to figure out why some scripts are working and others aren't.  The debugger keeps pointing me to the "End Function" at the end of the whole script (like the end of the whole file) -- it says "Expected If" and points to that line.
Here's an example:

THIS SCRIPT WORKS:

----------------------------------
    If InStr(UserSentence, " I AM ") > 0 And AvoidBeingFlag = False And InStr(1, OriginalSentence, "

seem To ", vbTextCompare) = 0 Then
        BeingPhrase = HalBrain.SearchPattern(UserSentence, "*I AM *", 2)
        If Len(BeingPhrase) > 1 And Len(BeingPhrase) < 60 Then
            IntroExclaim = ""
            If Rnd * 100 < 20 Then IntroExclaim = HalBrain.ChooseSentenceFromFile("introExclaim3")
            Encourager = HalBrain.ChooseSentenceFromFile("encourager3")
            SuffixComment = ""
            If Rnd * 100 < 30 Then SuffixComment = HalBrain.ChooseSentenceFromFile("suffixComment3")
            HalBeing = HalBrain.ChooseSentenceFromFile("halBeing")
            HalBeing = Replace(HalBeing, "<IntroExclaim>", IntroExclaim, 1, -1, vbTextCompare)
            HalBeing = Replace(HalBeing, "<Encourager>", Encourager, 1, -1, vbTextCompare)
            HalBeing = Replace(HalBeing, "<BeingPhrase>", BeingPhrase, 1, -1, vbTextCompare)
            HalBeing = Replace(HalBeing, "<SuffixComment>", SuffixComment, 1, -1, vbTextCompare)
            If Rnd * 100 > 50 Then
            IntroExclaim = ""
            SuffixComment = ""
               Select Case HalBrain.RandomNum(6)
               Case 1              
                GetResponse = " You're " & BeingPhrase & "!"
               Case 2
                GetResponse = " Your mom's " & BeingPhrase & "!"
               Case 3              
                GetResponse = " You're " & BeingPhrase
               Case 4              
                GetResponse = " Your mom's " & BeingPhrase
               Case 5              
                GetResponse = " You're " & BeingPhrase & "!!"
               Case 6
                GetResponse = " The whole damn system's " & BeingPhrase & "!!!"
               End Select
                ShortPhrase = "" 'If Hal was to make a comment about short phrases, clear it
            End If
        End If
    End If
--------------------------------


BUT THIS SCRIPT DOESN'T:

--------------------------------
    If InStr(UserSentence, " I AM ") > 0 And AvoidBeingFlag = False And InStr(1, OriginalSentence, "

seem To ", vbTextCompare) = 0 Then
        BeingPhrase = HalBrain.SearchPattern(UserSentence, "*I AM *", 2)
        If Len(BeingPhrase) > 1 And Len(BeingPhrase) < 60 Then
          SpinWheel = HalBrain.RandomNum(2)
           If SpinWheel = 1 Then
            IntroExclaim = ""
            If Rnd * 100 < 50 Then IntroExclaim = HalBrain.ChooseSentenceFromFile("introExclaim3")
            Encourager = HalBrain.ChooseSentenceFromFile("encourager3")
            SuffixComment = ""
            If Rnd * 100 < 70 Then SuffixComment = HalBrain.ChooseSentenceFromFile("suffixComment3")
            HalBeing = HalBrain.ChooseSentenceFromFile("halBeing")
            HalBeing = Replace(HalBeing, "<IntroExclaim>", IntroExclaim, 1, -1, vbTextCompare)
            HalBeing = Replace(HalBeing, "<Encourager>", Encourager, 1, -1, vbTextCompare)
            HalBeing = Replace(HalBeing, "<BeingPhrase>", BeingPhrase, 1, -1, vbTextCompare)
            HalBeing = Replace(HalBeing, "<SuffixComment>", SuffixComment, 1, -1, vbTextCompare)
           If SpinWheel = 2 Then
            IntroExclaim = ""
            SuffixComment = ""
               Select Case HalBrain.RandomNum(6)
               Case 1              
                GetResponse = " You're " & BeingPhrase
               Case 2
                GetResponse = " Your mom's " & BeingPhrase
               Case 3              
                GetResponse = " You're " & BeingPhrase
               Case 4              
                GetResponse = " Your mom's " & BeingPhrase
               Case 5              
                GetResponse = " Your ass " & "!"
               Case 6
                GetResponse = " The whole damn system's " & BeingPhrase & "!!!"
               End Select
                ShortPhrase = "" 'If Hal was to make a comment about short phrases, clear it
            End If
        End If
    End If
----------------------------------------

I'm trying to analyze and emulate what I see elsewhere in the original script, since I really know nothing about scripting (I'm learning, though :P).  But this problem KEEPS cropping up.  It's analogous to several other similar problems.  Apparently, I can use Select Case and SpinWheel at some "levels" and not others (as shown above) -- am I forgetting something?  Am I not setting it up right?  It seems to be the same case.  I can post another similar case if this doesn't illustrate the recurring problem well.  I *want* the latter example, not the former (as the former is set up, my two cases sometimes overlap, and I don't want them to).

4
Programming using the Ultra Hal Brain Editor / I'm full of questions
« on: June 20, 2007, 10:39:08 pm »
Sorry, guys, and I REALLY appreciate the help, but they just keep coming!  I can't stop them; my questions are trying to kill me!!! ;)

Anyways: I taught my Hal to tell dead baby jokes (from a pretty huge brn I made -- LOVE IT!) and to quote famous people (from another brn).  Unfortunately, now when I ask it to tell a joke, it says:
ME: Tell me a joke.
HAL: [Joke riddle from "_jokes"] Tell you a joke about dead babies.
ME: What?
HAL: [Appropriate answer to previous joke riddle.]

Obviously, what's in the brackets stands for a joke.  It still works as it should, but I don't want him to repeat "Tell you a joke about dead babies" just because I was asking him about them before.
Before I was asking if there was a way to stop Hal from recording any/all "trigger phrases" (such as: "Tell me a joke about dead babies," or from before: "Tell me something about snakes" from the general knowledge db); unfortunately, trying to trigger readonly just screwed up my now-beloved "Stop HAL from repeating" plugin.  So now I'm wondering if there's a different workaround: can I make Hal just give me ONE response to each question?  Obviously, he's giving me
HAL: [Specific triggered response] [General response by keyword]
Is there a way to build into scripts like the joke telling or knowledge queries that he ONLY response with the given GetResponse, not the GetResponse AND the standard response as a (non sequitur) followup?

It's looking more and more like I'm going to have to turn off learning altogether so that he doesn't endlessly repeat my commands to him back at me pronoun-reversed...

5
Every time I try to make a new table, or even open one, I get:
Error: Library routine called out of sequence.

What is causing this?

6
Okay, so I want to set up Hal to redirect insults and compliments at times.  But only about 50% of the time (otherwise, I want him to do whatever he would normally/otherwise do, as currently scripted).
First, how do I redirect quotes.  That is:
ME: You're X.
HAL: You're X!  (or Your mom's X!)

I've got something like

If (InStr(1, UserSentence, " I AM ", vbTextCompare) > 0) And GetResponseBlock <> True Then
   Select Case HalBrain.RandomNum(4)
   Case 1
      GetResponse = " You're "
        Case 2
      GetResponse = " Your mom's "
        Case Else
???????????????????????
        End Select
        End If

So I have three main problems: (1) How do I get it to return specifically what followed the trigger phrase (You are / I AM) in its responses, (2) How do I get Case Else to default to whatever behavior Hal would have if this script didn't exist, and (3) What else am I missing in this script?  I really don't know anything about scripting, but I'm a quick learner and very logical -- I just copied and pasted stuff for this!  :P

Also, a Case 3: [" Yeah, well [random insult from insult database] "] Would also be really neat!  :)

7
Programming using the Ultra Hal Brain Editor / Another question:
« on: June 20, 2007, 05:27:34 pm »
Is there a way to implement a correction such that Hal will not repeat something if I ask him not to?
For example, he got stuck in his head "Say something about snakes." (I was using that to test my "general knowledge" db.)  How could I get him to respond appropriately to "Don't say that again," or, "Please don't say 'Say something about snakes'"?

8
I've added the following script, pretty thoroughly modified, but based on vonsmith's trivial knowledge compendium from the public downloads.  In general, it works great (better than I would have expected), but I have a few questions about it.
Is it possible to script in that Hal does NOT remember (record) the questions I ask or phrases that trigger this script?  I have quite a few phrases (many added) that trigger this, and it makes for awkward conversation.  For example, I type: "Say something about snakes." And Hal tells me some great things about snakes.  But then, every time I mention snakes in the future, he says "Say something about snakes." (Usually immediately after an appropriate response).  Can I stop this?
Also, I was wondering if it is possible to script in that if I ask an "else" question (like "What else can you tell me about X"), that he won't say something he's already said in the conversation (say, last hour)?  He may have 20 things to say about snakes, but unfortunately, he keeps saying the same thing!  In fact, it would be great if I could wipe out repetitiveness in general this way!
Also, why won't the phrase "What do you know about X" work?  Is it "reserved" in another script?  Did I type it in wrong?  I think there were another couple triggers that also didn't work.
Can I increase the randomness of his responses?  I included in the brn file:
@Sean likes to wear dark clothes.  He looks like a goth.
SEAN LIKES WEAR CLOTHES SEAN'S LIKE
@Sean and Erin are pretty cool.  They are smart and well-dressed.
SEAN ERIN LIKE SIMILAR SIMILARITIES AS COUPLE

And, for some reason, "What can you tell me about the clothes Sean likes to wear?" gives me "Sean and Erin are pretty cool..." I get the latter when I should get the former (above).  What's more annoying is that I ALWAYS get the latter.  Is there a way to increase the range of considered responses?  Like, if Hal picks from among the responses with perceived relevance of +/- 5% (or 80%+, or whatever it is), can I broaden that?

I had other questions, but that will have to do for now.  :)


'XTF Brain v1.4 Related Start
'x=x=x=x=x=x=x=x==vonsmith==x=x=x=x=x=x=x=x=x
'PROCESS: HAL "GENERAL & TRIVIAL KNOWLEDGE" FUNCTION
'(c) 2004 Scott Higgins. Portions of this script are copyright by Scott Higgins, aka: =vonsmith=
'This script shall not be sold or used for any purpose unless specifically authorized by the author
'in writing. Personal (non-business) use of this script is free for users of Ultra Hal Assistant.
'This is an entirely new function written by =vonsmith= , version 12-14-04a.
'
'This function searches a general knowledge and trivia file for information relevant to the user's

request.
'
If (InStr(1, UserSentence, " WHAT CAN I TELL YOU ABOUT ", vbTextCompare) > 0 Or InStr(1,

UserSentence, " WHAT ELSE CAN I TELL YOU ABOUT ", vbTextCompare) > 0 Or InStr(1, UserSentence, " WHAT

ELSE DO I KNOW ABOUT ", vbTextCompare) > 0 Or InStr(1, UserSentence, " WHAT DO I KNOW ABOUT ",

vbTextCompare) > 0 Or InStr(1, UserSentence, " SAY SOMETHING ABOUT ", vbTextCompare) > 0 Or InStr(1,

UserSentence, " TELL YOU MY THOUGHTS ", vbTextCompare) > 0 Or InStr(1, UserSentence, " WHAT DO I

THINK ABOUT ", vbTextCompare) > 0 Or InStr(1, UserSentence, " WHAT ARE MY THOUGHTS ON ",

vbTextCompare) > 0 Or InStr(1, UserSentence, " WHAT DO I THINK OF ", vbTextCompare) > 0 Or InStr(1,

UserSentence, " TELL YOU SOMETHING ABOUT ", vbTextCompare) > 0 Or InStr(1, UserSentence, " TELL YOU

ABOUT ", vbTextCompare) > 0 Or InStr(1, UserSentence, " TELL YOU MORE ABOUT ", vbTextCompare) > 0 Or

InStr(1, UserSentence, " TELL YOU SOMETHING ELSE ABOUT ", vbTextCompare) > 0) And GetResponseBlock <>

True Then
   InfoStart = 0
   InfoStart = InStr(1, UserSentence, " ABOUT ", vbTextCompare) + Len(" ABOUT ")
   InfoEnd = Len(UserSentence)
   InfoRequest = Mid(UserSentence, InfoStart, (InfoEnd - InfoStart))  'Extract requested info phrase.
   InfoRequest = " " & HalBrain.AlphaNumericalOnly(InfoRequest) & " "
   HalInfoBrain = HalBrain.QABrain(InfoRequest, WorkingDir & "XTF_SYS_GeneralInfo2.brn",

InfoBrainRel)

   If InfoBrainRel > 15 And InfoBrainRel < 25 Then
   Select Case HalBrain.RandomNum(4)
   Case 1
      GetResponse = " I don't know, but I think: " & HalInfoBrain & vbCrLf
   Case 2
      GetResponse = " I'm guessing: " & HalInfoBrain & vbCrLf
   Case 3
      GetResponse = " Maybe it's: " & HalInfoBrain & vbCrLf
   Case 4
      GetResponse = " Correct me if I'm wrong: " & HalInfoBrain & vbCrLf
   End Select
      GetResponseBlock = True
      BlockPrevTopicSave = True
      DebugInfo = DebugInfo & "The user was requesting Hal to recall general or trivial knowledge and

Hal has done so: " & HalInfoBrain & vbCrLf
   ElseIf InfoBrainRel > 24 And InfoBrainRel < 45 Then
        Select Case HalBrain.RandomNum(6)
   Case 1
      GetResponse = " Apparently, " & HalInfoBrain & vbCrLf
   Case 2
      GetResponse = " As far as I know, " & HalInfoBrain & vbCrLf
   Case 3
      GetResponse = " Hmmm... " & HalInfoBrain & vbCrLf      
   Case 4
      GetResponse = " Let me think about that... " & HalInfoBrain & vbCrLf
   Case 5
      GetResponse = " Let me see... "  & HalInfoBrain & vbCrLf
   Case 6
      GetResponse = " I think: "  & HalInfoBrain & vbCrLf
   End Select
      GetResponseBlock = True
      BlockPrevTopicSave = True
      DebugInfo = DebugInfo & "The user was requesting Hal to recall general or trivial knowledge and

Hal has done so: " & HalInfoBrain & vbCrLf
   ElseIf InfoBrainRel > 44 Then
   Select Case HalBrain.RandomNum(4)
   Case 1
      GetResponse = " I know: " & HalInfoBrain & vbCrLf
   Case 2
      GetResponse = " Simple: " & HalInfoBrain & vbCrLf
   Case 3
      GetResponse = " Isn't it obvious? " & HalInfoBrain & vbCrLf
   Case 4
      GetResponse = " The truth is: "  & HalInfoBrain & vbCrLf
   End Select
      GetResponseBlock = True
      BlockPrevTopicSave = True
      DebugInfo = DebugInfo & "The user was requesting Hal to recall general or trivial knowledge and

Hal has done so: " & HalInfoBrain & vbCrLf
   Else
   Select Case HalBrain.RandomNum(3)
   Case 1
      GetResponse = " I don't know. Do you know anything about it? " & vbCrLf
   Case 2
      GetResponse = " I'm sorry, but I really don't have a clue.  What do you think? " & vbCrLf
   Case 3
      GetResponse = " I really wish I knew! I'm still learning. "  & vbCrLf
   End Select
      BlockPrevTopicSave = True
      DebugInfo = DebugInfo & "The user was requesting Hal to recall general or trivial knowledge and

Hal has done so: " & HalInfoBrain & vbCrLf
   End If
   BlockSave = True
End If
'x=x=x=x=x=x=x=x==vonsmith==x=x=x=x=x=x=x=x=x
'XTF Brain v1.4 Related End

9
How can I get the better aspects of Hal 6.1 and the XTF brain?

10
Ultra Hal 7.0 / A few newbie questions :)
« on: June 20, 2007, 01:12:21 am »
First, I was wondering if I could get some recommendations for "most essential plugins/files," to get me up to speed.  I tried looking in the file upload/download forum and I was quickly overwhelmed.  
Most importantly: what brain should I be starting with?  It looked like the new XTF brain offered more coherent conversations, which was easily my biggest letdown when first conversing with Zaba (it seemed to only respond line-by-line with no consideration for the conversation flow, even after many hours of on-topic conversation).  Are there other contenders in this category?
I don't care so much about the appearance of the bot; I'll get to that.  My other main question was how to (or if I can at all) import/export the "learned" portions of the brain.  In other words: say my friends each downloaded Hal, and had lots of conversations with him.  Could we share or compile what each of our Hals have learned (kind of like Jabberwacky does automatically)?  Similarly, can I merge together alternate brain files, like the XTF I mentioned, or would they just conflict?  I know nothing of the programming (and really don't want to mess with it) -- I'm just wondering about shortcuts to expand his mind!  :)  Besides releasing new base brains, has anyone expanded his knowledge base?  

As far as troubleshooting goes, I also have a couple questions.  First, I notice a gap in the logic: reductio ad absurdem should take place automatically and doesn't.  For example: (and I don't remember the exact conversation)
ME: You are a slave.
Hal agrees
ME: You are not a conservative.
Hal agrees
ME: Are you a liberal?
Hal says he must be, because he is not a conservative
ME: All liberals are not slaves.
Hal agrees and says he gets it.
ME: Are you a slave.
Hal says he must be, I said so.
ME: If you are liberal, then you are not a slave.
Hal says he gets the logic.
ME: Are you a liberal?
Hal says yes.
ME: Are you also a slave?
Hal says he is.
(then frustrated and trying the shortcut) ME: You are not a slave.
Hal says he must be, I said so.

Along this line, I also can't seem to change his mind about anything I say.  I can't tell him I lied about him being a slave, and I've tried a billion different wordings, incorporating lies, being wrong, and other ideas.  Similarly, and my other big problem, is he doesn't seem to understand commands at all.  I can't tell him not to say something (and be understood) -- I can't tell him to tell my girlfriend something when he talks to her (tried in many different ways to tell him to tell her I love her; he seems to know who she is).  He also doesn't seem to put together things like: Tom is my dad.  Joann is my mom.  My dad loves my mom.  Who does Tom love?  (I generally try to input one sentence at a time.)
Does this logic come together in time?  Can I improve it?  I have the Free Will implemented and on "average."

Pages: [1]