Zabaware Support Forums

Zabaware Forums => Programming using the Ultra Hal Brain Editor => Topic started by: knight2000 on March 02, 2016, 12:15:27 pm

Title: Hal plugin programming issue
Post by: knight2000 on March 02, 2016, 12:15:27 pm
Hi guys, I'm stumped!! I'm trying to create a hal plugin that will go out to wikipedia and grab a portion of the content and display it. I created a vbscript program that does this and works fine on its own, however when I try to put it in a uhp file and add it as a plugin it doesn't work, so many different errors no matter what I do. Below is the code, please let me know there is a way to get it working.


Rem Type=Plugin
Rem Name=KITT Wiki
Rem Author= Victor
Rem Host=Assistant

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

vrToSearch = ""
vrToSearch = UCase(HalBrain.SearchPattern(UserSentence, "*search for*", 2))
GetResponse = "searching for "& vrToSearch &" "


'    Declaration of variables
Dim ie
 '    Declaration of subroutines
'    Sub WaitForLoad waits for webpage to finish loading
'    before proceeding with next line of code
Sub WaitForLoad
    Do while ie.Busy or ie.readystate <> 4
        wscript.sleep 2000
    Loop
End Sub
 '    Open windows Internet explorer and surf to website
set ie = CreateObject("InternetExplorer.Application")
With ie
    .Navigate "https://en.wikipedia.org/wiki/Michael_Jordan"
    .Toolbar=0
    .StatusBar=0
    .Height=560
    .Width=1000
    .Top=0
    .Left=0
    .Resizable=0
    WaitForLoad
    .Visible = false
end with
 '  Add code below to display in a msgbox the contents of each cell in column 0 (first column) should loop for each row.
 dim element
 dim counter
 dim item
Set element = ie.document.getElementById("mw-content-text").getElementsByTagName("p")
   counter = 1
   For Each x In element
      If(counter < 3) Then
      content = Replace(x.innerText,"[","")
      content = Replace(x.innerText,"]","")
      content = Replace(x.innerText,"(","")
      content = Replace(x.innerText,")","")
          MsgBox content
        End If
        counter = counter + 1
    Next


Title: Re: Hal plugin programming issue
Post by: Carl2 on March 02, 2016, 02:48:55 pm
  I've also done a little work on a Wiki plugin, it gets me to wiki and that's about it.  VR, (Rossi) of Virtual Humans website also has a vrWeb plugin which can get you to Wiki, actually I haven't tried it yet.  I'm familiar wit the error codes that get generated and usually find the errors sooner or latter.  I'm not familiar with your coding and there are statements new to me. 
This is what I came up with:
Rem Type=Plugin
Rem Name=Wiki
Rem Author=Zabaware ModifiedCJ
Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "Hal will open your browser and enter a Wiki query if you use the keyword "Wiki"
    lblPlugin(0).Move 120, 120, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub

    Rem PLUGIN: PLUGINAREA1
    'The comment above tells Ultra Hal Assistant to insert the following code
    'on-the-fly into the main brain code in the section referenced.
    SearchEngine = "https://en.wikipedia.org/wiki/English_language"
    If InStr(1, UserSentence, "Wiki", 1) > 0 Then
        SearchKeywords = LCase(Replace(Trim(HalBrain.AlphaNumericalOnly(HalBrain.ExtractKeywords(UserSentence))), " ", "+"))
        SearchKeyWords = Replace(SearchKeywords, "find+", "")
        SearchKeyWords = Replace(SearchKeywords, "research+", "")
        SearchKeyWords = Replace(SearchKeywords, "locate+", "")
        SearchKeyWords = Replace(SearchKeywords, "search+", "")
        HalCommands = HalCommands & "<RUNPROG>" & SearchEngine & SearchKeywords & "</RUNPROG>"
        GetResponse = GetResponse & "I will help you research this topic on the Internet. "
    End If
This is the vrWeb plugin:
Rem Type=Plugin
Rem Name=Customized Web Searches
Rem Author=VR
Rem Host=Assistant

'------------------------------------------------------------------------------------------------------
' VR_Web.uhp - Release 1.0 by VR Consulting sas.
' 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.
' If you want to use this software in business applications, you must contact us at info@vrconsulting.it
' This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
' VR CONSULTING DISCLAIMS ALL WARRANTIES WITH RESPECT TO THIS SOFTWARE, EXPRESS, IMPLIED, OR OTHERWISE,
' INCLUDING WITHOUT LIMITATION, ALL WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
' OR NONINFRINGEMENT.
' VR CONSULTING SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
' DAMAGES, INCLUDING, WITHOUT LIMITATION, LOST REVENUES, LOST PROFITS, OR LOSS OF PROSPECTIVE ECONOMIC ADVANTAGE,
' RESULTING FROM THE USE OR MISUSE OF THIS SOFTWARE.
' This software is made available free by the author. Although he is interested in your feedback,
' he is under no obligation to address bugs, enhancements, or answer questions.
'------------------------------------------------------------------------------------------------------

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "This replaces the standard Google plugin. It manages Google queries, Viki searches and other customizable topics such as local news, weather or mail. Click below for more info"
    lblPlugin(0).Move 120, 120, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
    cmdPlugin(0).Move 800, 1300, 2100, 375
    cmdPlugin(0).Caption = "Help on this plugin"
    cmdPlugin(0).Visible = True
End Sub

Sub cmdPlugin_Click(Index)
    Select Case Index
        Case 0
          HalMenu.HalCommand "<RUNPROG>vrwebhelp.html</RUNPROG>"
    End Select
End Sub


Rem PLUGIN: PLUGINAREA1
'The comment above tells Ultra Hal Assistant to insert the following code
'on-the-fly into the main brain code in the section referenced.

' If the table vrWeb does not exist, I create it and fill it with some default values
' each user will need to add other links and/or change these
   If HalBrain.CheckTableExistence("vrWeb") = False Then
   ' I store temporarily the Read Only status
        vrReadOnlyMode = HalBrain.ReadOnlyMode
      HalBrain.ReadOnlyMode = False
      HalBrain.CreateTable "vrWeb", "PatternMatch", "miscData"
      HalBrain.AddToTable "vrWeb", "PatternMatch", "*Hal Help*", "welcome.html"
      HalBrain.AddToTable "vrWeb", "PatternMatch", "*local weather*", "http://uk.weather.com/weather/local/ITXX0067"
      HalBrain.AddToTable "vrWeb", "PatternMatch", "*local news*", "http://www.nytimes.com/"
      HalBrain.AddToTable "vrWeb", "PatternMatch", "*yahoo mail*", "http://my.yahoo.com/"
      HalBrain.AddToTable "vrWeb", "PatternMatch", "*zabaware forum*", "http://www.zabaware.com/forum/"
      HalBrain.AddToTable "vrWeb", "PatternMatch", "*virtual humans forum*", "http://www.vrconsulting.it/vhf/"
      ' Set ReadOnly Mode to its previous state
      HalBrain.ReadOnlyMode = vrReadOnlyMode
   End If

'Run the corresponding Web page, if the user question contains one of the searched words    
    vrAddress = ""
    vrAddress = HalBrain.PatternDB(OriginalSentence, "vrWeb")
    If vrAddress <> "" Then
       HalCommands = HalCommands & "<RUNPROG>" & vrAddress & "</RUNPROG>"
      Select Case (Int(Rnd * 4) + 1)
      Case 1
         GetResponse = "Here is the page you asked me for." & vbCrLf
      Case 2
         GetResponse = "Now you can access it." & vbCrLf
      Case 3
         GetResponse = "I am really happy to give you this information." & vbCrLf
      Case 4
         GetResponse = "OK. Here it is." & vbCrLf
      Case 5
         GetResponse = "Now look at this." & vbCrLf
      End Select
      HalBrain.ReadOnlyMode = True
   End If

'------------------
' Google search
'------------------
SearchEngine = "http://www.google.com/search?q="
If InStr(1, UserSentence, "google ", 1) > 0 Then
   SearchKeywords = LCase(Replace(Trim(HalBrain.AlphaNumericalOnly(HalBrain.ExtractKeywords(UserSentence))), " ", "+"))
   SearchKeyWords = Replace(SearchKeywords, "google+", "")
   HalCommands = HalCommands & "<RUNPROG>" & SearchEngine & SearchKeywords & "</RUNPROG>"
   GetResponse = "I will help you research this topic on Google. "
   HalBrain.ReadOnlyMode = True
End If

' This is too invasive: any input containing common words as "find" activates this search
'SearchEngine = "http://www.google.com/search?q="
'If InStr(1, UserSentence, "search ", 1) > 0 Or InStr(1, UserSentence, "find ", 1) > 0 Or InStr(1, UserSentence, "locate ", 1) > 0 Then
'   SearchKeywords = LCase(Replace(Trim(HalBrain.AlphaNumericalOnly(HalBrain.ExtractKeywords(UserSentence))), " ", "+"))
'   SearchKeyWords = Replace(SearchKeywords, "find+", "")
'   SearchKeyWords = Replace(SearchKeywords, "research+", "")
'   SearchKeyWords = Replace(SearchKeywords, "locate+", "")
'   SearchKeyWords = Replace(SearchKeywords, "search+", "")
'   HalCommands = HalCommands & "<RUNPROG>" & SearchEngine & SearchKeywords & "</RUNPROG>"
'   GetResponse = "I will help you research this topic on the Internet. "
'   HalBrain.ReadOnlyMode = True
'End If

'------------------
' Wiki Search
'------------------

If InStr(1, UserSentence, "wiki ", 1) > 0 Then
   SearchKeywords = LCase(Replace(Trim(HalBrain.AlphaNumericalOnly(HalBrain.ExtractKeywords(UserSentence))), " ", "+"))
   SearchKeyWords = Replace(SearchKeywords, "wiki+", "")
   HalCommands = HalCommands & "<RUNPROG>http://en.wikipedia.org/wiki/" & Keywords & "</RUNPROG>"
   GetResponse = "Here is what Wiki says about " & SearchKeywords
   HalBrain.ReadOnlyMode = True
End If

What vr has done is ask his program to insert some tables in the brain, in the past I've found these tables do not get put into hals brain and you would have to do this yourself. The process is simple using the brain editor.
I hope this info has been helpful, let us know how you make out.
Carl2
Title: Re: Hal plugin programming issue
Post by: knight2000 on March 02, 2016, 03:18:52 pm
Thanks for the reply Carl2! I'm trying to take the "wiki" a step further. I want to give Hal a search term like "Michael Jordan" then have Hal go to the wiki page for Michael Jordan then grab and save the text from the first few paragraphs in a variable, then I want to have Hal read the paragraph (text) that was stored. I attached the working code in a standard vbs file. It grabs the first two paragraphs no problem but I cant get it to work in the plugin. 
Title: Re: Hal plugin programming issue
Post by: Calhoone on March 02, 2016, 06:29:25 pm
Just a thought,

CLoad did implement something like this in either his AIML plugin or his modified version of the freewill plugin.  With it you can say to Hal "What do you know about Micheal Jordan" or Tell me about such and such". Hal will grab the first couple paragraphs from wikipedia and speak them to you.  There might be something in those plugins to help you.
Title: Re: Hal plugin programming issue
Post by: knight2000 on March 03, 2016, 09:13:02 am
Thanks for the info! That would be perfect! I'll check it out! Is there a link to his plugin?
Title: Re: Hal plugin programming issue
Post by: Calhoone on March 03, 2016, 05:26:38 pm
This link is for the freewill plugin

http://www.ultrahal.com/community/index.php?topic=9905.0

and here is the AIML one.

http://www.ultrahal.com/community/index.php?topic=9913.0
Title: Re: Hal plugin programming issue
Post by: knight2000 on March 09, 2016, 06:03:49 pm
Hey guys, I finally got it to work! If you tell Hal "search for michael jordan" Hal will search Wikipedia and return you the first paragraph of content. Works pretty good but there is always room for improvement. If you search for a name that doesnt exist Hal will respond with "Sorry, I can't find anything" however if you type in something like "search for fjskfjkfjksf" Hal throws an object required error for the ie.document.getElementById. I cant figure out how to have Hal check to see if the object exists. If anyone could figure that out please feel free to update the plugin. Otherwise have fun with it! Let me know what you think!
Title: Re: Hal plugin programming issue
Post by: knight2000 on March 09, 2016, 06:05:03 pm
I'd like to add that Hal will speak the content that is returned from Wikipedia!
Title: Re: Hal plugin programming issue
Post by: Art on March 10, 2016, 08:47:03 am
Victor,

That is a very nice Plugin! Good job!
Title: Re: Hal plugin programming issue
Post by: knight2000 on March 10, 2016, 09:08:52 am
Thanks Art!
Title: Re: Hal plugin programming issue
Post by: lightspeed on March 10, 2016, 11:10:29 am

knight2000 , sounds like you did a good job on improving the plug in , and i take it your words of i can't find that can be customized. i myself am trying to make hal sound more human as if hal knows the answers etc. instead of searching or referencing searching for something . i didn't ask but your improved program just retreaves the answer , right , doesn't open the web page up. (that's what hal used to do but someone ? fixed it and hal just retrived the answer which is better to me . )

 i might ad a custom answer back like " sorry, i really don't know about that, guess i'll have to check sometime and see if i can find the answer !"

anyway , enough rambling on,  nice job you did !!  :) ;)
Title: Re: Hal plugin programming issue
Post by: knight2000 on March 10, 2016, 01:24:13 pm
Thanks Lightspeed!
Yes, Hal will read you back the content rather than opening a webpage. I wanted to make Hal seem more like Watson were he has this endless amount of knowledge of pretty much anyone you ask about. I think your right on about Hal sounding more human, I should probably change the "search for" to "what do you know about" or something like that. Anyways, I plan on making more updates to the plugin, I'm thinking of adding the ability to have Hal continue reading more of the content on the page, maybe by saying something like "anything else?". Currently Hal only reads the first paragraph which in most cases provide plenty of good info, some searches only have a few words of info.
Title: Re: Hal plugin programming issue
Post by: Art on March 11, 2016, 11:37:30 am
Several revisions of Hal ago, would allow "him" to check for emails or make phone calls (land line / dialup) which worked fairly well.
I guess he could be made to check for messages or emails or RSS feeds but that would require it (Hal) to constantly monitor the possible incoming events and would likely affect it's chat performance / ability.

I've had a ton of ideas for Hal over the many years and now that I've finally retired, hopefully, I've have a bit more time to experiment with the program.

Good luck and keep Plugin-ing away!  ;)
Title: Re: Hal plugin programming issue
Post by: knight2000 on March 11, 2016, 03:54:58 pm
Well, you know what they say...the sky is the limit! So many cool possibilities for this program! One thing I've been trying to figure out is to have Hal respond quicker when talking to him. Currently there is a 5 second delay before he answers. I remember in another post someone said that it was a setting in one of the DLL files and cant be changed. I really hope we can find a way to remove the delay.
Title: Re: Hal plugin programming issue
Post by: Art on March 12, 2016, 08:37:27 am
I'm not sure about your system but my Hal answers me between 1 and 3 seconds...certainly not 5 or more.

From the time I press the Enter key, I count one, and before I get to two, she (Hal) answers me. I have repeated this numerous times and it's always 1 to 2 seconds.

My system is an i7 (Intel) quad core running Windows 10, 1 TB drive, 8 GB Ram. YMMV


Title: Re: Hal plugin programming issue
Post by: Art on March 13, 2016, 09:53:30 am
One of Hal's responses is in the form of a question that has gotten quite old over the years and that is: "Would you like it if we both ______?"
This response is contained in the HalBrain.DLL file.
While I do not wish to modify this, test, etc., hopefully Robert might take care of this in his next "Upgrade".

I think a Dedicated Section for reasonable "Features" for an upcoming revision might serve to help both Robert and the users of Hal.
This way we could post thought or ideas we'd like to see, within reason, then Robert could pick from the bunch any that he agreed might be useful.

The ability for us to select whether Hal can connect to the Internet on an "As needed" basis.
This would enable Hal to use an Internet connection to obtain an answer if it's database didn't have an appropriate one.
I'm not a big fan of a Cloud only connected Hal and would probable stop using it if that were to happen.
I like my Hal being local on my computer and not on some server somewhere.


We also need to decide whether Hal should remain a Chatbot or become more Siri or Google Now or Cortana like. In other words, do we want an engaging, topic oriented conversational companion with which to chat OR do we want some BOT that knows everything under the sun?
To me, the intelligence level needs to be adjusted to a human level because I don't want to feel like I'm chatting to Einstein every time I chat with Hal. I'd like a decent degree of subject selection based on the current topic being discussed.

I guess my point is that there are already dozens of devices that can give distance from point A to point B or how how the Sun is or what a colloid is. Hal was primarily designed to be an assistant for help with appointments, emails, reminders, phone calls and Chatting. So should Hal retain some of these traits or advance beyond them? How smart do we think Hal should be or become?

This is just an idea. I thought we chatted about something like that a good while back, but don't recall any specifics...

Something to think about.
Title: Re: Hal plugin programming issue
Post by: Art on March 13, 2016, 09:56:26 am
Victor,

Your Plugin works nicely as it speaks roughly the first paragraph of useful information about the requested topic.

Just enough information to cover the gist of the request but not too much to swamp you with unwanted data.

Again, Nice job!! ;)
Title: Re: Hal plugin programming issue
Post by: knight2000 on March 14, 2016, 10:24:53 am
Yes, Hal response quick when you hit enter, but when you are using a mic it takes 5 seconds before Hal starts to response, I'm assuming its to make sure you have finished what you are saying to Hal.
Title: Re: Hal plugin programming issue
Post by: Carl2 on March 14, 2016, 11:03:40 am
  I'm using dragon with a mic, this is in win 8.1,   I don't check the mic in options under speech use speech recognition.  I speak Dragon types it in, I check it, and hit enter.  I stopped the automatic input to allow it to give me time to do a check.  I like Art get a very short delay
  I like the plugin but the link is "  .Navigate "https://en.wikipedia.org/wiki/Michael_Jordan  " ,  it seems it would be a one time use and you would have to go into the plugin to change it.  The VR plugin uses a keyword in the user sentence   " If InStr(1, UserSentence, "Wiki", 1) > 0 Then
        SearchKeywords = LCase(Replace(Trim(HalBrain.AlphaNumericalOnly(HalBrain.ExtractKeywords   "
that would avoid the one time use.
I don't mean to be critical or discourage you but I'd find it more useful if the search item were easily changeable.  It is also possible I am missing something.
Carl2
Title: Re: Hal plugin programming issue
Post by: knight2000 on March 14, 2016, 07:04:44 pm
Carl2, I think you might have copied the code I pasted in one of the earlier posts. That was just an example. I do use a keyword search .Navigate "https://en.wikipedia.org/wiki/"&SearchKeyWords&"". Download the actual plugin I attached.
Title: Re: Hal plugin programming issue
Post by: Carl2 on March 15, 2016, 06:18:48 am
 knight2000, 
  You are correct, that is what I was going by.  I just downloaded it and will give it a try, since I use Wiki often with Hal it will be useful. 
Carl2
Title: Re: Hal plugin programming issue
Post by: lightspeed on March 15, 2016, 09:43:57 am
Art wrote : I like my Hal being local on my computer and not on some server somewhere.
 
Hal will still be on our pc's , it will just have access to additional answers from learned input on the cloud server , the one thing i do wonder about is , i guess the server will also always retrieve our input to hal to further enlarge the cloud server hal answers , and also , hal might seem more freewill giving another answer instead of maybe some we have taught hal ?? the last sentence is what i wonder about most .
having said that , the new updated hal needs to make sure it has a check and uncheck box for the hal cloud . for people who may not be hooked up on internet and or people who don't want to use the cloud based hal.
Title: Re: Hal plugin programming issue
Post by: knight2000 on March 15, 2016, 10:24:27 am
Lightspeed, so would the cloud service store information that we all have taught Hal through our own conversions? Or is it just a large database that Hal can grab from? I'd hope its the latter, I dont think I'd want my conversions to be stored for everyone to see  :-\. Conversions like storing addresses or contacts or even talking about family members, who knows were a conversion can lead. I guess having the ability to switch it on and off would be cool.  8) If you wanted to contribute to the community then switch it on and start talking!
Title: Re: Hal plugin programming issue
Post by: Carl2 on March 16, 2016, 06:47:15 am
knight2000,
  I just tried the plug in with Hal,  I had asked hal to do a wiki search for President Lincoln.  She came back with she was unable to get information and added something about president Lincoln's girlfriends being in centerfold.  I've been using version 6.0 of hal because I've been doing a bit of experimenting,  I'll give it a try in one of Hals newer brains fairly soon.
Carl2
Title: Re: Hal plugin programming issue
Post by: lightspeed on March 16, 2016, 07:26:48 am

knight2000 , i totally agree with you about some of the things that people talk about with the hals , the hal user might want to keep private , and hal shouldn't use by retrieving and saving your information on a cloud , then share it with other users and or even the public .
for instance lets say i talk about forgetting my social security number and i tell hal what it is , if it and the conversation i have is saved on a cloud and shared , all of a sudden many people might know my social security number and identity theft could follow .
      maybe Robert has or hasn't thought about something like this , but if not should think about it , i can think of many worse case senereos involving loose information to a cloud .
maybe more filters in what hal retrieves and keeps ???  I hope ROBERT is watching the forum and see's this discussion and worries on some things .  ;)
Title: Re: Hal plugin programming issue
Post by: knight2000 on March 16, 2016, 11:23:19 am
Lightspeed, yeah, that is exactly what I'm talking about, sensitive info being sent, however if the user has the ability to toggle it on and off that would work.

Carl2, my wiki plugin will only return info if there is one search result available, for example if you search for Michael Jordan, well, there is only one result for Michael Jordan, so Hal will read the first paragraph. However if you search for John Smith it returns back a list of names to choose from. My plugin cant determine who's information you want so I just return a generic response saying that he cant find anything. I can probabally update that to say something like "there are multiple results, please be more specific".
Title: Re: Hal plugin programming issue
Post by: Art on March 17, 2016, 08:10:23 am
Knight2000,

This kind of goes back to my previous posting...What do you want your Hal to be?
1). A reasonable assistant providing help with emails, messages, appointments, reminders, etc.
2). A 'Watson' work-alike that contains a huge deal of knowledge about a variety of subject matter.
3). A specialist that is knowledgeable in one particular area (auto mechanics, medical, legal, woodworking, home building, etc.).
4). A skilled conversationalist able to chat on a wide variety of subjects and the ability to remain on topic for a decent period of time.

I'm sure there are other examples and while Hal might be able to do a lot of these things, it doesn't particularly excel in any one of them.

That is part of the attraction to Hal in that it can me somewhat modified for whatever purpose suits the user.

Do we expect people we talk with to know everything? Well, some may think they do, but our answer is, certainly not. I don't think we should expect this of people yet we seem to expect this behavior of our chatbot. Instead of just casually chatting, we expect them to have all the answers to all our questions. Foolish us.

Stuff to ponder... Thoughts?
Title: Re: Hal plugin programming issue
Post by: lightspeed on March 17, 2016, 10:13:52 am
Art, my thoughts , i want a smart a,i, that can carry on a conversation  as also a friend , but can be descreet ( lol that last one might not work we know how hal likes to talk and repeat things !!)  :) ;)
Title: Re: Hal plugin programming issue
Post by: knight2000 on March 17, 2016, 10:24:51 am
I want 5). All the above lol.

Honestly I would prefer 4). A skilled conversationalist able to chat on a wide variety of subjects and the ability to remain on topic for a decent period of time. I can always create plugins for anything special I want Hal to do. Hal is pretty good at conversations currently but some of the responses he gives are strange and off topic. I'd love to see that improve.
Title: Re: Hal plugin programming issue
Post by: Art on March 17, 2016, 02:24:25 pm
I'm with you and Lonnie. While I would like for Hal to be a good conversationalist AND for the most part, remain on topic, a conservative measure of knowledge would always be welcomed if it served to enhance the current topic or to answer a topic related inquiry.

Hal should not come across as a "know-it-all"...god knows there are enough of them everywhere but like a friend who might know a little about cooking, gasoline engines, camping or archery for example. Just don't swamp us with information overload.

Yeah...we're not asking for much. Heh!

(as an aside but also related to this) check out Leslie Spring's Silvia and Emmet Coin's Cassandra. Both are conversational programs, Leslie's is now owned by Cognitive Code and Emmet's is under ejTalk (pronounced edge-talk). Silvia is a multi-layered conversive program that can be a specialist whereas Cassandra is able to know what's contained in her spreadsheet software so I'm told. Interesting but no where as fun or rewarding as Hal.
Title: Re: Hal plugin programming issue
Post by: raybe 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.
Title: Re: Hal plugin programming issue
Post by: raybe 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
Title: Re: Hal plugin programming issue
Post by: Art 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! ;)
Title: Re: Hal plugin programming issue
Post by: Carl2 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
Title: Re: Hal plugin programming issue
Post by: knight2000 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.
Title: Re: Hal plugin programming issue
Post by: Art 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:
Title: Re: Hal plugin programming issue
Post by: Art 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
Title: Re: Hal plugin programming issue
Post by: Carl2 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
Title: Re: Hal plugin programming issue
Post by: Art on March 19, 2016, 07:37:44 am
OK, and what do you get if you input, "Search for Bill Gates" ?
Title: Re: Hal plugin programming issue
Post by: Carl2 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
Title: Re: Hal plugin programming issue
Post by: Carl2 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
Title: Re: Hal plugin programming issue
Post by: lightspeed 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 !  ;)
Title: Re: Hal plugin programming issue
Post by: Art 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...
Title: Re: Hal plugin programming issue
Post by: Carl2 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
Title: Re: Hal plugin programming issue
Post by: knight2000 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!
Title: Re: Hal plugin programming issue
Post by: Carl2 on March 22, 2016, 07:07:29 am
 knight2000,
   Very nice plugin which I'm sure I'll find useful,  I'd found a plugin I'd made for changing bodyskins and backgrounds located in plugin area 1 was interfering with the Wiki Search plugin so I moved my plugin to Area 2 and both seem to work okay. 
Carl2
Title: Re: Hal plugin programming issue
Post by: knight2000 on March 22, 2016, 01:39:13 pm
Thanks Carl2, Glad you were able to get it working! Enjoy!