Phoenix Server

From Olympus
(Redirected from Phoenix)
Jump to: navigation, search

The Phoenix Server is a Galaxy-wrapped version of the Phoenix robust semantic CFG parser.

For each application you need to specify a grammar using two files (examples below): a ProjectnameTask.gra file, and a ProjectnameTask.forms file. See the Phoenix Grammar Reference for more information. A grammar compiler creates the actual configuration for the parser.

Grammar design and authoring involves first determining the main set of tasks that the application will handle; these are specified in the .forms file. Grammar rules are specified in the .gra file. The examples below will give you an idea of where to start. You should also be familiar with the process outlines in Logios.

Those two files form the task grammar. The compiler also reads in the contents of the Generic.{gra|forms} files (these come with the Olympus distribution). The Generic grammar provides some standard forms, such as Social and YesNo, as well as discourse entities such as Help, Repeat, etc. You may use the Generic grammar as is, edit it as needed, or even replace it.The standard Build script for an application uses the Logios package to automatically re-compile the grammar, each time it is invoked. The language can be compiled in other ways, see MakeLM.

You can test Phoenix grammars with parse_text.exe. This version is built against cygwin. See page 21 of the Phoenix Manual for instructions.

ProjectnameTask.forms

A forms file lists the functions that are expected by the application along with the grammar nets that can realize those functions. Here is a simple example (courtesy Dan Bohus):

FUNCTION: Statements  %%0.1%%
    NETS: 
	[UserPIN]
;

FUNCTION: Queries %%0.4%%  
	[QueryWhen]
	[QueryWho]
	[QueryAgenda]
	[QueryActionItems]
;

FUNCTION: MeetingRef  %%0.3%%
    NETS: 
  [MeetingReferent]
;

FUNCTION: Commands
    NETS:
  [ReadNotes]
;

# these auxiliaries are defined in order to capture some parses like
# next, this that, which o/w would parse as date-time
FUNCTION: Auxiliaries
    NETS:
	[__datetime_junk]
;

ProjectnameTask.gra

The grammar file defines a CFG to realize the nets contained in the forms file. See Phoenix Grammar Reference for details. Logios provides some extensions to the grammar formalism. Here is an example (courtesy Dan Bohus):

###################################################################
# AUXILIARIES
###################################################################

[__datetime_junk]
	(next)
	(this)
	(an)
;

[_was]
  (was)
  (were)
;

###################################################################
# MEETING REFERENTS
###################################################################

[_meeting]
  (*the *group meeting)
  (*the one)
;

[last_meeting]
  (the last [_meeting])
  (my last [_meeting])
;
  
[previous_meeting]
  (the previous [_meeting])
  (my previous [_meeting])
  ([_meeting] before *that)
;

[that_meeting]
  (that [_meeting])
  (it)
;

[MeetingReferent]
  ([last_meeting])
  ([previous_meeting])
  ([that_meeting])
  ([_meeting])
;

###################################################################
# STATEMENTS
###################################################################

[user_name]
  (dbohus)
  (air)
  (banerjee)
  (archan)
  (dhuggins)
  (yitao)
  (dan)
  (alex)
  (bano)
  (arthur)
  (david)
  (i)
  (me)
;

[UserPIN]
	([user_name])
;

###################################################################
# QUERIES
###################################################################

[QueryWhenAndWho]
  ([QueryWhen] *and [QueryWho])
;

[QueryWhoAndAgenda]
  ([QueryWho] *and [QueryAgenda])
;

[QueryWhen] # set probabilities using a comment (#) in the gra file.
  (WHEN was [MeetingReferent] *held) #%%0.7%%
  (WHEN did [MeetingReferent] HAPPEN) #%%0.3%%
WHEN
  (when)
  (at what time)
  (on which day)
HAPPEN
  (happed)
  (take place)
;

[QueryWho]
  (who ATTENDED *IN_MEETING)
  (HOW_MANY *PEOPLE ATTENDED *IN_MEETING)
HOW_MANY
  (how many)
  (which)
PEOPLE  
  (people)
  (participants)
ATTENDED
  ([_was])
  (attended)
  (participated)
  (went to)
  (met)
  (were the participants)
  (were the attendees)
IN_MEETING
  (*at [MeetingReferent])
  (in [MeetingReferent])
  (*in there)
;

[QueryAgenda]
  (what [_was] THE_AGENDA *IN_MEETING)
  (what WAS_TALKED *IN_MEETING)
THE_AGENDA
  (the agenda *items)
WAS_TALKED
  (was talked about)
  (did we talk about)
  (did they talk about)
  (was discussed)
  (did we discuss)
  (did they discuss)
IN_MEETING
  (*at [MeetingReferent])
  (in [MeetingReferent])
  (for [MeetingReferent])
  (*in there)
;

[QueryActionItems]
  (what [_was] the ACTION_ITEM)
  (what HAS_BEEN DECIDED *TO_DO *IN_MEETING)
  (DOES [user_name] have *any *action items)
  ([_was] *there ANYTHING DECIDED *IN_MEETING)
  ([_was] *there ANYTHING ASSIGNED_TO [user_name] *IN_MEETING)
  (DID_WE_ASSIGN ANYTHING to [user_name] *IN_MEETING)
  (DID_WE_ASSIGN [user_name] ANYTHING *IN_MEETING)
  (what *ACTION_ITEM DID_WE_ASSIGN to [user_name] *IN_MEETING)
  (what ACTION_ITEM did [user_name] GET *IN_MEETING)
  (what [_was] *the ACTION_ITEM for [user_name] *IN_MEETING)
  (what [_was] ASSIGNED_TO [user_name] *IN_MEETING)
DECIDED
  (decided)
  (decide)
  (assigned)
  (assign)
TO_DO
  (to do)
HAS_BEEN
  ([_was])
  (has been)
  (did we)
  (did they)
DOES
  (do)
  (does)
ANYTHING
  (*any ACTION_ITEM)
  (anything)
  (something)
ACTION_ITEM
  (*action items)
  (*action item)
  (tasks)
  (decisions)
  (to do items)
  (to do list)
ASSIGNED_TO
  (assigned to)
  (for)
IN_MEETING
  (in [MeetingReferent])
  (*at [MeetingReferent])
DID_WE_ASSIGN
  (were assigned)
  (did we assign)
  (did we give)
  (did they give)
  (did they assign)
GET
  (get)
  (have)
;

###################################################################
# COMMANDS
###################################################################

[ReadNotes]
  (read me the notes)
;
Personal tools