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

Are bots just regurgitating an earlier reply? 
 
 

I know this seems very basic but how does a bot get? Is it just regurgitating an earlier reply? Or is it breaking them up and partially regurgitating them?

I have a question on quara about breaking down sentences https://www.quora.com/unanswered/If-you-were-going-to-analyze-short-stories-to-break-the-sentences-into-basic-interposable-variables-to-make-new-stories-how-would-you-go-about-it

Does it relate?

 

 
  [ # 1 ]
Don Patrick - Nov 16, 2016:

Yes the bot’s creator first makes a list of all expected inputs and writes them down along with default answers to return. When the bot gets an input, it simply looks it up in the list and responds with the corresponding default answer. Every answer is manually rigged.

Guess I should have waited a bit longer before asking this question.

But I would still like to know how to go about breaking down sentences

 

 
  [ # 2 ]

In traditional NLP one breaks sentences down in predicates, noun phrases and main verbs, or semantic roles, with the use of parsers like Stanford’s. Personally I break sentences down into subject-verb-object relations, aka fact triples. They often form the gist of a sentence, though you lose some nuance.
For random story generation, I’d probably go with noun phrases though, and use the remainder as templates. For instance:

... would probably go with ... though, and use ... as ...

Insert some noun phrases and you have a new sentence.

 

 
  [ # 3 ]

Parsing the sentence is the first part of the solution. As Don says, you need to identify the subject, predicate, direct and indirect object and assign them to roles. The predicate becomes a function call and the roles become its arguments.

To use this result it must be coupled with a knowledge base, typically encoded using first or higher order logic. The function calls produce a series of logical statements which can be confirmed or refuted by the knowledge base using logical resolution. The knowledge base maintains a model of the topics of the conversation and logical replies can be drawn from the model and expressed as sentences in natural language.

Here’s an example from VerbNet:

http://verbs.colorado.edu/verb-index/vn/urge-58.1.php#urge-58.1

The members section lists all the verbs with similar meanings, the roles section lists the arguments of the verb and restricts them according to various features such as concreteness or intelligence (useful for resolving ambiguity), and the final frames section lists the various patterns (syntax) in which you find those verbs and how the parts of the sentence map to the various roles. The semantics part defines a function call that you could use. You would still have to write the body of the function yourself, according to how your knowledge base works.

 

 
  [ # 4 ]
Andrew Smith - Nov 16, 2016:

Parsing the sentence is the first part of the solution. As Don says, you need to identify the subject, predicate, direct and indirect object and assign them to roles.


Roles = a part played in a particular situation
What do you mean by “assign them to roles”

 

 
  [ # 5 ]

The subject, direct object and indirect object are syntactic (defined by their form) in nature, whereas the roles are semantic (defined by their meaning) in nature. Some examples of roles are agent, patient, instrument, location or cause. Here are some examples, two sentences which mean the same thing but in which the subject and object assume opposite roles.

In “the bat hit the ball” the subject is “the bat” which has the role of agent and the direct object is “the ball” which has the role of patient, but in “the ball was hit by the bat” now the subject is “the ball” which is still the patient and the direct object is “the bat” which is still the agent. The overall difference is that the first sentence is active and the second sentence is passive. This is signalled by the use of the preterite “hit” in the first case and the past participle and preposition “was hit by” in the second version.

The patterns which are used to identify roles are called “verb frames” and there are hundreds of different ones used in the English language. You can use lexical resources like VerbNet or Valex which documents how they apply to thousands of different verbs to parse and decode them and obtain the actual meaning of a sentence from its broken down form.

 

 
  [ # 6 ]

Good explanations, Andrew smile. I didn’t know VerbNet could be used for disambiguation that way.

 

 
  [ # 7 ]
Andrew Smith - Nov 16, 2016:

To use this result it must be coupled with a knowledge base, typically encoded using first or higher order logic.

Hi Andrew,

Can you give some idea on how to create such a knowledge base and what to use . And thanks for the idea and explanation.

 

 

 
  [ # 8 ]

Hi Shamik,

The most complete solution that’s available is Cyc which you can learn more about here http://www.cyc.com/  There is an open source version available with limited capabilities which may be enough to get you started.

If you wish to explore completely free and unencumbered options then there is SUMO which is available from http://www.adampease.org/OP/

Both systems come with software enabling you to use them and while the underlying principals are the same (first order logic) they are not directly compatible as they use CycL and SUO-KIF respectively as their languages, nor are they aligned.

I am in the process of incorporating SUMO into my projects, but I still have a lot of work to do. I’ve written a scalable library for parsing and logical resolution, and my goal is to be able to process knowledge using standard English.

 

 
  login or register to react