Menu

DialogFrames Log in to Edit

Richard Alexander Green

Dialog Frame Notation

In the Hum system, most dialogs are automatically constructed by the system. For example: When given a user goal, the Planner will construct a plan tree from task frames by back-chaining. When the plan tree is complete, the Planner will then determine what data is required to articulate the plan. Some data may be in the world memory and some may be needed from the user. The system's user interface actor will ask the user for needed data using whatever medium is available. If we are in contact with the user via HTML, an HTML page with HTML forms will be sent.

The purpose of a Dialog Frame is to describe a dialog between the user and the system. In the notation, a line starting with "U:" is something the user might say. A line starting with "S:" is the system's dialog response. A line starting with a dot "." is the system's action. This notation is the Hum equivalent of the Artificial Intelligence Markup Language (AIML) XML notation for natural language software actors.

Example
---
Dialog: User enters site.
U: Knock. (User appears at entry.)
S: Hello. What can I do for you?
. Show 'Activities'.
U: I would like to [act]. (Browse Catalog, Check Order Status, Cancel Order, Open Account)
S: An excellent choice! 
. Show [act].
. Switch context to [act].
---
Dialog: User browses product catalog. 
Context: Browse Catalog
U: I want * [product category].
U: Show me * [product category].
U: Do you have * [product category]?
S: Here are the different kinds of [product category].
. Show [product category] choices.
. Add [product category] to context.
---
Dialog: User is looking at specific product category.
Context: Media
U: Show me * by [artist].
S: Let us see if we have anything indexed that way.
. Show [product category] items by [artist].
. (If there are none, the "Show" format will say so.)
---
U: I want to buy [item.title].
U: I want to buy [item.number].
S: [item] is now in your shopping cart. 
   You may remove it later if you change your mind.
. Put [item] in shopping-cart.   
---

Think more carefully about how [entity] (see above "[item]") in dialog is related to a noun in an action statement or goal statement.

Dialog Frame statements

Dialog frames require a full chapter to explain them. For a overview, read this decomposition of the example above:

  • Dialog Frames start with a dialog statement ("Dialog: ...").
    - The sentence following the colon indicates the nature of the dialog.
  • A context statement ("Context: ...") indicates when the pattern that follows it will be applicable.
    - Just as humans need context to understand the intent of a verbal statement, the Speaker also needs some context. If the same pattern appears in two different contexts, the Speaker will attempt to disambiguate the situation by applying the contexts that are current.
    • When the system attempts to recognize the user's intent, it attempts to match patterns in each context according to the priority of the context.
    • It attempts the context with the highest priority first. If no match is found in that context, the next highest context is applied until a match is found.
    • If no match is found anywhere, the Speaker will tell the user that it does not understand what they have said and suggest that the user try to say it in another way.
    • In a more advanced implementation, the Speaker may ask questions to disambiguate the user's intent.
  • A line starting with "U:" indicates the user's speech act.
    - The speech act may be provided by direct input (the user actually typed a sentence of the given form or spoke the words) or as a result of interpreting a form that the user has filled in.
    • The "star" (*) notations
      in the pattern lines indicate some arbitrary string of words that might be there, or might not.
    • The [name] notations
      in the pattern lines indicate a term that is defined in a Dictionary Frame. The [name] notation will match any string of words that refer to an entity of the indicated type or super-type.
  • One or more lines beginning with "U:" form a pattern to be recognized by dialog system.
    - When the pattern is recognized, the system responds by interpreting the lines following "S:" (the remainder of the dialog vignette).
    • The response will often contain a mix of dialog lines which are displayed or spoken to the user, and instructions, which set goals to be fulfilled by the system or actions to be performed by roles (actors available to the system). Most instructions are directed to the dialog actor (the Speaker). For example, in the dialog frame above, the ". Show ..." instructions are directed to the Speaker.
    • Each goal will match the name of a task that is defined in a Task Frame. In the example above, several tasks are invoked. The corresponding task frames will contain actions assigned to the human interface actor:
      • "Show ... " - will display the entity or form that matches the remainder of the sentence.
      • "Switch context to ..." - will change the dialog context. Future input from the user will be recognized and interpreted in the given context. (In a more advanced system, multiple contexts are permitted but the indicated context is given priority.
      • "Add ... to context." - adds the term (in ...) to the context. Prior terms in the context remain in effect also.

 

Dialog Example - "Hello World"

Here is the proverbial "Hello World" example:

---
Dialog: Hello world example.
U: Knock knock. (User appears at our entry.)
S: Who's there?
. Set context to "first name".
---
Context: first name.
U: *
S: * who? 
. Set context to "last name".
. Assert: User's first name is *.
---
Context: last name.
U: *
S: Hello, [firstName] *.
. Assert: User's last-name is *.

In the example above, the "Assert:" instructions go to the "Assert" actor. Other instructions go to the Speaker by default because no role is indicated. Roles are indicated by the instruction syntax
". (role): ..." - with a role-name and a colon preceding the statement.
This is the same syntax that we use in task frames and role frames to indicate what role is performing an instruction.


Data Frame Notation

Data frames are used to communicate data. They are used in message payloads between actors and resource managers, and to record configuration data. Hum authors (programmers) will rarely need to write data frames but may want to read them.

Syntax / Example
---
Data: (data set name)    << Indicate a data frame. Give the frame a name/title.

Worker                   << The following data is for a worker (entity). 
. ID: (string)           << The system knows an ID should be unique.
. name: (string)         << provides the data value for worker's "name" attribute.
. Home Address           << "Home Address" is an embedded entity.
. . line1: (string)
. . line2: (string)
. . postal code: (string)<< "Reader" and "Smart Editor" validate values.
. age: (string)          << This value should be a positive integer.

Site                     << The following data is for a Site (entity)
. name: (string)         << name of site

. description:           << The description of the site is in text format.
"""                      << Arbitrary text delimited by triples as shown here.
(text)                   << The text data starts on the line after the triple.
"""                      << A triple (""") or (''') starts and ends the text.

. Site Address           << "Site Address" is an embedded entity.
. . line1: (string)
. . postal code: (string)
---

Discussion

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB