[Olympus developers 132]: Re: Grammar Mapping
Antoine Raux
antoine.raux at gmail.com
Mon May 4 15:29:02 EDT 2009
Hi Marzieh,
The problem is that you shouldn't have several concepts in the
REQUEST_CONCEPT directive:
REQUEST_CONCEPT(date.month;date.day;date.week_day;date.date_rel;date.today_rel)
I know this is accepted by RavenClaw but I don't think it does what you
think. Basically, a given RequestAgent can only bind to one concept (if
there are several in the REQUEST_CONCEPT directive, only the first one
of the list is used).
From what I gather (and someone correct me if I'm wrong), only Dan used
multiple concepts in a REQUEST_CONCEPT (there's some example in
RoomLine). I believe the goal was to include the other listed concepts
in the expectations of this RequestAgent (but not for binding purposes).
In any case, unless someone has a good reason for its existence (besides
making RoomLine work as it is), I think this feature should be disabled
(or at least hidden and not documented) because it's confusing. If I'm
missing something and it does fulfill a need, then it needs to be better
documented. For now I'll modify the REQUEST_CONCEPT wiki page so that it
does not mention this.
So to address your problem, you have two solutions:
1) split your RequestAgent into 5 different agents (one for each of
"date.month", "date.day", "date.week_day"...)
2) write a binding filter and keep a single RequestAgent for the "date"
concept
(there's documentation on binding filters at
http://wiki.speech.cs.cmu.edu/olympus/index.php/RavenClaw_Grammar_Mappings_and_Binding_Filters)
I think you can get a reasonable behavior from both approaches. Which
one you choose depends on your vision of the problem:
if you consider "month", "day", "week_day", etc... to be different
entities that the user can talk about, then use approach 1)
but if you want your system to consider "date" as a single concept that
the user can provide (through different ways, like week_day, month_day,
etc), then use approach 2)
in addition, in this case, the CDayConcept should be a StructConcept as
opposed to FrameConcept (see
http://wiki.speech.cs.cmu.edu/olympus/index.php/Concepts_in_RavenClaw,
although this page is not finished...).
The key difference is precisely that a struct represents a single
entity (in this case a single specific day), whereas a frame is a bunch
of entities that are bound together. For instance, with a StructConcept,
grounding happens on the whole concept and you won't be able to ground
individual fields differently (e.g. user says "October 5th", system
responds "Did you say 6th?", while accepting October as grounded).
Anyway, my recommendation here would be to learn about binding filters,
create a "datetime" binding filter (based on the RoomLine one for
example, which exploits the DateTime Galaxy server for date resolution,
see
http://trac.speech.cs.cmu.edu/repos/olympus/example-systems/RoomLine/trunk/Agents/RoomLineDM/BindingFilters.cpp,
function DateTime4_DateTimeBindingFilter), and rewrite your request
agent as:
REQUEST_CONCEPT(date)
GRAMMAR_MAPPING("[month_day]>:datetime")
SUCCEEDS_WHEN(AVAILABLE(date))
I hope I'm not confusing you too much...
Good luck,
antoine
marzieh razavi wrote:
> Hi,
> I have defind a frame_concept_type with concept type class CDayConcept :
> DEFINE_FRAME_CONCEPT_TYPE( CDayConcept,
> ITEMS(
> STRING_ITEM(month)
> STRING_ITEM(day)
> STRING_ITEM(week_day)
> STRING_ITEM(date_rel)
> STRING_ITEM(today_rel)
> )
> )
> and I have defined CUSTOM_USER_CONCEPT date .
> In grammar section I have defined slots day and month_day:
> [day]
> ([week_day])
> ([today_relative])
> ([date_relative])
> ([month_day])
> ;
> [month_day]
> ([day_ordinal] *of [month_name])
> ;
>
> and in one of request agents I have used grammar mapping as follows:
> REQUEST_CONCEPT(date.month;date.day;date.week_day;date.date_rel;date.today_rel)
> GRAMMAR_MAPPING("[month_day.month_name],[month_day.day_ordinal],[day.week_day],[day.date_relative],[day.today_relative]")
> SUCCEEDS_WHEN(AVAILABLE(date.month)||
> AVAILABLE(date.day)||
> AVAILABLE(date.week_day)||
> AVAILABLE(date.date_rel)||
> AVAILABLE(date.today_rel) )
>
> but when I run the system and specify just the week_day , it does not respond.
> I was wondering if you could help me solve this problem.
> Best Regards,
> Marzieh
>
>
More information about the Olympus-developers
mailing list