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.
--- 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 frames require a full chapter to explain them. For a overview, read this decomposition of the example above:
. Show ..." instructions
are directed to the Speaker.
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 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.
---
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)
---
Anonymous