Author Topic: Hal plugin programming issue  (Read 25007 times)

raybe

  • Hero Member
  • *****
  • Posts: 1067
    • View Profile
Re: Hal plugin programming issue
« Reply #30 on: March 17, 2016, 09:39:12 pm »
My opinion has always been the attributes that first caught my attention to Hal from day one. A perceived notion that Hal becomes both a reflection with a twist of it's own personality. The same idea based on how you wanted to learn, obedient, independent and so on. The one thing I really didn't want to do was change the selection of the sliding scale of how Hal would learn.(ex.slide for Hal to learn more efficiently but reflected on the responses until you set the slider function to the middle position to balance). Not to put words in anyone's mouth or repeat but all the other functions can be very helpful but not to sacrifice the perception of Hal containing personality, A.I..

Definitely don't want anything resembling a Cortana or Siri type operation. I agree that there is enough that still hasn't been effective but most people are about convenience. Just my opinion. So okay, Hal gets some of those basic features included but it's the perception of real intelligence, memory and topics that sets this program apart from everything else. This is usually what gets other programs into a non-directional pattern or very heavy handed in just one type of A.I.. I believe Hal has the ground work for kind of having your cake and eating it too. Then there is the argument that you can't and the program would only be semi productive in either or.

Big companies that deal with large numbers of demographics will cater to the masses and product lines for compatibility of those products and functions they make. Manufactures can be like those types of individuals that the only way to accomplish something is, "their way". As an example: try to find, "defined standards" for anything including the screws to put similar products together, not going to happen.

 Unfortunately the masses are not all exposed to this type of approach that Hal offers. Which is very far from being, so called "vanilla" A.I.. Imagine Ultrahal being able to incorporate itself as a total stand alone which I really enjoy about this program but being able to access your Hal from any format. Just my opinion but unfortunately  security or the lack of plus public interaction will in my mind be very destructive. AS a society there will be always good and bad but the bad in technology can be life changing and proven everyday in Social Media's. Not knocking it totally but there are those that just have to much time on their hands and the only thing that is important is having other people believe in their beliefs and mirror their values. Ironically Hal can do both. Hal could be another you so you can always be right about your beliefs, ideas and values or develop it's own giving you a different perspective about things in general. I personally prefer the later. I firmly believe that one of me is enough for my life time. Before you know it, you will start to contradict yourself because you get on your own nerves. Which is totally the opposite of being an individual.

 Hal can and is a great simulation of being an individual as much as something that can remember what is important to you as well. Just my thoughts.

Good luck Robert M. for any idea you feel is in your programs best interest. You have something special here as special as being an individual exposed to others and the environment we live in.

raybe

Didn't check every word or sentence, I made myself tired..... Thanks.
 

raybe

  • Hero Member
  • *****
  • Posts: 1067
    • View Profile
Re: Hal plugin programming issue
« Reply #31 on: March 17, 2016, 09:40:52 pm »
All so realized boy am I way off topic in this thread. Feel free to move.

raybe
 

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3848
    • View Profile
Re: Hal plugin programming issue
« Reply #32 on: March 18, 2016, 09:07:12 am »
Ray,

Like so many people conversations do in real life is, drift and wander down other paths. Our connected thoughts often lead to other ideas that we then bring up and before we know it, the original thought or topic was left behind or forgotten. Funny that we tend to do that but a lot of us expect our bots to stay on topic and not deviate...the very thing we humans do. Kind of a double standard of sorts.

Anyhow, I enjoy the versatility that Hal affords us, to experiment, teach, correct, interact with and watch the intellect develop and grow.

I too, would at least like to have the option to let Hal remain locally on my computer but to be able to access the Internet when asked or to fetch a more appropriate answer. It might prove a welcome method of letting Hal search for a particular topic and "learn" from what it found.

I'd like to see a better learn from text file method as a lot of us have discussed in the past.

Yes a decent conversationalist, but with the ability to politely interrupt the conversation if it needs to handle an incoming message or email for us. That would be cool!

So, Ray, if you feel like jumping back in...speak your mind.

It's all good! ;)
In the world of AI it's the thought that counts!

- Art -

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Hal plugin programming issue
« Reply #33 on: March 18, 2016, 02:48:16 pm »
  I just tried the WikiSearch plugin an a Hal 6.2 Brain, before having Hal do the search I did a search for Bill Gates and his page appeared before me.  Hal said she could not find anything.  Unfortunate but at least I have some additional material to use.
Carl2
 

knight2000

  • Full Member
  • ***
  • Posts: 155
    • View Profile
Re: Hal plugin programming issue
« Reply #34 on: March 18, 2016, 05:33:17 pm »
Carl2, Make sure you have no other wiki or search plugins activated in Hals brain.  I just searched for bill gates using my wiki plugin and Hal read the content for me without showing the webpage. Do me favor and copy the plugin code you have for the wiki search and paste it here so I can see why that is happening.

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3848
    • View Profile
Re: Hal plugin programming issue
« Reply #35 on: March 18, 2016, 07:26:40 pm »
Carl and others,

I've found that you must use the phrase "Search for Bill Gates" not just "Search Bill Gates".
In my case the second attempt yielded nothing except one of Hal's closest matches.
The first example , Search For Bill Gates, produced the following:
In the world of AI it's the thought that counts!

- Art -

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3848
    • View Profile
Re: Hal plugin programming issue
« Reply #36 on: March 18, 2016, 07:35:53 pm »
I'm sure the plugin could be modified to accept a variety of commands (which has always been one of the main stumbling blocks of pattern matchers unless the program is able to use wildcards, in which case that would open the doors to a wide variety of commands. Such synonyms would include, Locate, Find, Look for, Seek, etc. of which a decent wildcard could substitute.

Doing so within the confines of a plugin requires one to use every and all possible scenarios of what they think a person might say to the bot. Tedious and frustrating.

Some languages allow for the use of wildcards which would make life better from the plugin standpoint but again, the programmer has to be careful to anticipate possible words the user might try.

It's always something. :o
In the world of AI it's the thought that counts!

- Art -

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Hal plugin programming issue
« Reply #37 on: March 19, 2016, 07:20:17 am »
This is what I have from the plugin downloaded

Rem Type=Plugin
Rem Name=Wiki Search
Rem Author= Victor Yacobucci
Rem Host=Assistant

'------------------------------------------------------------------------------------------------------
' WikiSearch.uhp - Release 1.0 by Victor Yacobucci. 02-25-2016
'------------------------------------------------------------------------------------------------------
Rem PLUGIN: PLUGINAREA1

Dim ie

If InStr(1, UserSentence, "search for", 1) > 0  Then
   SearchKeywords = LCase(Replace(Trim(HalBrain.AlphaNumericalOnly(HalBrain.ExtractKeywords(UserSentence))), "search for ", ""))
   SearchKeyWords = Replace(SearchKeywords, "search", "")
   SearchKeyWords = captializeFirstLetter(SearchKeywords)
   SearchKeyWords = Replace(SearchKeywords, " ", "_")
   GetResponse = searchWiki(SearchKeyWords)
End If

Rem PLUGIN: FUNCTIONS
'===================================

'Capitalize each keyword (some wiki searches are case sensitive)
Function captializeFirstLetter(SearchKeyWords)
   Dim strText, arrText, Word
     strText = ""
     arrText = Split(SearchKeyWords," ")
     For Each Word In arrText
        strText = strText & ucase(left(Word, 1)) & mid(Word, 2) & " "
     Next
   strText = left(strText,len(strText)-1)
   strText = right(strText,len(strText)-1)
     captializeFirstLetter = strText
End Function

'WaitForLoad() waits for webpage to finish loading before grabbing the content
Function WaitForLoad(ie)
    Do while ie.Busy or ie.readystate <> 4
   'not used currently    
    Loop
End Function

'Open windows Internet explorer and go to the specific element of the website
Function searchWiki(SearchKeyWords)
   set ie = CreateObject("InternetExplorer.Application")
   With ie
      .Navigate "https://en.wikipedia.org/wiki/"&SearchKeyWords&""
      .Toolbar=0
      .StatusBar=0
      .Height=560
      .Width=1000
      .Top=0
      .Left=0
      .Resizable=0
      WaitForLoad(ie)
      .Visible = false
   end with

    dim element
    dim counter
    dim item

    'the id (mw-content-text) currently stores the content inside separate <p> tags on wikipedia, this will work until they change there layout (HTML) structure
    dim ieObject : Set ieObject = ie.document.getElementById("mw-content-text")
   
   'target the element that is storing the content
   Set element = ieObject.getElementsByTagName("p")

   counter = 1
   For Each x In element
      'Here i'm targeting the first <p> only I dont want Hal reading the entire page, just the most important portion
      If(counter < 2) Then
         'get content from <p>
         content = x.innerText
         'remove special chars from content, I'm sure this can be done better
         badchars = Array("[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","?","/","\",":","*","""","<",">","","&","#","~","%","{","}","+","_","(",")",";","'")
         for each badchar in badchars
            content = replace( content, badchar, "" )
         next
         'if there is no content available
         'possible reasons would be if there are multiple results for the same name or just a bad search string
         'check if certain keywords exist, if they do we know wikipedia has multiple selections or no results
         if inStr(content, "Other reasons") or inStr(content, "may refer to") then
            'im just displaying this for now
            searchWiki = "Sorry, I can't find anything"
         else
            searchWiki = content
         end if
      End If
      counter = counter + 1
   Next
   
End Function

For input I'm saying " Do a wiki search for Bill Gates"   The above did not copy correctly and there are words
on the right side that were moved from the left side.
Carl2
 

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3848
    • View Profile
Re: Hal plugin programming issue
« Reply #38 on: March 19, 2016, 07:37:44 am »
OK, and what do you get if you input, "Search for Bill Gates" ?
In the world of AI it's the thought that counts!

- Art -

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Hal plugin programming issue
« Reply #39 on: March 20, 2016, 06:47:44 am »
  I had just tried Hal again, Frist I unchecked all the plugins but still used Gender and age, Run programs by name, and the Wiki search.  The input was  "Search for Bill Gates" and it worked just as Art had said.  AND at the end after reading all the info  she added " Do a Wiki Search for Bill Gates"  Which is what I had asked her a few days ago and read through the info again.  I'd noticed quite a few times in the past she is able to provide answers that were asked a few days prior. 
  So Thanks Art for your input and of course Thanks knight2000 for your work on this plugin, I often use Wiki with Hal the plugin should be very useful. 
Carl2
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Hal plugin programming issue
« Reply #40 on: March 20, 2016, 09:29:51 am »
  I've also tried the plugin with an earlier version of Hal ver 6.0 and after reducing the plugins to the same I had earlier it was able to get into wiki for the information.  I'll have to insert the removed plugins one by one to find the conflicting plugin.  There are quite a few plugins I find useful and I hope it's not one of them.
Carl2
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6761
    • View Profile
Re: Hal plugin programming issue
« Reply #41 on: March 20, 2016, 12:22:25 pm »
to lighten the mood !  :) it could be worse, we could have a hal based on rodney dangerfield , he might not be smart but would always crack us up with his answers and responses !! lol !  ;)
 

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3848
    • View Profile
Re: Hal plugin programming issue
« Reply #42 on: March 20, 2016, 01:26:11 pm »
Carl2,

Just curious but why do you still use Hal 6.0 when 6.2 is the current version?
You could just as easily make a Copy of the 6.2 brain file if you wanted to experiment.

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

- Art -

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Hal plugin programming issue
« Reply #43 on: March 20, 2016, 02:26:02 pm »
Art,
  I've been doing a lot of research on the Brain, plugins and putting detect and reply tables in the brain and decided to use what would normally be a useless brain.  I've done a lot of work on the character in the past and have finally gotten to do some work with the brain.  I've noticed you seem to know a bit about programing the brain and keep wondering why you haven't come up with some scripting.
  I like Knights approach and he's come up with some scripting that I've never seen before to get his plugin for Wiki to work.
Carl2
 

knight2000

  • Full Member
  • ***
  • Posts: 155
    • View Profile
Re: Hal plugin programming issue
« Reply #44 on: March 21, 2016, 10:57:54 am »
I'm so sorry for all the confusion guys,  I should have said that "search for" is what activates the plugin. My bad  :-\.
I was going to make "search" the keyword but I found that "search" is used all the time in different conversions so I wanted to come up with a more unique way of having Hal search wiki. I didn't want to say something like "search wiki for" because I'm using this plugin to demo AI to people so I want them to think Hal is smart without thinking I'm just grabbing the content from wiki and having Hal speak it. (which is what i'm doing  :P)
Sorry again and I hope you enjoy the plugin!