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
 
 

Hey folks, thought that I would start a project thread for ALF.  So here goes smile

What is ALF?

The inception of ALF was for reasons quite different to the norm around here, where the initial goal was not to build a “chatbot”  at all.  ALF was/is primarily for use within a company that I own which deals with various shopping services on the web, the most prominent of which is consumer price comparisons.

ALF’s function in this domain is primarly the following:

[ul][li]To scour various shopping sources on the internet and preen out product information from a number of websites.  This information may conform to an ontology known as “Good Relations”, or it may be very sparce with no such things as product EAN’s and the like.  ALF would be required in a number of cases to “understand” what the product was, and attempt to match it to already existing products in the database, and if needed append, update or create items in the database for inclusion into the price comparison results[/li]

[li]
To learn about customers, thier purchasing preferences, and if linked, to read thier Facebook, Twitter and any other sources available to determing what they may be interested in purchasing.  An example is that a person with an account posts onto Facebook that they are going on holiday, ALF should understand this, and may present that customer with a list of “Dont forgets…” that ALF knowns are commonly taken on holiday.  This list of “Dont forgets…” will be then linked to various product pages that the customer can navigate to.
[/li][/ul]

However, the idea for ALF has moved on further than the 2 purely commercial activities above.

As I was researching deeper on how to achieve the above goals, it became very apparent that ALF would become, simply by due course, a very comprehensive source of information simply due to its nature of fulfilling the above.

The current goals for ALF (will probably change), while still keeping the initial goals above a requirement are as follows:

[ul]
[li]
Present information on various topics when asked questions about them
[/li]
[li]
Be able to have a conversation with ALF
[/li]
[li]
Recall past conversations and associate with current conversation context
[/li]
[li]
Give instruction to ALF for various tasks “Find me information from Google on x”
[/li]
[/ul]


Technologies

At present I have determined that ALF will need a solid platform including the following technologies.  These will also most likely grow as development continues and “feature creep” sets in:

[ul]
[li]
NLP - Currently in progess.  Used to simplify a sentence into Subjects, Actions, Elements and Objects.  Allows for easier processing of input information.
[/li]
[li]
NLU - “Understanding” of input and how it corresponds to items in the datasets.
[/li]
[li]
ANN - Will be used for a number of functions, spell checking, grammar checking, image-recognition (primarliy to assist in product matching from product images)
[/li]
[li]
Datasets - Initial inclusion developed, required integration.  ALF will use extensive lexical and semantical datasets to enhance associatons and help to detarmine context.  Wordnet, Standford style NER, YAGO, OpenCyc etc
[/li]
[/ul]

Why is it called ALF?
A homage to Batmans butler, Alfred, as he knows pretty much everything about everything and assists Batman in various tasks smile

I’ll make some more posts on current happenings a little later.  At present its development of phase 1 of the NLP functionality and it is making good progress.  I’ll present some examples of what its doing and how it fits into the grand scheme of things when appropriate.

Thanks

 

 
  [ # 1 ]

You had me up until ANN. All the other acronyms are known to me, but I must’ve napped in class the day that one was discussed. smile Care to expand?

Also, some questions, just out of curiosity:

1.) Which platform/programming language are you using to develop in?
2.) do you have any mechanisms in place to reduce/prevent “parse-tree explosion”, or are you even using parse trees in your NL processing?
3.) Is ALF now, or will he be, available publicly for crowd-source testing?
4.) If you had three pears, and an alligator bit off your right pinkie-toe… Oh, wait. That’s a question for someone else! Sorry. smile

 

 
  [ # 2 ]

Sure, NLP is Natural Language Processing, NLU is Natural Language Understanding, ANN you know, NER is Named Entity Recognition…Dan is a Person, Microsoft is a Company, USA is a location etc etc YAGO, OpenCyc etc are just collections of data regarding various things.

1.)  At present its being developed in Java.  As we move along, components that require heavy lifting will probably be re-implemented in C for speed.
2.)  Its using parse tree’s for a portion of the NL processing, really to be able to determine Part Of Speech and grammatical relations between the phrases and words.  Past that point parse tree’s are no longer used or reference as a Subject->Object relationship structure is created from the NL parse tree’s.
3.)  Not at present, its still very much in early stages, but yes, inthe future there will be a useable version of him available.

 

 
  [ # 3 ]

Actually, I think you misunderstood me. I know what NLP, NLU and NER all stand for. It’s ANN that I’m lost with. smile As for the rest, thanks! That whole USA thing was throwing me for a loop! raspberry

 

 
  [ # 4 ]

Oh sorry, ANN is Artificial Neural Network smile

 

 
  [ # 5 ]

Thanks for that. Now I’m not so lost. Well, that’s not exactly true. I’m still lost; just not as confused.

 

 
  [ # 6 ]

ANN: Artificial Neural Network, the theme of my thesis in 1993 (18 years ago, I almost can’t believe this is true). My thesis was named: ‘stochastic behaviour of artificial neural networks’, wrote it in English, but unfortunately, the WordPerfect 4.2 file has got lost along the way, so I can’t upload it here…

 

 
  [ # 7 ]

Bit of an update on progress, which is moving forward very well.

Continuing with the development of NLP and NLU, along with now remembering and storing information on past converstations, statements etc.

One of the trickier things recently was the use of pronouns in a sentence.  More specifically, the creation of the rules that define, how to substitute a pronoun for the correct subject or “person” context.

This is now working quite well and along with other NL work done this week, ALF is now able to structure a comprehensive data set that describes the actions/objects and events from a fairly complicated sentence.

For example:  “Dan and Jenna went to the park, they had a good time.” produces the data structure below.  Note: that ALF has correctly interpreted “they” to mean Dan and Jenna, and he has associated the corresponding action/attributes to both those subjects.

{
"actions": {
"had-10": {
"actees": [
"Jenna-3",
"Dan-1"
],
"action": "had",
"actors": ["time-13"],
"posid": "had-10",
"tense": "past",
"time": "Sat Aug 13 13:29:51 BST 2011"
},
      “went-4”: {
"actees": [
"Dan-1",
"Jenna-3"
],
"action": "went",
"actors": [],
"posid": "went-4",
"requirements": [{
"object": "park-7",
"req": "to"
}],
        “tense”: “past”,
        “time”: “Sat Aug 13 13:29:25 BST 2011”
      }
  },
  “objects”: {
"park-7": {
"actees": [],
"actors": [],
"classification": "O",
"det": "the",
"name": "park",
"posid": "park-7",
"type": "prep"
},
      “time-13”: {
"actees": [],
"actors": [],
"amod": [{"good-12": "good"}],
        “classification”: “O”,
        “det”: “a”,
        “name”: “time”,
        “posid”: “time-13”,
        “type”: “dobj”
      }
  },
  “subjects”: {
"Dan-1": {
"classification": "O",
"name": "Dan",
"posid": "Dan-1",
"subject_actions": {
"had-10": {
"actees": [
"Jenna-3",
"Dan-1"
],
"action": "had",
"actors": ["time-13"],
"posid": "had-10",
"tense": "past",
"time": "Sat Aug 13 13:29:51 BST 2011"
},
          “went-4”: {
"actees": [
"Dan-1",
"Jenna-3"
],
"action": "went",
"actors": [],
"posid": "went-4",
"requirements": [{
"object": "park-7",
"req": "to"
}],
              “tense”: “past”,
              “time”: “Sat Aug 13 13:29:25 BST 2011”
          }
        },
        “type”: “nsubj”
      },
      “Jenna-3”: {
"classification": "PERSON",
"name": "Jenna",
"posid": "Jenna-3",
"subject_actions": {
"had-10": {
"actees": [
"Jenna-3",
"Dan-1"
],
"action": "had",
"actors": ["time-13"],
"posid": "had-10",
"tense": "past",
"time": "Sat Aug 13 13:29:51 BST 2011"
},
          “went-4”: {
"actees": [
"Dan-1",
"Jenna-3"
],
"action": "went",
"actors": [],
"posid": "went-4",
"requirements": [{
"object": "park-7",
"req": "to"
}],
              “tense”: “past”,
              “time”: “Sat Aug 13 13:29:25 BST 2011”
          }
        },
        “type”: “nsubj”
      }
  },
  “type”: {"type": "S"}
}

 

 
  [ # 8 ]

I see the system time stamps different nodes in the datastructure.

I guess the current system date is the default if the user didn’t specify the date, thus

“Dan and Jenna went to the park, they had a good time.”  is the same as if you entered

“Dan and Jenna went to the park today, they had a good time.”

Will the sysetm support (or perhaps already does), something like:

“Dan and Jenna went to the park last Saturday afternoon, they had a good time.”

A very advanced ‘time-resolving’ functionality would be something like

“The last time Uncle Henry was visiting, Dan and Jenna went to the park, they had a good time.”

The system would have to first know enough that it has to resolve when “last time Uncle Henry was visiting” , then use that to time stamp the other event (of Dan and Jenna going to the park).

Don’t worry, I have a long way to go before handling that as well! Its a huge job!  I call this functionality ‘ST3R’ (= STTTR, or ‘sub-tree-to-term-resolving’).  I gave an example of this in my electronics example in another thread: ‘What is the current through the resistor that is in parallel with R1?’  If the system knows there is only 1 resistor in parallel with R1 (say R2), it knows to reduce this to “What is the current through R2?” , and then re-submit it to itself.  Of course if R2 and R3 are in parallel with R1, it would know and say for example ‘buddy, there are 2 resistors in parallel with R1, which do you mean, R2 or R3?’

I call it ST3R because it will literally take a ‘sub-tree’ of the total parse tree generated, resolve a subtree to a term, and regenerate a simplified parse tree, and submit again.  I’m probably about 6 to 9 months away from starting the design of this functionality.

Preemptive comment—- in this example I don’t care at all about the fact that the statement deals with electronics, or Ohm’s Law… that is irrelvant to the point, it is the concept of language handling I’m trying to make a comment on (previously a forum member became angry because I used an example of 50 volts instead of a more ‘normal’ 5 volts…. believe it or not!)

 

 
  [ # 9 ]

Hi Victor,

Thanks for the post.

The time stamp on actions and elements (not shown) serves 2 purposes. 

1.  It allows ALF to have a real concept of time, for example, if I was to say “Dan is hungry!” thats present tense, and means I am hungry now.  However, if I ask ALF a few hours later if “Is Dan hungry?”, then some time has past since I was hungry, so he would respond with something along the lines of a maybe as most probably I have fed myself in the meantime and so may not be hungry anymore, ALF just doesnt know.

However, ALF knows that hungry is not a permanent state such as something like “The car is smashed”, so in that case ALF will always respond that the car is smashed, unless I tell him otherwise.

2.  The second purpose is indeed to do with time management in the domain that you have suggested.  This is something that I am working on at the moment and will be able to handle complex time situations akin to the one that you have mentioned.  Currently it can handle simple time expressions such as next Saturday, last Sunday and as development progresses the rules that govern these other time expresions will be defined.

The time handling development is currently on hold at the moment, as Im working on pronouns (which is a pita of a job) and the ability to recall subjects from a number of sentences ago if the context has not changed yet.

 

 
  [ # 10 ]
Dan Hughes - Aug 15, 2011:

However, ALF knows that hungry is not a permanent state such as something like “The car is smashed”, so in that case ALF will always respond that the car is smashed, unless I tell him otherwise.

How does ALF know that some states are persistent and others not? Is this written in by hand or learned in some way? If it is learned, how precise does the input language have to be for ALF to understand?

Dan Hughes - Aug 15, 2011:

The time handling development is currently on hold at the moment, as Im working on pronouns (which is a pita of a job) and the ability to recall subjects from a number of sentences ago if the context has not changed yet.

How does ALF weigh the importance of one sentence’s subject vs. others? How does he know the broader topic? Since my knowledge storage consists of linked parse trees, I was planning to choose those subjects which are most heavily linked to as setting the “context”. But I haven’t played with this yet and I’m interested in how you approach it.

 

 
  [ # 11 ]

How does it do it?  Hmm I’m trying to think of a way to describe how the setup currently is so that I dont end up writing an entire paper as a post smile

I guess the best way to describe it is the initial foundation of it is “hard coded”, kind of like how many human functions are hardcoded, instinct, emotions, etc are all functions that are already there, which are influenced by knowledge or environment.  We as humans categorise everything, day and night, but if you drive those categories back to thier “root”, you always end up with one of a finite number of categories, which are then associated with new categories which the brain as made as it see’s fit.  Most of us on here seem to be aware of this anyway, so I shall digress on that particular thread no longer.

Essentially ALF has a set of definded catagories, which have a number of properties attached to them.  These properties can change if and when ALF decides they need to be (I’m not there with that yet, thats WAAAY in the future).  One of those categories is “entities”, which basically constitutes of a living thing, living things have emotions, state’s of feeling or need, that can change frequently.

If I was to say that “Bob is sad.” and ALF did not have a definition of sad, although he would likely assume that Bob was an entity, and that “sad” was an element or attribute of the entity “Bob”, he would not know what “sad” actually constituted or referred to.

The idea is then that ALF would query what sad was, and if I was to retort with “Sad is what people feel when bad things happen to them, or something upsets them”,  providing that ALF already had enough learned information, he should then be able to deduce from previous aquired knowledge, or semantic associations as follows.
“Sad” is an emotional element of an enitity, due to the word feel, reinforced by the word people, knowing that bad constitutes a negative action or event.  Sad would then be associated with negative actions against an entity and is a none persistent emotion that can be modified if none-bad actions are enforced upon that very subject.

I’m very much skimming the surface here, but essentially it all revolves around a bunch of baseline categories and properties, drawing upon possibly large amounts of relational knowledge from previous conversations and the like.

Does that make any sense?  Hehe smile

As for the specific nature of the language required, at the moment I need to be quite specific, but thats only due to the current state of the NLP & NLU modules.  As these are progressing I can be more ambiguos and general in my instruction and still obtain the same result.

I would imagine that once these 2 modules are further advanced, that the required specific’s will reduce further.

Still with me?

Also I made a mistake in my explantion of how I look back for pronouns…DOH!  I meant the “subject context” as in me, him her, them, not the contextual meaning of the sentence itself.  Thats a completely different kettle of fish.  Sorry about that.

 

 

 
  [ # 12 ]

Ah, so most of this is still “in theory”. smile I’ll be interested to see how your ideas get fleshed out.

Another question: Are you building your NL parser “from scratch” or implementing some developed algorithm? Is it context free? If not, from where (what type of knowledge base) does it derive context? What types of phrases/clauses/etc. can it handle? How accurate is the phrase attribution?

 

 
  [ # 13 ]

Oh yeah it’s all still very much in theory, like I mentioned, I have spent a long time researching, simple Proof of Concept’s on various elements, ideas etc development is only about 3 weeks so far.

The NL parser I’m using at the moment is the Stanford implementation.  I’m modifying it in places as I move along where needed, but does a pretty good job for what I want to do in these early stages, so why re-invent the wheel.  If need’s be at a later stage, or if ALF “outgrows” it (is that possible?!) then I may implement from scratch if I have specific requirements.

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 smile  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 smile

 

 
  [ # 14 ]

Is this the parser software that you are using?

http://nlp.stanford.edu/software/lex-parser.shtml

They have an interesting range of software available.

http://nlp.stanford.edu/software/index.shtml

Don’t forget that you will have to release *all* your source code if you are going to distribute your software, because their stuff is published under the GPL, not the much weaker LGPL. I wonder if there are any better NLP libraries available for commercial use. Of course the GPL doesn’t preclude commercial use and it doesn’t force you to release the data that you use with it, but it does prevent you from making “secret” modifications to the algorithms.

 

 
  [ # 15 ]

Yup that’s the one.  Its not perfect, but it serves as a good starting point to build and test my other ideas & theories.

I understand the clauses of GPL, I dont think ALF will be ready to distribute any time soon so I’m “safe” for now. smile

 

 1 2 3 >  Last ›
1 of 4
 
  login or register to react