AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

ALF
 
 
  [ # 16 ]
Dan Hughes - Aug 10, 2011:

However, ALF knows that hungry is not a permanent state such as something like “The car is smashed”.............

Interesting, you seem to be placing a lot of focus on the same areas that I am.  So ALF will lookup information specific to hunger, and know that, *in general* people tend to solve their hunger issues generally within an hour or two, whereas a smashed car (and I guess the *degree* of how smashed it is), *in general* is solved (unless the car is totalled), much longer, on average, than an hour or two.  This could lead to a powerful system.    In my engine (GLI, formerly CLUES), I use a simple form of ‘real world knowledge inference’ to ‘promote’ parse trees (that is, of the possible tens of thousands of grammatically correct trees, which ones are more ‘believable’ (more likely to ‘make sense’).

Of course these rules will relate to the everyday world if the bot’s first purpose is general conversation, but if a researcher in say quantum physics were to use it, those ‘real world common sense’ inference rules would be quite different !! smile

Dan Hughes - Aug 10, 2011:

I’m concentrating more on the NLU and semantic relationship side of things, which I’m developing from scratch using these many “theories” that I have   Surprisingly though so far, my ideas incepted from my research have been pretty solid to this point, the models seem to fit most test cases that I throw at it so I guess we’ll see where it goes

That is pretty much my entire focus also for now.  My first objective was to develop an extremely fast and efficent parser.  Currently, parse tree rules are compiled to machine code for absolute minimum CPU cycles per atomic rule.  Inference came second (‘semantic markup’ is interleaved with grammatical parse tree generation).  I’m currently at the Question/Answer stage (input question is converted to parse tree, then system does semantic comparisons with it and one-or-many previous fact parse trees, to generate a result).    If need be, the bot indicates when the ‘fact’ parse tree doesn’t quite match, (example: ‘F: Bob went to the store’,  ‘Q: Did Bob go to the expensive store?’  A: I’m not sure if it was ‘expensive’, but yes.’).  I call this functionality ‘flexxy matching’; meaning the system fulling understands both the facts and the question, and, even if there is extra (or missing) information in the facts used to supply an answer, it can be aware of that, and inform the user (or, take it into consideration in further processing).

 

 

 
  [ # 17 ]

... regarding the hungry/smashed car… perhaps the system could have a kind of ‘analog value’ to indicate, how permanent something is, in general (example, being ‘upset’, average perhaps 2 hours, whereas ‘unemployed’, perhaps weeks.

 

 
  [ # 18 ]

Bit of an ALF update for those that are interesed.

This past week has seen some rather interesting progress and development covered.  (may be quite a long one this, lots of exciting stuff smile )

The NLP rationalizer is now able to interpret sentences, quite complicated ones, with a good degree of accuracy, and the resulting rational data set returned is usually spot on.  Which is encouraging! smile  Pronoun lookup was a complete headache defining the rules to do so, but ALF is now able to interpret most pronoun combinations and contexts correctly. There is still some tweaking to be done, but for now, unless the required output is extremely complicated, ALF is able to handle me, my, i them, they, their, those, etc etc

Earlier this week, I made a start on fact recall, every data set that is returned by the rationalizer, is further processed and stored to a memory DB.  Every subject, object, action and fact is stored here pretaining to any sentence, so that ALF can recall information about a particular subject or object in the future.

Presently I am working on simple yes/no/maybe responses which can recall facts about any object or subject.  I’ll give a run down how it is working presently.

ALF first tried to determine if the input is a question, he does this by first looking for words that he knows can denote a question.  He then looks at the positioning of those words within the input.  Finally, he looks for any punctuation clues.

Once ALF has determined the input is a question, he passes that question through the rationalizer and obtains a data set for the question.

Past this point ALF no longer looks at the provided input question, but instead performs a lookup in his memory for any and all instances of the objects, subjects, actions and facts for all the corresponding items in the question.

Once ALF has obtained these, both the question dataset and all the recalled information for the elements of the data set are handled by the RATProcessor (Rational Processor) and this is where I was surprised.

I spent a day, looking at what a question constists of and what rules can be extracted from a simple “is” question.  As it turns out, to my surprise, the rule set is surprisingly small, and yet can handle any incarnation of an “is” question.

Although the rules that govern “is” questions are simple, the weighting values that govern the contituent parts of it, and thus the result were completely unknown and ALF returned almost every answer incorrectly. Some further research and development later, I was able to instruct ALF on incorrect answers, and he was able to modify the weighting of the rule’s algorithm components. Training ensued.

So, ALF runs the “is” rule set on the question & memory set pair and determines a weight for all possible answers and combinations, once this is done, a second rule (which Im keeping secret) then processes the results and finally selects a response.  Which is displayed to the “human”.

Now, I know all of this seems like a lot of work just to return a yes/no answer, and I could of just gone down the road of string matching/parse tree matching, but that isnt really what my inteded goal for ALF is and working towards “understanding ” of a question or statement.  Plus I think that method would very quickly fall over, or you would need to have many many rules to correctly return some of the responses below.

So some actual examples of interaction from simple to complex and further…. (I wont post the processing as before, as it would be VERY long):

Statement:  Dan is going to work.
Question: Is Dan going to work?  - Yes (simple!)

Statement:  Dan and Jenna are going to a movie.
Question: Is Dan going to a movie? - Yes
Question: Is Jenna going to a movie? - Yes
Question: Is Bob going to a movie? - I dont know.

The last response there is very interesting, ALF’s default respose with respect to an “is” question is “I don’t know”.  When I asked him that last question, I expected him to return “No” or perhaps “Maybe” due to the fact that he has information that some parties are going to a movie, Dan and Jenna, but with no mention of Bob.

With the response of “I don’t know”, I assumed that something had gone wrong and that the question process had failed (Exception throw or some kind).  However, after investigating, it turned out that ALF had indeed processed the question, and processed it correctly.  ALF had correctly determined, that just because I hadnt mentioned Bob in the original statement, that did not mean that Bob was not going to see a movie, be it with Dan and Jenna, or on his own.  Infact ALF had no information on Bob and movie’s, past or future, so he simply did not know if Bob was or not.

Next in my testing I wanted to try ALF with a statement, and then leave or change parts of the question to try and fool him.

For example…

Statement:  Dan is going to having a cup of coffee.
Question: is Dan going to have a cup of coffee? - Yes
Question: is Dan going to have coffee? - Yes
Question: is Dan having coffee? - Yes
Question: is Dan having tea? - No
Question: is Dan having a cup? - Maybe No

Interesting last response again….I confused him as I left it trailing….I am having a cup (of coffee) but I didnt finish the question, ALF tried to answer as accurate as possible by combining the Maybe & No to emphasis the Maybe downwards.  I guess this is a “correct” response.

Shortly after I looked at other possible question types with regard to tensing…..it seems that with the addition of a small modification, the “is” rule also pertains to all of the following “Did, Has, Are, Will, Can etc” thats the job to finish for today, and I’ll make a post back later on the results smile

Im sure theres questions hehehe smile

 

 
  [ # 19 ]

Is everything command line, or do you have an avatar, any TTS or STT ???

Any way you could manage a narrated screencast upload to YouTube?

 

 
  [ # 20 ]

“...a second rule (which Im keeping secret) then processes the results…” - Not very community spirited.

“Dan is going to having a cup of coffee” - Is this correct English?

Are we able to talk with this bot anywhere?

 

 
  [ # 21 ]
Steve Worswick - Aug 21, 2011:

“...a second rule (which Im keeping secret) then processes the results…” - Not very community spirited.

“Dan is going to having a cup of coffee” - Is this correct English?

nope

Dan Hughes - Aug 20, 2011:

1: Statement:  Dan is going to having a cup of coffee.
2: Question: is Dan going to have a cup of coffee? - Yes
3: Question: is Dan going to have coffee? - Yes
4: Question: is Dan having coffee? - Yes
5: Question: is Dan having tea? - No
6: Question: is Dan having a cup? - Maybe No

I added the line #‘s.  Line 1 - bad grammar.  Yes, a good bot should do the “extra permutations” and perhaps try the proper form of the verb (“have” instead of “having”), but it should probably be at least aware of this.  (That is, I don’t know if you should ignore the difference completely, in all cases).

Line 3, correct.  Will ALF, in the future, perhaps respond “Yes, a cup of coffee”  ?

Line 4 “Yes” isn’t really correct.  The statement said “is *going to….”  More accurate would be something like “I’m not sure, I know you said he is *going* to have a cup of coffee, but you didn’t specify when.”

Line 6 - proper response will require some fancy work, because correct response is something like “I don’t know of anything that Dan is having *currently*, but he is *going to* have a cup of coffee sometime soon as you stated”

 

 

 
  [ # 22 ]

In the beta version of Skynet-AI (version .004) I have extended his handling of these types of responses. Although he is getting better at them it is still relatively easy to have some of the neurons conflict. Even so, he does surprisingly well on the first volley.

AI LOG:
USER:Dan is going to work.
AI: OK. What else would you classify as going to work?
USER:Is Dan going to work?
AI: Well, didn’t you recently tell me Dan Is going to work.
USER:Dan and Jenna are going to a movie.
AI: OK. Are Dan and Jenna really going to a movie?
USER:Is Dan going to a movie?
AI: Well, you said:
- Dan and Jenna are going to a movie.
USER:Is Jenna going to a movie?
AI: Well, you said:
- Dan and Jenna are going to a movie.
USER:Is Bob going to a movie?
AI: Is Bob going to a movie?? Dan and Jenna.

The last response isn’t really that good, although it does tell you who is going to the movie.

 

 
  [ # 23 ]
Merlin - Aug 23, 2011:

AI: Is Bob going to a movie?? Dan and Jenna.
The last response isn’t really that good, although it does tell you who is going to the movie.

well….. a bit confusing, I thought perhaps the response was truncated.  It would be a good idea to just put an “are” at the end, “Dan and Jenna are”.  Who knows, maybe Dan and Jenna need to know if Bob is going to a movie. (clarity is a good thing smile )

 

 
  [ # 24 ]

The last question really allows 3 different responses.

1. I have no knowledge if Bob is going to a movie.
2. Dan and Jenna are.
3. Dan and Jenna are, I have no knowledge if Bob is going to a movie.

 

 
  [ # 25 ]

Mine didn’t handle the “and” but I can teach it at runtime:

> Dan is going to work.
Okay, Dan is going to work.

> is Dan going to work?
Yes, Dan is going to work.

> Dan and Jenna are going to a movie.
Okay, Dan and Jenna is going to a movie.

> Dan and Jenna is plural
Okay I have recorded Dan and Jenna as a plural form.

> is Dan going to a movie?
I have no knowledge that Dan is going to a movie.

> logicagent: if input =~ /(w+) and (w+) are (.*)/ then self.send(”#{$1} is #{$3}”); self.send(”#{$2} is #{$3}”) end
Okay [...]

> Dan and Jenna are going to a movie.
Okay, Dan and Jenna are going to a movie.

> is Jenna going to a movie?
Yes, Jenna is going to a movie.

> is Dan going to a movie?
Yes, Dan is going to a movie.

> is Bob going to a movie?
I have no knowledge that Bob is going to a movie.

> Dan is going to have a cup of coffee.
Okay, Dan is going to have a cup of coffee.

> is Dan going to have a cup of coffee?
Yes, Dan is going to have a cup of coffee.

> is Dan going to have coffee?
I have no knowledge that Dan is going to have coffee.

> going to have coffee = going to have a cup of coffee
Okay, going to have coffee = going to have a cup of coffee.

> is Dan going to have coffee?
Yes, Dan is going to have coffee.

> is Dan having coffee?
I have no knowledge that Dan is having coffee.

> having coffee = going to have a cup of coffee
Okay, having coffee = going to have a cup of coffee.

> is Dan having coffee?
Yes, Dan is having coffee.

> is Dan having tea?
I have no knowledge that Dan is having tea.

—-

Another way to handle the “a cup of coffee” = “coffee” rule is:

> logicagent: if input =~ /(.*) a cup of (.*)/ then response = self.send(”#{$1}#{$2}”) end
Okay [...]

> is Dan going to have coffee?
I have no knowledge that Dan is going to have coffee.

> Dan is going to have a cup of coffee.
Okay, Dan is going to have coffee.

> is Dan going to have a cup of coffee?
Yes, Dan is going to have coffee.

> is Dan going to have coffee?
Yes, Dan is going to have coffee.

 

 
  [ # 26 ]

Impressive work. I didn’t know that there is already Artificial Neural Network working. ( Sorry for my bady english, still learning)

Can we chat with ALF?
He seems to be quite interesting.

 

 
  [ # 27 ]

So I thought it was time for a bit of an update on progress….so here goes smile 

BTW most of this post will hardly even touch upon AI, as for the past couple of weeks, I have been working on other area’s which while relevant to the ALF end goal, are not really anything to do with AI development.  However, topics covered are most certainly things that many will have to think about if wanting to develop an AI that is closer to “strong” than just a mere chatbot.

Anyway, since the last update, quite a bit has happened with ALF.  Continuing on what I was working on the last time I posted, pronoun work was finished and I got cracking on the concept of “time”.

Took quite a bit of “time” to get ALF to understand correctly as there are a number of rules to understanding how time in a sentence should work.  Everything is relevant to the current time, which of course is always moving.

For example, if it is Wednesday and a subject states “I went to the park last Monday!”, that subject means 10 days ago, the Monday before the just passed Monday.  Even though the Monday just past, is correctly last Monday.

Similarly if the same subject states “I went to the park on Monday” the subject means the Monday just passed, 2 days ago.

Another tricky one is the statement of “I am going to the park on Monday”, as this is future tense, if it is Wednesday, then the subject means the coming Monday in 5 days time.  Confusingly if the subject stated “I am going to the park next Monday”, that subject STILL means, the coming Monday in 5 days time.

The same rules apply for months, years etc, so its very much one size fits all.  Phew. smile

From here I decided it was probably a good time to look at some large scale knowledge aquisition and the ability to recall.  What a job this has turned out to be!!

After working on a number of very large scale, commercial grade projects at one of my companies, I am well versed in the issues with under-estimating the effects of scaling.  On a number of occasions when putting an architecture together, using for development, then scaling up to commercial grade, a number of things have been overlooked, or under-estimated, which have led to redesign of some kind.

I wanted to avoid this and thus decided to jump in the deep end, and start at the kind of scales I expect to get to with regard to data handling and management.

To help highlight issues regarding any architecture (hardware and software) problems, I decided to start off with full mirrors of DBPedia, Freebase and YAGO databases.  Final database size was around 100GB

Starting crude, these were simply dumped into a MySQL database running on a fairly hefty piece of hardware in its own right.  Quadcore Intel i7, 16GB, 2 SAS 500GB drives in a RAID 0.

The object was to see how much load such a database presented to respectable hardware, and to collect some baseline timings on a bunch of queries etc.  As I assumed, it ran like a dog! smile

Next I wanted to see what kind of hardware would be required to achieve a “useable” knowledge base on a single box.  By “usable”, I was aiming for ~10 minute query time for a fairly complex query.  As with all databases, CPU mean’s nothing, RAM is king and fast discs are queens.

Results on a query of “list all Bruce Willis filmography, tv appearances etc” ended up at 6m32secs after all possible queaks and tuning on MySQL.  100GB DB, hardware was the same as above, but 32GB installed, with 6 SATA 320GB 15000RPM drives in RAID 10 config.

That brings us to a few days back. 

I was researching the possible use of SPARQL as a query engine to a MySQL backend, research was done using Jena, which, if any of you don’t know, is a RDF Ontology library that comes bundled with its own SPARQL engine called ARC that can interface with a number of various DB systems.

All was going well until I decided to try this out on the hardware above, and a database import through Jena with the various ontologies ensued.  First shock was that DB size had increased to around 150GB, and when running the same query above, well, I gave up after 30 mins waiting.  Something else was needed.

After spending some time poking around in Jena and the DB to see what it was doing, it turned out that there was a great deal of redundancy in the database.  I wont go into details, but to give an idea, the very same database, compessed with WinRAR’s “fastest” method, came out at a paltry 26GB.

I decided to ditch SPARQL and stick with what I know best, MySQL.  The idea is that a middle, custom layer, that will provide a lot of the kind of thing that SPARQL provides, with a very simple, backend MySQL database performing simple queries.

To try and preserve the RDF relationships between elements, and keep the size down, I have written a converter that takes a standard RDF or N-Triple data format, and convert’s this to a less redundant form.  Size of the source files after being passed through the converter are around 60% of the original, and yet still contain all information of the original sources.  As a result, DB size dropped to around 50GB (half essentially).

Further more, the “bruce willis” query above now executes in just over 5minutes, which is a good improvement just by juggling the data a little.

Next I moved to hardware, whilst 5 minutes is an improvement over the 6minutes (and an hour! smile, I have a target to resolve that query in 5 seconds or less.  Obviously the next port of call is hardware, and this is what I have been doing yesterday and today.

Lucky for me, one of my businesses deals in various consumer electronics, computer’s and components being one of the many things that we sell.  So it seemed only right that , being my stock, I should raid the warehouse for the stuff I needed, so I did, and brought home a big box full of goodies! smile

The idea was to build a cluster that will serve 2 purposes:

1. Primary as a distributed DB, where the large database can be split amonst many nodes, and some queries can run in parallel.  As they say, many hand’s make light work.
2. Additional processing power for the main “ALF Box” should it be required in the future.

So far I have put together 4 nodes, and assembled them in a vertical fashion, I am now testing the idea behind this, and if proves promising, I have further nodes to build and add to the cluster.

Each node is a Intel Quadcore i5 processor, and will have 16GB of RAM per node.  At present each node has a single SAS 320GB 15000rpm drive attached, and is connected to a gigabit switch.

In the attached pictures, there is also a black box next to the node stack, this is the main “ALF Box” that will do all the processing of data from the DB, NLP, Logic etc etc The spec of this is a AMD 8core Opteron with 32GB of RAM and 4 500GB SATA drives in RAID 10.

All the above is probably overkill for now, but as I had the means to go all out, I thought why the hell not smile

I’ll update as and when Ive got all the plugged together and talking to each other with the results smile

Adios.

Image Attachments
P1000300.jpg
 

 
  [ # 28 ]

Do you have any idea of how many read & write operations you perform for a single input/output set?

 

 
  [ # 29 ]

not as yet no.

At this point I’m still working on plugging this all together and communicating with each other.  My test’s we simple crude queries purely to test the load.

I’ll have a better idea of the numbers once ALF is up and running with both DB and a proper system to query it.

 

 
  [ # 30 ]

Well, it’s not quite a Cray, but I’m jealous, nonetheless. smile

I’m watching this thread a lot more closely now. I may not have much to contribute, but I’m still watching.

 

 < 1 2 3 4 > 
2 of 4
 
  login or register to react