Akshay Work

download Akshay Work

of 37

Transcript of Akshay Work

  • 8/8/2019 Akshay Work

    1/37

  • 8/8/2019 Akshay Work

    2/37

    Speech Recognition Grammar Specification(SRGS) is a W3C Recommendation for specifying

    speech recognition grammars

    Grammars define the words andphrases a speechrecogniser may recognize

    Grammars constrain speech recognition input toimprove recognition performance and accuracy

    Introduction

  • 8/8/2019 Akshay Work

    3/37

    Two equivalent forms of SRGS:

    XML Form

    ABNF Form

    SRGS is often used in conjunction with othertechnologies, for example:

    VoiceXML

    SALT

    MRCP

    Introduction

  • 8/8/2019 Akshay Work

    4/37

    Tutorial contents:

    XML Form of SRGS

    ABNF Form of SRGS

    Using SRGS with VoiceXML

    Goal: Enough knowledge to write functionalgrammars in both forms

    Introduction

  • 8/8/2019 Akshay Work

    5/37

    yes please

    XMLForm: Basic Structure

    One or more rules

  • 8/8/2019 Akshay Work

    6/37

    XMLForm: Basic Structure

    Root rule

    yes please

  • 8/8/2019 Akshay Work

    7/37

    XMLForm: Basic Structure

    Type of grammar; DTMF

    grammars possible also

    yes please

  • 8/8/2019 Akshay Work

    8/37

    XMLForm: Basic Structure

    Language

    yes please

  • 8/8/2019 Akshay Work

    9/37

    XMLForm: Sequences and Alternatives

    Sequence

    yes please

    no thanks

  • 8/8/2019 Akshay Work

    10/37

    XMLForm: Sequences and Alternatives

    yes please

    no thanks

    Alternatives

  • 8/8/2019 Akshay Work

    11/37

    XMLForm: Rule References

    Rule Reference

    one

    two

    three four

    five

    six

    seven

    eight nine

    zero

    ten

  • 8/8/2019 Akshay Work

    12/37

    Exercise 1: Write a grammar for digits

    0 to 19

    XMLForm: Exercise

    one

    two

    three four

    five

    six

    seven

    eight nine

    zero

    ten

  • 8/8/2019 Akshay Work

    13/37

    ten

    eleven

    twelve thirteen

    fourteen

    fifteen

    sixteen

    seventeen

    eighteen

    nineteen

    zero

    Exercise 1: Answer

    XMLForm: Exercise

  • 8/8/2019 Akshay Work

    14/37

    XMLForm: Repeats

    very

    good

    very

    good

  • 8/8/2019 Akshay Work

    15/37

    XMLForm: Garbage

    Joe Bloggs

    Examples:

    Joe Bloggs

    Joe R Bloggs

    Joe Richard Bloggs

    Joe Richie Bloggs

  • 8/8/2019 Akshay Work

    16/37

    XMLForm: Semantic Interpretation

    coke coke

    cola coke

    coca cola coke

    black fizzy stuff coke

    Defines contents of

    elements

  • 8/8/2019 Akshay Work

    17/37

    Exercise 2: Write a grammar for digits

    0 to 50

    (Hint: reuse rules #single_digits and #teens)

    XMLForm: Exercise

  • 8/8/2019 Akshay Work

    18/37

    zero

    twenty

    twenty

    thirty

    thirty

    fourty

    fourty

    fifty

    Exercise 2: Answer

    XMLForm: Exercise

  • 8/8/2019 Akshay Work

    19/37

    ABNF Form

    Equivalent to XML Form (semantically

    mappable)

    More compact notation

    Does not enjoy same benefits as XML

  • 8/8/2019 Akshay Work

    20/37

    ABNF Form: Basic Structure

    One or more rules

    #ABNF 1.0;

    language en-US;mode=voice;

    root $main;

    $main=yes please;

  • 8/8/2019 Akshay Work

    21/37

    ABNF Form: Basic Structure

    #ABNF 1.0;

    language en-US;mode=voice;

    root $main;

    $main=yes please;

    Root rule

  • 8/8/2019 Akshay Work

    22/37

    ABNF Form: Basic Structure

    #ABNF 1.0;

    language en-US;mode=voice;

    root $main;

    $main=yes please; Type of grammar

  • 8/8/2019 Akshay Work

    23/37

    ABNF Form: Basic Structure

    Language

    #ABNF 1.0;

    language en-US;mode=voice;

    root $main;

    $main=yes please;

  • 8/8/2019 Akshay Work

    24/37

    ABNF Form: Sequences and Alternatives

    Sequence

    #ABNF 1.0;

    language en-US;mode=voice;

    root $main;

    $main=yes please | no thanks;

  • 8/8/2019 Akshay Work

    25/37

    ABNF Form: Sequences and Alternatives

    Alternatives

    (note precedence!)

    #ABNF 1.0;

    language en-US;mode=voice;

    root $main;

    $main=yes please | no thanks;

  • 8/8/2019 Akshay Work

    26/37

    ABNF Form: Rule References

    Rule Reference

    #ABNF 1.0;

    language en-US;

    mode=voice;

    root $pizza;

    $pizza=I would like a $size pizza;

    $size=small | medium | large;

  • 8/8/2019 Akshay Work

    27/37

    ABNF Form: Repeats

    Repeat

    #ABNF 1.0;

    language en-US;

    mode=voice;

    root $thanks;

    $thanks=thank you very much;

  • 8/8/2019 Akshay Work

    28/37

    ABNF Form: Garbage

    #ABNF 1.0;

    language en-US;

    mode=voice;

    root $name;

    $name=Joe $GARBAGE Bloggs;

  • 8/8/2019 Akshay Work

    29/37

    ABNF Form: Semantic Interpretation

    #ABNF 1.0;

    language en-US;

    mode=voice;

    root $drink;

    $drink=coke {coke} | cola {coke} | coca cola {coke};

  • 8/8/2019 Akshay Work

    30/37

    ABNF Form: Exercise

    Exercise 3:

    Write a grammar to accept the following input:

    I would like to fly from ___ to ___ (please/thanks)

    where the following cities are allowed:

    paris, new york, dublin

    and please or thanks is an optional extra

  • 8/8/2019 Akshay Work

    31/37

    ABNF Form: Exercise

    #ABNF 1.0;

    language en-US;mode=voice;

    root $fly;

    $fly=I would like to fly from $city to $city $manners;

    $city=paris | new york | dublin;$manners=please | thanks;

    Exercise 3: Answer

  • 8/8/2019 Akshay Work

    32/37

    ABNF Form: Exercise

    #ABNF 1.0;

    language en-US;

    mode=voice;

    root $fly;

    $fly=I would like to fly from $city to $city [$manners];

    $city=paris | new york | dublin;$manners=please | thanks;

    Exercise 3: Answer

  • 8/8/2019 Akshay Work

    33/37

    SRGS with VoiceXML

    VoiceXML allows grammars to be inline(embedded) orreferenced

    The XML Form is required by VoiceXML;ABNF Form should be supported

    Referencing grammars encouragesreusability

  • 8/8/2019 Akshay Work

    34/37

    SRGS with VoiceXML: Inline

  • 8/8/2019 Akshay Work

    35/37

    SRGS with VoiceXML: Referenced

    Explicit rule reference

  • 8/8/2019 Akshay Work

    36/37

    SRGS with VoiceXML: Referenced

    Preferred type

  • 8/8/2019 Akshay Work

    37/37

    Covered the major principles of the XML

    Form and ABNF Form of SRGS

    For more information consult:

    http://www.w3.org/TR/speech-grammar/

    http://www.w3.org/TR/semantic-interpretation/

    http://www.w3.org/TR/voicexml20/

    Summary