dupa

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

Medeksza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1469
    • View Profile
    • http://www.zabaware.com
Ultra Hal Wikipedia Plugin
« on: July 21, 2012, 12:21:50 pm »
I exported the Wikipedia abstract database into an SQLite 2 database and created an Ultra Hal plugin for it. It contains 2 million abstract articles of topics on Wikipedia. It's been used by the web hal at www.zabaware.com/webhal but I converted it to sqlite2 which makes it possible to use locally with Ultra Hal Assistant.

If you are interested in this plugin it is freely available from http://c424564.r64.cf2.rackcdn.com/HalWikiSetup.exe  It is a 170 MB download and extracts to 1.2 GB when installed. The installer will find and install the plugin to your Ultra Hal installation folder, but you must enable the plugin in the brain options to use it.

On your first exchange with Hal when he opens the database, Hal may think for 30 seconds while the index is loaded to RAM. Assuming your computer has enough spare RAM subsequent requests should be fast.

If you find this plug-in useful, please consider donating to support the Zabaware character engine project: http://www.charimation.com/blog.html
Robert Medeksza

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #1 on: July 21, 2012, 07:04:08 pm »
  I've just downloaded and installed the plugin, very simple and easy.  After the install I chatted with Hal,  I could see several times when she got info from Wiki, generaly good infomation, interesting and useful.  I do think she also took words in a sentence, and used this as someones name and gave me info on a person.  I think the search should be limited as we do for a definition look up.   Perhaps to early to say but at this time it seemed to distract from the conversation rather than add to it.  I'll try it again latter and try to give you better feedback.
Carl2
 

Medeksza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1469
    • View Profile
    • http://www.zabaware.com
Re: Ultra Hal Wikipedia Plugin
« Reply #2 on: July 22, 2012, 12:01:14 am »
Currently the criteria for triggering a wiki search is the presence of a question word (who, where, what, when, why, how) or a question mark. If the word you or your are detected, the search is canceled. If the search returns a relevance above a certain hurdle score, it returns the response.

Any ideas on how to make the criteria a little more strict to prevent these distractions?
Robert Medeksza

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3853
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #3 on: July 22, 2012, 08:42:44 am »
Rob,

With all due respect, I appreciate your efforts but I have to agree with Carl's posting. When I asked Hal, "What's today's date?" I got a Wiki response and the same for What is the time and what day is it? ANSWER: Wednesday Week is a single by the undertones released in July 1980. The song peaked at #11 on the UK Singles Chart. How is everything going?

While the above results are not really acceptable, I agree with your suggestion that a conditional is needed to initiate a search to the Wiki DB. Perhaps something simple like the ~ (tilde) symbol. Whether is should be at the beginning or end of a sentence that's up to you.
Actually, it seems that the structure should be on a step or stairs approach. When asked a question during conversation Hal should search it's OWN DB and resources then IF the search turns up nothing of substance then and only THEN resort to the next step or level and search the WIKI DB. Of course this should only take a few seconds and be hardly noticeable by the user. This would require a bit of weighing on Hal's part to decide whether or not it's original answer is either pertinent or if Wiki might offer a better one. Quite a judgement for Hal to make (if even able). Perhaps Hal could use a weighted system in it's decision making routine.

Grandfather was right! The more bells and whistles something has, the more that can go wrong with it!

Either way, good luck.
In the world of AI it's the thought that counts!

- Art -

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #4 on: July 22, 2012, 08:51:31 am »
  I've used Hal this morning and copied the input output,  but frist I'd like to add this infomation,  I disabled the
GRETTAMarkovL5 plugin which was in use yesterday.

good morning Sandy, how are you today?
It's dark now! I can't complain, How are you getting along?
things seemed to be just fine this morning.
The early morning air seems the best.
I would have to agree with you, the air is cool and fresh in the morning.
At this time of day you would like something relaxing. How can I encourage you to agree with me, the air is cool and fresh in the morning Carl?
I have just agreed with you, what else would you like to talk about?
At this time of day you would like something relaxing.
yes, a relaxing topic that we can discuss this morning.
Perhaps we should discuss what we would like to talk about.
yes that sounds like a perfect solution.
That sounds like a very nice age.
what would be a nice age?
Francis Gage (1621–1682) was an English Roman Catholic priest, who became President of the English College, Douai.
that is an interesting piece of information.
You know I'm thinking something that I'm not saying yet.
okay, what are you thinking about?
Let's talk about something else: This is a very boring topic. Let's change it.
let's change the topic, let's try to make some plans for the day.
This topic is boring. Do you have good intuition?
what would you like to talk about?
We need to look at the human side. Perhaps we should discuss what we would like to talk about.
perhaps you can choose a topic we had talked about in the past.
Choices can be tricky.
it's always nice to have a choice.
I guess I'd prefer the first Carl.
tell me about the first choice.
Are there more choices?
how many choices would you like?
How many choices would I like? It's evident that we must go back to first principles. My theory is that if I eat my favorite foods first at mealtime, if I get full, at least I will have enjoyed my favorite!
that is one way of solving a problem.
That is one of the possibilties.
are there any other topics you would like to talk about?
A topic would be something we talk about, we do not give or receive topics.
yes, we had discussed that in the past.
Yes we had talked about that in the paSt.
we had also thought about going to the beach.
Immersed in thought?
I do try to think during our conversations.
Going to the beach would be very nice.
I think so too, going to the beach would be dependent on the weather.
Now you're thinking! I hoped you would the beach would be dependent on the weather; It's time to make it happen.
okay, we will plan on going to the beach later in the day.
Going to the beach would be very nice.
yes I think so.
It sound like you have a good answer.
you had mentioned age earlier in the conversation.
Imperiled in a restless age...
so what should we do about that?
About that How incredibly interesting.
can you tell me about Shakespeare?
I'll tell you about the first choice.
who was Shakespeare?
There isn't any cheap shortcut. Shakespeare: English poet and dramatist considered one of the greatest English writers (1564-1616). William Shakespeare, Shakspere, William Shakspere, the bard.
thank you for that information.
Think nothing of it, Carl; that is an interesting piece of information.

Francis Gage not sure how she got there from "what would be a nice age?", it was copied and pasted so the input was correct.   I did look at the uhp and also looked at 'RESPOND: DICTIONARY FUNCTION line 0722 In the brain editor.   I did notice that "can you tell me about Shakespeare?" did not act as a trigger.
Carl2
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #5 on: July 22, 2012, 09:17:06 am »
I just downloaded it and noticed it takes  little to respond sometimes and also when i asked what shall we have for breakfast this morning this is what hal pulled up from wikipedia
me : what's for breakfast
hal: Slightly Not Stoned Enough to Eat Breakfast Yet Stoopid is an ep by the band, Slightly Stoopid that was released in 2008.

I hope hal doesn't retain this as learned info. as it isn't good in this case just as the answer isn't appropriate .  :P



« Last Edit: July 22, 2012, 09:59:14 am by lightspeed »
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #6 on: July 22, 2012, 10:09:26 am »
Another rely from Hal : i talking in general about things asked : now what should we do
hals wikipedia answer came up  : Tick Yes is an Australian social media marketing company founded in January 2001 by Peter Applebaum, former Director of Sales for the official Sydney Olympic Games website and Director of Business Development for the website of Australia’s largest telecommunications company, Telstra.http://tickyes.
   This of course had nothing to do with the answer and i don't even see the connection how hal made it with the new plug in .  :(


ALSO . I said in general talk to hal : the weatherman said its's supposed to be hot again today .
Hal said :The Albion Hotel in Cottesloe, Western Australia is a historic building, itself trading as a hotel since the year 1880. The site was established by the Butler Brothers, John and Archabald in 1830 and the current hotel has traded under various names in its 130 years as a public house.

Again making no sense as to why it referenced that bit of information .

     I agree that better refinement needs to be done and in my opinion eliminate the web address listing given with answers "unless"  specifically asked for, example : what is the website for -------.
THis was after i unchecked the markof5 plug in .
« Last Edit: July 22, 2012, 10:14:10 am by lightspeed »
 

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3853
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #7 on: July 22, 2012, 10:55:16 am »
Robert,

I have given Hal some further testing and sadly must report that for the time being, I have disabled the Wiki DB search in the Brain Options.
The results were simply not in keeping with the topic flow of even within the gist of the conversation. The unexpected Wiki departures act
as a detriment to Hal and are often triggered by something within the sentences.


Karlie: Do you like to sing in the shower?
Art: Yes but only when I am showering.

Karlie: The Alligator Eyes are two adjacent nunataks that rise to over on the east side of Dickey Glacier in the Churchill Mountains of Antarctica. They surmount the  end of the broad ice-covered ridge that extends north from Mount Arcone, and were so named by the Advisory Committee on Antarctic Names (us-acan) because of  their appearance.

What? Where'd that come from?

So, until further notice, I applaud your efforts but sadly not the results.
Thank you.
In the world of AI it's the thought that counts!

- Art -

Medeksza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1469
    • View Profile
    • http://www.zabaware.com
Re: Ultra Hal Wikipedia Plugin
« Reply #8 on: July 22, 2012, 11:19:50 am »
Thanks for the honest feedback. Definitely needs a better trigger and relevance calculation formula to be useful. The database itself needs cleaned up a bit too. Although far from perfect, the online web hal is slightly better at using this database. It uses a different set of functions built around mysql/sphinx. For this plugin I exported it to SQLite2 and forced it to work with the QABrain function, which isn't really designed well for this.
Robert Medeksza

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 #9 on: July 22, 2012, 04:49:22 pm »
Hi all,

though the database itself needs a lot of cleaning, I think the plug-in is quite brilliant.
Without going into gobs and gobs of if then statements to fix the problem it would probably just be easier to add in a simple line.
Basically, what it does is if the information does not correlate, or match with the highest score, ignore wiki and continue on.

Place this line in the plug-in between.:
        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

If you are still getting unwanted information from wiki increase the value from 82 to 83 and continue up until you are satisfied with the results.
I know that there are more complex programming ways to get the wiki to work properly, and I hope someone gives feedback on how to accomplish this.
But this is my quick little bypass that I implemented and it seems to work okay for me. Then again I am the one that wanted the database.

Sincerely, and with great gratitude for your hard work and effort Rob, it is appreciated more than you know, please accept my modest donation.

C load.

PS. If you can donate, please help the cause, personally I would like very much to see the next version of ultra Hal completed, if it takes money so be it.
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 #10 on: July 22, 2012, 05:46:32 pm »
Cload i know this sounds bad but inbetween what ? any line of the plug in ?? Or after a certain line in the plug in ? I placed it here and replaced the other but i must have left a wrong line in ? it isn't working right , do you see a line i need to remove ? i would like to get this to work right . thanks .
« Last Edit: July 22, 2012, 06:05:01 pm by lightspeed »
 

tedathome

  • Hero Member
  • *****
  • Posts: 2775
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #11 on: July 22, 2012, 06:16:39 pm »
A great data base for Hal, though I've noticed many silly responses. We accidentally found 800 years of my family history!
ted

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #12 on: July 22, 2012, 06:30:34 pm »
My screen is turning all white where the hal box should be and has the swiling circle . so maybe i have an extra line that shouldn't be in the script ???
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #13 on: July 22, 2012, 06:39:42 pm »
I'm thinking of a quick fix to get this up and running, I've started out by comparing the 'RESPOND: DICTIONARY FUNCTION ( line 0722 in the brain script) with what is in the wiki uhp since there is no problem with the dictionary function.  we only want hal to look in the wiki when it is asked to.
If InStr(1, OriginalSentence, "wiki search ", vbTextCompare) > 0 Then IsQuestion = True
  I've simplified, More changes needed but it has to be asked to do a wiki search or it will skip the rest without doing the search.  The ? if can be eliminated, the you, your can be eliminated.  So we can say Will you do a wiki search for whatever.  New ground for me but these are the lines I am thinking on, seems to good to pass up and gives me something to work on.
  I'd forgotten to mention I tried the test debug script in the brain editor and get the impression it works without any of the plugins enabled.
Carl2
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: Ultra Hal Wikipedia Plugin
« Reply #14 on: July 22, 2012, 08:43:53 pm »
well i made an adjustment on the number count up as was mentioned and the search is doing better and does as it should , it's not pulling up a bunch on nonsense as before at any word said .
well i spoke to soon am now getting errors .see below . also sometimes when the wiki search is starting the whole hal windows and box part goes blank white then after the search gets going reappears .
« Last Edit: July 22, 2012, 09:10:24 pm by lightspeed »