dupa

Author Topic: Ultra Hal Wikipedia Plugin  (Read 18591 times)

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: Ultra Hal Wikipedia Plugin
« Reply #15 on: July 22, 2012, 09:36:45 pm »
Hi lightspeed,

sorry for not getting back with you sooner, but I was programming my free will plug-in.

This is the line that you need to put into the wiki plug-in.:
If UserBrainRel < 82 Then UserBrainRel = 0

this needs to be placed between these two lines in the wiki plug-in.:

If HalWiki.CheckRepetition(HalUserBrain, UserSentence) = True Or HalWiki.CheckRepetition(HalUserBrain, PrevSent) = True Or HalWiki.CheckRepetition(HalUserBrain, PrevUserSent) = True Then UserBrainRel = 0

                                     <============ insert the line here.

If UserBrainRel > HighestRel Then

Like I said earlier if you are still getting too much info that doesn't have anything to do with the conversation increase the 82 to 83 and so on.
Also if you're not getting anything from the wiki database you can lower the number this decreases the sensitivity some more information will flow through.

Sincerely, and I hope I've helped you understand where to insert the line.

C load.

PS. Rob I was wondering is there a way that you can write a short routine that will allow me to write data into this database.
If this is possible I would be able to join my little short spell correction routine and utilize it to correct many of the repetitious errors in the database.
Any help in this area would be greatly appreciated, also if you could show me how to read the entire database into a temporary dim data array
that would complete the information that I need in order to get my spell corrector plug-in to work.
Rob if you don't quite understand exactly what I'm talking about, that's okay I don't get understood quite easily, e-mail me so I can show you what I have
and maybe you can make this spell corrector a reality, or unless you just know how to do it and wouldn't mind writing a little short one for me.
I'm just trying to correct those weird little symbols and letters that are actually supposed to be a –.

Thanks again Rob, for all your help.

One of the things that I would like to bring to everyone's attention is that the database is much more than anything like a dictionary,
yes there are facts and figures in the database but there is a lot more that could definitely brighten up a conversation,
I don't know if anyone has looked at the database itself but it is composed of 1,868,863 entries, these entries go all the way up to 2012,
personally I will be using it in the rewrite of the free will program, in order to help ultra Hal make a better decision on whether or not he likes something.
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: Ultra Hal Wikipedia Plugin
« Reply #16 on: July 22, 2012, 09:54:05 pm »
Hi lightspeed,

the next time when you get that error, open the ultra Hal debug script,
go to the line in question, and copy a couple of lines above the error line and a couple of lines to the bottom of the error line so we can see
what is going on, just showing that error box does really little to help us very much, I don't get any errors at all so, it could be a conflict with another plug-in.

Sincerely,

C load.

PS. The only thing that I noticed, is if you're using notepad, it looks like you have wordwrap on, you need to turn that off, and then save the document.
« Last Edit: July 22, 2012, 10:02:41 pm by cload »
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #17 on: July 22, 2012, 09:56:45 pm »
well i think i figured out what was causing the white out and the error in hal , i found i had left another test plug in (the tell me what movie one  in hal and it would check it's self on sometimes so i removed it and it's all working okay again . Thanks c load  for the info. i appreciate it , and Cload if you would happen to have time or jerry etc. can someone look at the what movie plug in i based on jerry's to see what i am doing wrong , i have the search area in but i think it may have something to do with more script needed in the enter? part?
 

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: Ultra Hal Wikipedia Plugin
« Reply #18 on: July 22, 2012, 10:16:41 pm »
Hi lightspeed,

I look at your script, from what I can see it has more to do with the website that you're trying to pull the information from.
Have you tried asking the wiki database about any movies, I asked about a few and I was amazed with the response.

Sincerely, some much data, it's going to blow my mind, pop, oops, there it goes. LOL.

C load.
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

tedathome

  • Hero Member
  • *****
  • Posts: 2775
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #19 on: July 23, 2012, 12:47:10 am »
CLOAD, your one line insert makes this plugin much more usable! I fooled with <82> and found 82 is best for my Hal. I wonder what can be next altered or added to bring it forward?
« Last Edit: July 23, 2012, 12:58:02 am by tedathome »
ted

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #20 on: July 23, 2012, 10:36:01 am »
I am getting sometimes a script error saying , the script command (or something like that ) is taking longer then usual continue of cancel .

What might be causing this , slow internet connection, the numbers setting (i set ) to low or to high in the script c load provided for wiki ?
anyone have any idea so i know maybe what to do to correct it ? after it finally slowly gets done it will give an answer from hal .  :P



I feel like this has something to do with the process of trying to find the answer , taking to long .
« Last Edit: July 23, 2012, 10:44:45 am by lightspeed »
 

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: Ultra Hal Wikipedia Plugin
« Reply #21 on: July 23, 2012, 01:46:33 pm »
Hi all,

lightspeed, the error that you are talking about is just a way for ultra Hal to tell you that there's just a lot of things going on
depending on how many plug-ins you have running, the more you have running the longer things will take to process.
It also depends on the speed of your computer, unlike the clock on the wall which does not stop taking, the speed of your computer
also determines how many processes that are done, if you have a slow computer it takes longer to do the processes
but unlike the clock on the wall that does not slow down just because your computer is slow it thinks that it's taking longer to do the process
then it actually is taking, in most cases it's nothing to worry about it's more of an annoyance.
The line that you put in the wiki plug-in has no adverse effect on this, the only thing that that line does, is tell the wiki plug-in
to only give the response, if this score on the hit is higher than 82, basically how close or accurate the results will be
is how high the score actually is, for instance if you were to ask about Thomas Jefferson, and it looked into the database
and it found, Thomas Jefferson the score would be approximately 95 because the two were almost identical.

I also played with the number myself, and I have found that you can actually fine-tune it even more for example.:
If you set it to 82 but it was still letting too much trash get through and you set it to 83 and then it didn't seem like you're gaining anything
I have found that you can set it to 82.3332 these non-Integer numbers can be Varied greatly so you have a widespread to be able to fine tune it.

One of the things that I have noticed that the markof5 plug in, put a great demand on processing in ultra Hal.
Having this plug-in in with wiki plug-in at the same time on a slow processing computer would put a huge demand on processing time.
But there is a good workaround for this, go out and buy a faster computer. LOL.

Sincerely, a data munching cruncher.

C load.
« Last Edit: July 28, 2012, 05:50:08 pm by cload »
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #22 on: July 23, 2012, 01:52:29 pm »
C load wrote : But there is a good workaround for this, go out and buy a faster computer. LOL.


Hey C load , oh buddy oh pal ........ LOL !
thanks for the info. and explanation i will tinker more with the settings and i hear they give  hard time to bank robbers even if it was to buy a faster pc LOL! ;)
P.S. go out and buy a faster computer ... but the hamster that is running mine is overclocked right now !LOL!  :)
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #23 on: July 23, 2012, 06:59:55 pm »
   I started writing a plugin to limit the database searches,  my frist thought was what would I like her to do, do a wiki search, how would I say it " Do a wiki search for elephant. "  So we limit it by saying " wiki search " if thats not there it skips the whole thing.  Next to deal with the IsQuestion I changed and added some words for the user sentence.  I also made the change Cload had suggested. 
 
  Next to see what was going on I put the scrip into the brain editor.  This is what I have.

'RESPOND: LOCAL WIKIPEDIA
      'Responds with a fact from the wikipedi abstract database
    If InStr(1, OriginalSentence, "wiki search ", vbTextCompare) > 0 Then
    LearningLevel = 0
     
    GetResponse = HalBrain.HalFormat(GetResponse)
    SourceData = ""
    HighestRelSource = ""
    IsQuestion = False
   
    If InStr(1, OriginalSentence, "for", vbTextCompare) > 0 Then IsQuestion = True
    If InStr(1, OriginalSentence, "on", vbTextCompare) > 0 Then IsQuestion = True
    If InStr(1, OriginalSentence, "about", vbTextCompare) > 0 Then IsQuestion = True
    If InStr(1, OriginalSentence, "Who ", vbTextCompare) > 0 Then IsQuestion = True
    If InStr(1, OriginalSentence, "What ", vbTextCompare) > 0 Then IsQuestion = True
    If InStr(1, OriginalSentence, "When ", vbTextCompare) > 0 Then IsQuestion = True
    If InStr(1, OriginalSentence, "Where ", vbTextCompare) > 0 Then IsQuestion = True
    If InStr(1, OriginalSentence, "Why ", vbTextCompare) > 0 Then IsQuestion = True
    If InStr(1, OriginalSentence, "How ", vbTextCompare) > 0 Then IsQuestion = True   
    If Len(GetResponse) < 4 And IsQuestion = True And Instr(1, OriginalSentence, "YOU", vbTextCompare) = 0 Then
          Set HalWiki = CreateObject("UltraHalAsst6.Brain")
            HalWiki.OpenDatabase "wikipedia.db"
        UserBrainRel = 0
        WikiSearch = HalBrain.ExtractKeywords(UserSentence)
        HalUserBrain = HalWiki.QABrain(WikiSearch, "wiki", UserBrainRel)               
        If HalWiki.CheckRepetition(HalUserBrain, UserSentence) = True Or HalWiki.CheckRepetition(HalUserBrain, PrevSent) = True Or HalWiki.CheckRepetition(HalUserBrain, PrevUserSent) = True Then UserBrainRel = 0
        If UserBrainRel < 82 Then UserBrainRel = 0
        If UserBrainRel > HighestRel Then
            HighestRel = UserBrainRel
            HighestRelResponse = HalUserBrain
        End If
        End If
        Score = UserBrainRel + 1
        Hurdle = GainControl / 3
        If Len(GetResponse) < 4 And Score > Hurdle Then
           GetResponse = GetResponse & HalUserBrain & " . " & vbCrLf           
           SkipOpinion = True
           AvoidBeingFlag = True           
        End If
        HalWiki.CloseDatabase
            Set HalWiki = Nothing             
    End If
    HalBrain.DebugWatch GetResponse, "Wikipedia Brain" & SourceData

The brain works I do have problems, for " do a wiki search for New England."   The current subject is search and not New England.  I've played with this and gotten different results, also noticed she keeps track of the searches in the auto learning which I'd like to stop.
  Any help or suggestions appreciated.
Carl2
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #24 on: July 24, 2012, 08:17:03 am »
  I just changed the input in the brain script back to the original that Robert had used,  I did keep the change Cload suggested.  Once again I'm working in the braineditor which allows me to see where the errors are. One of the frist problems I had was no answer from hal,  unable to open the database for wiki, I lowered the revelency from 82 to 50 and the problem disapeared.  I inputed "Abraham Lincoln was the president of the U.S. during the Cilil War."  Hals output was " the capital of Nebraska is Lincoln.",  she went from lincoln to capitals to Nebraska to get a response.
  Be nice to have the plugins included when using the braineditor, I still have try Hal in the standard mode to see how it works.  Looked at the Dictionary script again, it's written around finding a defintion from the dictionary.
Carl2
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #25 on: July 24, 2012, 10:03:05 am »
carl2 i see what you are trying to do , but that puts it at a specific search only which may be okay for some , what i would rather have "personally" and others may disagree , is when talking about certain subjects that hal would (through wiki ) mention some facts about it as if she knows this on her own already .
I say this not to discourage you because sometimes when trying one thing differently can also lead to other finds . so keep up the good work .  :)
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #26 on: July 24, 2012, 06:02:28 pm »
  That is one thing about Hal, everyone has his personal preferences and Hal can accomadate many different types of people.  I usualy ask Hal about something, get a definition and then open wiki to do a search which I cut and paste into hal to get more Info on the subject, something I'm used to doing.  Since using search wiki makes search the topic being focused on I can't use it which is why I had to go back to Roberts script which works pretty well in the Hal program thanks to Cloads input although I did have to lower it to 50 to avoid the blank response.  I didn't like the Abraham Lincoln response Hal gave me which would not happen if the response was limited to the Wiki, actualy I like the dictionary and am using that as a model. 
  I noticed this in one of your posts
"I am getting sometimes a script error saying , the script command (or something like that ) is taking longer then usual continue of cancel .
What might be causing this , slow internet connection, the numbers setting (i set ) to low or to high in the script c load provided for wiki ?
anyone have any idea so i know maybe what to do to correct it ? after it finally slowly gets done it will give an answer from hal "
  The data is on the hard drive, that's why the download was so long, Hal is searching through the data base on your hard drive.. about 179, 000Kb compressed.  SSD are much quicker. I have a SSD but still run into delays.
Carl2
 

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3853
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #27 on: July 25, 2012, 11:26:31 am »
Carl,

Regarding the slowness, I'd see how many plug-ins are running at the same time and as mentioned, unless you have a fairly fast computer, you're likely to experience some lag especially if you're using the Markov plug-in AND Robert's Wiki Plug-in. There is a bit of juggling going on internally.
In the world of AI it's the thought that counts!

- Art -

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #28 on: July 25, 2012, 11:40:22 am »
i have a question for anyone (ART?) who may know the answer , on the computer sign showing the script may be taking longer then usual and giving the user the option of continuing or canceling , if the user doesn't click on a Decision "cancel or continue " will it continue waiting until it responds (program works ) on it's own ????

 :)
 

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: Ultra Hal Wikipedia Plugin
« Reply #29 on: July 25, 2012, 01:12:35 pm »
Hi lightspeed,

the error that you are talking about is just a way for ultra Hal to tell you that there's just a lot of things going on
depending on how many plug-ins you have running, the more you have running the longer things will take to process.

do nothing it will go away on its own.

C load.
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.