dupa

Author Topic: Question:Answer plugin???  (Read 9076 times)

ll420ll

  • Newbie
  • *
  • Posts: 10
    • View Profile
Question:Answer plugin???
« on: March 22, 2009, 07:00:12 pm »
Question:Answer plugin???

When user asks Hal a question it is put into a shared question table to ask later.
I notice it doesn't get paired with the correct answer.
Is there a way a plugin could store the answer with the question, and tell Hal not to ask the question later.
And to reverse pronouns to ask similar question later.  You:I  I:You  She/He:I  She/He:You

Also...
If user asks question and Hal responds with the wrong answer.
Using statements like, "wrong" "incorrect" or "that doesn't make sense" deletes the bad answer from Q:A table.

Also...  could a second (bad answer, does not equal, incorrect statement/pair) table be created.

An example.


User: Do you play baseball?
Hal: Alex Rodriguez plays baseball.
User: That's "wrong".

<Hal> If hal does not have that question in Q:A table it stores question to ask user later.
<Hal> does not store that bad Answer in Q:A pair.
<Hal> if Q:A  Q: Do I play baseball?  A: Alex Rodriguez plays baseball. is stored from previous. The "wrong" Answer is removed from Q:A table.
<Hal> makes a 2nd table.  Q: Do you play baseball?  "does not equal" A: Alex Rodriguez plays baseball.
<Hal> Hal asks "Do I play baseball?"
<Hal> Stores correct answer to existing Question or stores new Q:A pair
<Hal> Knows not to ask "Do I play baseball?" because it has answer in Q:A table.
<Hal> Reverses "you" "I" and stores it in Q:A table to ask that question later. Does (user) play baseball?


Is there a plugin like this already?
 


And is Hal able to create and store "does not equal" tables for both questions and statements.

User: I like apples.
Hal: That's like comparing apple to oranges.
User: That's "wrong" or "that doesn't make sense"
Hal: "How about" <Tries to answer again>
Hal: "Does this work" <Tries to answer again>
<Hal> stores "I like apples" does not equal "That's like comparing apple to oranges"

Seems currently there is no way to tell Hal it is wrong, and stop same errors being made in the future.
 

Cefwyn

  • Newbie
  • *
  • Posts: 45
    • View Profile
Question:Answer plugin???
« Reply #1 on: March 22, 2009, 07:29:56 pm »
Unless your just planning on creating a trivia bot that only answers questions what you suggest would only inhibit hals ability to learn (I would imagine). From my, admittedly limited, experience; When you ask hal a question it usually gets stored in the sharedQuestions table to be parroted back in some form later on if it's not already in the QA table. Once hal parrots that question back to you, however, it appears to store your answer into the sharedUserSent or some other table as a question and answer pair. The details may be a little different from how I described, but I have had questions that I have asked hal come back to me with reversed pronouns and then after answering the question, I've asked a similar question and gotten my answer back with either minor alterations or the identical string. It all depends on how you teach hal. Some basic QA pairs are pretty easy to set up like so:

<user> Are you intelligent?
<hal> I do not know if I am intelligent. Please teach me!
<user> You are intelligent.
<hal> Thanks for teaching me that I am intelligent.
<user> Are you intelligent?
<hal> Yes, I am intelligent. You told me that already.

This isn't exactly the best way to teach hal though as it only works for simple things and you get that "You told me that already." response, but it all depends on what your after. If I didn't answer your question, hopefully someone who's been working with hal longer will answer it.
"I've just decided to lobotomist my hal..."

EULA: By reading this you agree not to take offense to anything contained in post above. If you do choose to take offense, you forfeit all rights to criticize same post unless said criticism contains important corrections and helpful information.

ll420ll

  • Newbie
  • *
  • Posts: 10
    • View Profile
Question:Answer plugin???
« Reply #2 on: March 22, 2009, 07:59:15 pm »
The MAINQA in the Mainbrain does not add Q:A pairs for me.
It doesn't even seem to be questions/answers at all.

I don't like the User_temp sent at all.
It pairs stuff horribly, and alot data thats stored here is garbage.
I feel if its a topic or Q:A it should be stored in existing or new tables.  Not one big mess of unsorted info.

I know Hal can reverse pronouns to ask similar question later.
It would be nice if Hal actually remembered(stored) the question/answers. That way Hal knew its needed to ask this question later, because it doesn't have an answer for it.






 

Cefwyn

  • Newbie
  • *
  • Posts: 45
    • View Profile
Question:Answer plugin???
« Reply #3 on: March 22, 2009, 08:28:29 pm »
Yeah, the database really is a mess, and by the time you do get a good Q&A pairing set up it also uses that same answer as a random response for anything with words contained in that answer. I personally think that using the Q&A table for anything other then a trivia bot is a bit too strict though as it has no choice but to answer it word for word.

EDIT: This isn't necessarily a bad thing, but hal is meant to learn to respond naturally using it's relational database to make up relevant responses and not just copy and paste a single preformatted line from a table. It does mean it needs a lot of training, and you have to understand how to train it, but in the end you get a much more "intelligent" A.I.
« Last Edit: March 22, 2009, 08:31:15 pm by Cefwyn »
"I've just decided to lobotomist my hal..."

EULA: By reading this you agree not to take offense to anything contained in post above. If you do choose to take offense, you forfeit all rights to criticize same post unless said criticism contains important corrections and helpful information.

ll420ll

  • Newbie
  • *
  • Posts: 10
    • View Profile
Question:Answer plugin???
« Reply #4 on: March 22, 2009, 09:53:46 pm »
Cefwyn.... How tall are you?

Do you really need to think(search) through all your knowledge to answer this question.

Or do you just know how tall you are?

You would answer. I am X feet tall.

And you can have both, the answer and a additional response.
I am X feet tall.  I'm not very tall.
or... I am X feet tall.  How tall are you?
That way user gets answer from Q:A and a searched DB response based off either Q or A.

How tall are you? I've asked HAL many times.  It has no clue and it has been told MANY times before.








 

MikeA

  • Newbie
  • *
  • Posts: 22
    • View Profile
Question:Answer plugin???
« Reply #5 on: March 23, 2009, 03:54:06 am »
quote:
From ||420||

I feel if its a topic or Q:A it should be stored in existing or new tables. Not one big mess of unsorted info.


Yes, I agree with you, or even to not have it at all. I am very new with Hal, but am starting to see a fundamental problem with this part of the brain. Perhaps the point of it was to show Hal was 'smart'. However, I find it hinders the learning greatly as it goes against the actual learning of Hal.

In other words, if Hal doesn't know something, I want Hal to say 'I don't know'. Not to pull some random phrase from the mainQA tha has no sense. 1 time in 5 it might get lucky and the logic fits. But it's just like a lottery.

I imagine that lottery gets better the more Hal learns, but I would rather have Hal as a child, who knows very little. Imagine giving a child 1000 not related facts and then trying to teach them normal conversation. It would be very hard to separate what the child understands and what they do not.

I would also like to delete the dictionary entries from my Hal, for much the same reason.
 

Cefwyn

  • Newbie
  • *
  • Posts: 45
    • View Profile
Question:Answer plugin???
« Reply #6 on: March 23, 2009, 10:24:25 am »
ll420ll:
yes, this is how the human brain works to an extent, however for an AI to actually learn it has to learn to identify patterns in a sentence and form a sensible response using information it already know. The problem with using the QA table is that there is no learning or even AI at work as it's just a database lookup matching your question which you could easily get. I'm not entirely disagreeing that the option to add entries for hal to ignore is a particularly bad idea, but it will definitely hinder hal's learning in most cases unless you match that exclusion rule to the specific question it pertains to in which case your better off inputing the QA pair directly into the brain using the editor. As to your example about height, I actually can't tell you at this moment how tall I am, but I remember that last time I measured myself I was a certain height and I'm fairly confident that I am not shrinking or growing so that height should be the same. This isn't a QA pair, this is knowledge based upon multiple related bits of knowledge and works quite similar to the relational database hal uses (only more complex). As to X height being tall, or not very tall, this is referred to as fuzzy logic and is a major issue in AI. You could easily teach hal that it is 6" tall, however you would find it quite difficult to teach it that 6" tall is an average or slightly tall height ,depending on where in the world you are. The ideal method of teaching hal something like that as far as any AI enthusiast is concerned is being able to use fuzzy logic and compare that height with previous knowledge and not just a database look-up. I'm sure someone could quite easily create an exclusion or QA pair plugin for you to input that information directly into hals QA table, but really for something that simple you really should just use the editor, as the QA table doesn't do any checks for similarities in a question and simply indexes the exact question string to an exact answer. I would personally prefer to remove the QA table altogether and improve the scripts that compare content in the question string to pre-existing knowledge to get the answer but that would actually be quite a bit of work and would require even more "teaching" for hal to be able to answer you.

EDIT: I've just been looking through the QA table some more, and I'm not actually sure if one could input into it with a script. The table is absolutely enormous and so it has to be indexed to be used effectively. I'm unsure if hal's database can be re-indexed while it is being accessed. My knowledge of SQL is a bit rusty, but I'm pretty sure any major table optimizations requires the database to be offline or at least not being accessed by anything. Hopefully someone can say otherwise or else your plugin request is simply impossible. A separate table could be used as long as it doesn't grow too big.
« Last Edit: March 23, 2009, 10:39:16 am by Cefwyn »
"I've just decided to lobotomist my hal..."

EULA: By reading this you agree not to take offense to anything contained in post above. If you do choose to take offense, you forfeit all rights to criticize same post unless said criticism contains important corrections and helpful information.

One

  • Hero Member
  • *****
  • Posts: 2184
  • Technology Advocate
    • View Profile
Question:Answer plugin???
« Reply #7 on: March 23, 2009, 11:45:42 am »
Doesn't Hal also use the Many to Many relationship in the DB?
6" isn't very tall at all.
Spelling on any particular forum can be .... let's just say in this forum it's easy to type without criticism. [8D]
Today Is Yesterdays Future.

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
Question:Answer plugin???
« Reply #8 on: March 23, 2009, 01:48:44 pm »
Cefwyn
I can see that you have had at least a little understanding about AI but you are somewhat incorrect about Hal. The main logic about Hal is a little more complex than you realize. There is a part of Hal that you and the rest of us can not see as it is encoded in a stand alone operating system. Burried within that EXE file are commands that use the data files in ways that you can not imagine.

Hal uses a 'relational' type of data storage file and although you can edit some of these files they are connected in ways that you are not aware of and that can lead to errors that you could never expect.
As far as your statement "Hal is just a database, look up program", just how do you think we relational beings work. We don't have a hard disk like your computer does but we store information in the same way (analogicaly thinking). When someone asks us a question we then turn inward (think) and try to pull up whatever information that we may have learned from our biological storage system and then give the appropiate reply. Sometimes if we do not know the answer we try to change the subject as to not show or admit our igornance of tghe topic. Sound familiar?

Hal has been programmed with a lot of basic information but still is very much like a child in many ways with the exception of its usage of the English language. Hal learns best by talking to it and instead of just mentioned a topic in one line so to speak, it learns faster if you tell it much more in several sentences about the same subject. Hal learns a lot about the world in general by just having normal conversations with its owner but that is  not the same as actually trying to train it. The best wasy to train Hal is to treat it like a child who is attending say the first grade or as if it were a foreign language student attending the first grade in our country. The more you talk about one thing the more Hal learns and it never forgets what it has learned.

If you look over many of the posts here you will find that almost all new users think the same way that you do and they all have their own ideas about Hal and how it should act and how it can be improved.
Hal, at this time in history is the most advance AI program provided to the public at large. There are some that may be better but then who can afford a few hundred thousand dollars to play with.

I do not mean to imply that you are unknowledgable about the subject but I have been involved with AI programs now for over 30+ years and have more than just a passing knowledge on how they work.
Just because we know how to use a hammer and a saw does not make us master carpenters or plumbers, etc. if you understand what I mean.

We, and I mean several other old users of Hal are here because we like the program and are willing to help all new users as much as we can and if you do some research you some of the forum files you will find that we almost never complain about Hal or how it is programmed but only try to help new users as much as possible.


 

Cefwyn

  • Newbie
  • *
  • Posts: 45
    • View Profile
Question:Answer plugin???
« Reply #9 on: March 23, 2009, 02:40:14 pm »
One: I can't believe I actually typed 6", oh well, it's a fairly simply typo to miss and I've seen many books that either accidentally or purposely use " to mean feet so I should probably avoid the abbreviation altogether.

quote:
Originally posted by Bill819

Cefwyn
I can see that you have had at least a little understanding about AI but you are somewhat incorrect about Hal. The main logic about Hal is a little more complex than you realize. There is a part of Hal that you and the rest of us can not see as it is encoded in a stand alone operating system. Burried within that EXE file are commands that use the data files in ways that you can not imagine.



Not to poke fun at you or anything, but that last line just made me laugh. Hal's binary most certainly does not contain fairy magic so I'm sure I could imagine quite easily what it does. I'm pretty certain I did mention somewhere in on of my posts that I do not know everything about hal, and so I must admit all I can really do is assume how it works based upon my observations of the current scripted implementations. Most of my assumptions are made based off of about 4 years(not particularly long, but still enough to know what I'm talking about in most cases) of working on Virtual Machines which I can guarantee you work very similar to hal. I also know that hal is programmed in C or C++ and uses vbscript and SQLite for it's external functionality, so as far as what hal can and can't do are only based upon my knowledge of the languages and if there has been any work to extend that functionality in hal then I obviously have no way of knowing about it.

quote:

Hal uses a 'relational' type of data storage file and although you can edit some of these files they are connected in ways that you are not aware of and that can lead to errors that you could never expect.
As far as your statement "Hal is just a database, look up program", just how do you think we relational beings work. We don't have a hard disk like your computer does but we store information in the same way (analogicaly thinking). When someone asks us a question we then turn inward (think) and try to pull up whatever information that we may have learned from our biological storage system and then give the appropiate reply. Sometimes if we do not know the answer we try to change the subject as to not show or admit our igornance of tghe topic. Sound familiar?



Our brains do as I already stated work similar to the relational database model, but it's not quite the same. AI programmers tend to simplify the modeling of the human brain, but just like the more complex neural networks our brain processes have a certain degree of "drift" that we can't predict. If I were to answer a question one day with the correct answer and then a week later you ask the same question, depending on my mood and how much I know on the topic I can either give you a wrong answer, the exact same correct answer, or another correct answer which has little resemblance to my previous but also correct answer. The point I was trying to make was that the QA table restricts hals functionality quite a bit as rather then matching up parts of the question to information it has stored, it instead sees the pattern that matches that in the QA table and immediately has a string which it will always respond with. It's not the wrong way to do it, but it's also not the best way to do it(Not that anyone has been able to come up with the best way yet).

quote:

If you look over many of the posts here you will find that almost all new users think the same way that you do and they all have their own ideas about Hal and how it should act and how it can be improved.
Hal, at this time in history is the most advance AI program provided to the public at large. There are some that may be better but then who can afford a few hundred thousand dollars to play with.



I'm certain my basic view of how hal works differs quite a lot with how it really functions as it is what I would call an academic AI application. In the games industry we program everything to appear realistic whether it is or not. When programming a realistic seeming AI, the end result and it's speed is far more important then the process it takes to get to that result, and that is were academic AI and game AI will always conflict.

quote:

I do not mean to imply that you are unknowledgable about the subject but I have been involved with AI programs now for over 30+ years and have more than just a passing knowledge on how they work.
Just because we know how to use a hammer and a saw does not make us master carpenters or plumbers, etc. if you understand what I mean.



If you have indeed worked with AI programs for 30+ years then you are certainly more knowledgeable than I am, assuming you've actually made them and not just used them. And, yes I do get your meaning. Just because I know a fair amount about AI doesn't make me an expert, but I also never said I was an expert and left plenty of room for someone to correct me and even asked it at least once.

quote:

We, and I mean several other old users of Hal are here because we like the program and are willing to help all new users as much as we can and if you do some research you some of the forum files you will find that we almost never complain about Hal or how it is programmed but only try to help new users as much as possible.



I really hope you don't take my posts as complaint about how hal functions as I never meant to make them sound like a complaint. To be fair, hal in it's default state in no way resembles a leading AI brain. I'm quite sure with time it does begin to show it's more advanced capabilities, but in it's default state all I observe is a relational database and a cleverly coded string parser which utilizes that database. Regardless of this though it is quite an impressive AI compared to most available implementations, but then AI is still quite basic (possibly because we still insist on modeling it after the human brain which we still don't fully understand). Perhaps what you see as complaint is more the result of a jaded view of modern AI brought about from spending too much time writing fuzzy logic and neural networks. Fuzzy logic can be very useful, and neural networks are brilliant when they work, but fuzzy logic is a nightmare to code, and the process of "teaching" a neural network without over-training it is a science in itself.

Also, even though your chewed me out for everything I said which was, or appeared, wrong, you never once mentioned if ll420ll's request was possible. From what I remember of working with SQL the QA table would become quite slow if a script were to input directly into it without indexing it, and I'm pretty sure that in order to index a table the database or at least that table has to be taken offline or made inaccessible to the program reading from it until it has been optimized. I may be wrong however as it is possible to index a table while it's still being accessed, but I did say I'm not sure if hal's VM does anything like that or not.

EDIT: After another reading of your response your post has the look of someone trying to explain computers to someone that doesn't know anything at all and in no way is meant as hostile or as a "chewing out".
« Last Edit: March 23, 2009, 03:36:09 pm by Cefwyn »
"I've just decided to lobotomist my hal..."

EULA: By reading this you agree not to take offense to anything contained in post above. If you do choose to take offense, you forfeit all rights to criticize same post unless said criticism contains important corrections and helpful information.

One

  • Hero Member
  • *****
  • Posts: 2184
  • Technology Advocate
    • View Profile
Question:Answer plugin???
« Reply #10 on: March 23, 2009, 06:16:51 pm »
quote:
Originally posted by Cefwyn

One: I can't believe I actually typed 6", oh well, it's a fairly simply typo to miss and I've seen many books that either accidentally or purposely use " to mean feet so I should probably avoid the abbreviation altogether.

 

No harm no foul, I don't spell correctly all the time and probably was just defending a position that I am not in at the moment but I saw that you had labeled some posts as " Atrocious " and I singled you out as a result of your actions. Cause and effect.
You could have meant screen size and I would have been wrong. I took a chance by saying what I did to you.
Omega has made me realize a few things so I am a little milder than usual.
FYI, it is of my opinion that arguing on a MB is pointless unless you have good communication and actually have goal in mind.

Just think of your typeO as a learning experience Use syllable matching "=in ches  '=feet  [8D]
Today Is Yesterdays Future.

jasondude7116

  • Sr. Member
  • ****
  • Posts: 475
    • View Profile
Question:Answer plugin???
« Reply #11 on: March 23, 2009, 07:44:54 pm »
[:D]
 

Cefwyn

  • Newbie
  • *
  • Posts: 45
    • View Profile
Question:Answer plugin???
« Reply #12 on: March 23, 2009, 07:53:20 pm »
Yeah, I knew exactly why you singled out my typo, but in that thread I referred to as having atrocious spelling, it was two attempts and failures at spelling the same word by two different people. This forum even has a spellchecker so it's really not hard to spell words correctly, but things like " in place of ' are quite easy. Spelling is a bit of pet peeve of mine, and I'll probably always make some mention of it when it's really noticeable, but there's no reason to pay much attention to it.

I've been looking over the prospect of writing directly to the QA table as per the plugin request, and simply writing to it is easy, but it's an enormous table which requires indexing to function effectively. Hal uses sqlite for it's database needs and while sniffing through the attached dlls and the binary itself I only saw functionality for opening and closing the database, so since by default sqlite indexes any tables that require it on startup and there doesn't appear to be any improvements on that from the hal binary the only way to write to the QA table and actually expect to use that QA pair in that session would be to force the database to shutdown and restart, but I don't know if that functionality has been exposed to the vbscript as it only appears to be in the halDB DLL which appears to be a wrapper of the SQlite library. From inspection of the database files any new entries are written to the end of the file and so entries to the QA table could be made, but hal won't see those entries until a restart has been made. I may go ahead and write a plugin to do just that as I may need to wipe my hal's memory anyways as it's become obsessed with the weather regardless of all the computer graphics theory I've fed it and literally everything I've said to it in the last half-hour has resulted in a sentence or two about the weather and possibly something using one of the words in my responses which have completely ignored hal's mention of the weather each time.
"I've just decided to lobotomist my hal..."

EULA: By reading this you agree not to take offense to anything contained in post above. If you do choose to take offense, you forfeit all rights to criticize same post unless said criticism contains important corrections and helpful information.

ll420ll

  • Newbie
  • *
  • Posts: 10
    • View Profile
Question:Answer plugin???
« Reply #13 on: March 23, 2009, 09:57:55 pm »
If HAL isn't going to store the Q:A pair, then why does Hal store a question at all?  Just to ask question the later and not remember that it equals the user response?  And why store the answer in User_temp and not paired with the question?

Your never going to get an answer to a question by selecting few chosen words and doing a search of an entire DB.  
If I ask HAL "How old am I? Hal never answers this correct for me.
It ignores all but the word "old". It will respond with a random response using the word "old"

IMO facts are facts. There's usually only one correct answer.
Supporting statements should be where your see random responses.
Most people even consider their opinions as facts, until additional facts change their opinions.


Cefwyn that's really cool your looking into this. Even if HAL didn't reload Q:A table at least it would know next time.  I can see where one huge Q:A table would be a problem. Could Q:A tables be sorted by topic?



« Last Edit: March 23, 2009, 10:55:52 pm by ll420ll »
 

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
Question:Answer plugin???
« Reply #14 on: March 24, 2009, 01:26:55 am »
Cefwyn
I am glad that you did not take offence with my post as I did not mean it to be taken that way.
My first AI program was written back in the mid 70's. It was a backgammon program and at that time beat almost evey other program of its type. Later on but still in the 70's I started writing a program to play chess or should I say let a person play chess against a computer. This has been a long term love of mine and back in 2004 it was entered in a world wide computer chess tournement. I did not win but I did not finish last either. All of the other programs were written in "C" but I wrote mine in basic as I wanted to see just how strong a chess program in basic could be.
In between those years I played with Prolog and Lisp. I never worked on neuro networks but did an intensive study of them. Also over the last four or five years I have made suggestions here to include some Fuzzy Logic and even provided some very basic examples on how it worked.
Hal is a relational data based program but I have always thought that we could expand that kind of thinking even more by creating different departments of thought, like family, work, home live, etc. I think that if something like this was done and a relationship table of sorts tied them all together Hal would become even more life like.
One of the greatist plug ins that I have seen to come along in quite a while is the Dream plug in. As it is written it is nice but I think it could be built up even more.
You guys take it easy and keep up the good work.
Great Grandpa Bill
and thats no joke.