DCG-NL

Purpose

Provides parsing and ICL translation for a set of English sentence types for basic queries, actions and assertions. Vocabulary is collected dynamically -- as new agents connect to an OAA Facilitator, their new verbs, nouns, adjectives, and so forth will be routed and installed locally in this agent. New sentence types can also be brought dynamically by the agent community using the solvable nl_sentence_ext().

Description

The goal of this agent was to enable extremely SIMPLE definition of new words. Consequently, no sophisticated reasoning based on sorts (types) is performed. To add new words, call oaa_AddData(vocabulary(Type,Def),[]) where Type may be:
   noun            : e.g. manager, weather
   verb            : present/past tense verbs.  e.g. allows
   imp_verb        : imperative verb.  e.g. send
   inf_verb        : infinitive verb.  e.g. go
   intr_imp_v      : imperative intrastitives.  e.g. quit
   pn              : proper nouns e.g. 'Adam Cheyer', 'Boston'
   adj             : adjectives.  e.g. red, big
   adv             : adverbs.  e.g. quickly.  Adverbs are presently 
                     ignored in resulting ICL expression.
   prep            : preposition.  Many preps are already defined but
                     you may additional ones if the current set doesn't
                     meet your needs.

Def should be a list containing the "semantics" and "syntax" of the word, where the semantics is what is generated in the ICL and the syntax are the words that will appear in the sentence.

     oaa_AddData(vocabulary(noun, [manager, boss]),[])
         who is my boss?    -->  manager('Adam Cheyer', [], X)

Prepositional attachments, a complicated subject to get right for all cases, are handled in a simplified way, where they are gathered along with adjectives in a parameter list. This defers the interpretation to the implementer of the predicate.

   eg: find all cheap hotels with a pool -->
      oaa_Solve(hotels([cheap, with(pool), X), [strategy(query)])

A large "show" grammar is included as part of the imperative and query sentence types. This accepts a number of sentences expressed with common prefixes such as:

   I'm interested in knowing more about XXXX.
   Tell me about XXX?
   Can you please tell me XXX?
As demonstrated by the example above (find all hotels), queries and imperatives try to map into the same representation:
   Find the manager of adam cheyer.
   Who is the manager of adam cheyer.
   Can you tell me who the manager of adam cheyer is?

        all produce: 

   oaa_Solve(manager('Adam Cheyer', [], X), [strategy(query)])

The general ICL structures generated are in the form:

   
   verb(+DirectObject, +ParamList)
     e.g. send mail to Bill   --> 
              send(mail, [to(bill)])

   noun(+DirectObject, +ParamList, -ResultVar)
     e.g. Find the manager of adam.  -->
              manager(adam,[], Manager)

Parameter lists contain adjectives and prepositional phrases, and are included even if empty to simplify writing the predicates.

When working with large databases and such, it is often prohibitive to have to declare then entire contents of the database as vocabulary words. In an attempt to handle this problem, DCG_NL will try to "guess" the type of unknown words, and if an unknown one or two word sequence could be a proper name, the PN type will be used.

   Send mail to Kachru Ravinder.
   What is the weather in Bosnia?

These sentences will parse without even though "Bosnia" and "Kachru Ravinder" are not defined as vocabulary words. Although the strategies used work in many cases, be warned that unexpected results may occur. To turn off word guessing, call the solvable nl_to_icl() with the parameter guess(false).

DCG-NL's syntactic rules can be extended by defining solvables for nl_sentence_ext and nl_translate_ext for a particular domain.

ICL Solvables

Sentence Types

Noun Phrases

Noun phrases, whether in commands, queries, or fact assertions, can be modified by (a) relative clauses, (b) preposition phrases, and (c) adjectives.
  • a) Relative Clauses
         Find a hotel that serves breakfast.
         find the hotel where karen is.
         Send the message adam cheyer sent to karen to robot one.
    
  • b) Prepositional Phrases
         Find a hotel for less than ten dollars within two miles of downtown.
    
  • c) Adjectives
        Find a cheap good hotel.
    

    Sentence Type: Facts and Statements

       Mail arrives.
       Karen manages Bill.
       Karen is cheap.
       The manager ran.
    

    Sentence Type: Queries

       a) AUX STATEMENT
         Will mail arrive?
         Does Karen manage Bill?
    
       b) WH VP
         Who manages Bill?
         Who sent the mail?
         Who sent the mail to Bill?
         Who arrived?
    
       c) WH AUX STATEMENT
         Where will the mail arrive?
         When will the mail arrive?
         Who is the manager of Bill?
         Who is Bill's manager?
         What is the time?
         Which hotel is Bill at?
         Who does Bill manage?
    

    Sentence Type: Imperatives

       Move the hotel.
       Move the hotel there.
       Robot one, move the hotel to there.
    
       % Find/show sentences are now actually queries...
       Find the chepeast hotel within two miles of downtown.
       Find a hotel between downtown and chinatown.
       Find all hotels for less than ten dollars.
       Find a hotel between ten and twenty dollars.
       Find all mail from karen about "security".
       Find all mail from karen about security.
    

    Sentence Type: Conditionals

    If, When Whenever.
       If mail arrives for me, send it to Karen.
       Whenever news exists in "ba.jobs" get it to Karen.
    

    Information

    Author: Adam Cheyer

    Version: 2.0

    Language: Prolog (Text-based, UNIX)

    Availability

    Free download with source code, under restrictions of the OAA Community License.


    Adam Cheyer < cheyer@ai.sri.com>
    1999