The NuGram approach to dynamic grammars<br />
Introduction<br />What is a dynamic grammar?<br />A grammar whose content is not known in advance<br />Content comes from ...
Introduction<br />Why dynamic grammars?<br />Grammar content is only known at run-time<br />To constrain grammars in order...
Use Cases<br />On-the-fly generation<br />Content comes from call-specific data<br />Examples<br />Identity validation<br ...
Use Cases<br />Offline generation (triggered)‏<br />Results from an external event<br />Examples:<br />Auto-attendant<br /...
Use Cases<br />Offline generation (scheduled)‏<br />Grammar generation is part of a scheduled maintenance process<br />Exa...
Use Cases<br />Offline generation (build time)‏<br />For grammars based on company-specific data<br />Usually requires sch...
The NuGram Approach<br />Seamless evolution<br />Copyright © 2010 Nu Echo Inc.<br />
The Generation Process<br />ABNF<br />Grammar<br />Template<br />Grammar<br />GSL<br />Instantiation<br />context<br />GrX...
Start with an ABNF grammar<br />#ABNF 1.0 ISO-8859-1;<br />languageen-US;<br />root$name;<br />public$name= <br />  [$pre_...
Add dynamic directives<br />#ABNF 1.0 ISO-8859-1;<br />language@string callerLanguage;<br />root$name;<br />public$name= <...
Complex objects and control-flow<br />$employeeName = <br />@alt<br />@for(entry : entries)‏<br />@if(entry.isDepartment)‏...
NuGram Server<br />Runtime infrastructure to deploy dynamic grammars<br />Java Servlettechnology<br />Can run in parallel/...
NuGram Server<br />JSP-like API<br />Instantiation + Generation at once<br />Java code creates the instantiation context<b...
NuGram Server<br />Java Context Initializers for full control<br />publicclassCanadianAddressContextInitializerimplementsC...
NuGram Server<br />JSP-like API – Tight integration with Java <br />#ABNF 1.0 UTF-8;languagefr-CA;mode voice;root$address;...
NuGram Server<br />REST API<br />HTTP-based<br />Contexts sent to server as JSON objects<br />Instantiation decoupled from...
Benefits<br />No distinction between dynamic grammars and static grammars<br />Supported by a complete development environ...
Try it, it’s free!<br />NuGram Hosted Server (REST API only): http://www.grammarserver.com<br />Ideal for cloud-based tele...
Upcoming SlideShare
Loading in...5
×

The NuGram approach to dynamic grammars

1,471

Published on

This presentation gives an overview of the NuGram support for dynamic grammars.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,471
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "The NuGram approach to dynamic grammars"

  1. 1. The NuGram approach to dynamic grammars<br />
  2. 2. Introduction<br />What is a dynamic grammar?<br />A grammar whose content is not known in advance<br />Content comes from an external source<br />Database<br />Excel sheet<br />Web service<br />Data collected during the call<br />Etc.<br />Copyright © 2010 Nu Echo Inc.<br />
  3. 3. Introduction<br />Why dynamic grammars?<br />Grammar content is only known at run-time<br />To constrain grammars in order to improve recognition accuracy<br />To solve maintenance problems<br />More details on our blog:<br />http://blog.nuecho.com/2008/10/06/use-cases-for-dynamic-grammars/<br />http://blog.nuecho.com/2008/10/09/use-cases-for-dynamic-grammars-part-2/<br />Copyright © 2010 Nu Echo Inc.<br />
  4. 4. Use Cases<br />On-the-fly generation<br />Content comes from call-specific data<br />Examples<br />Identity validation<br />Address capture<br />Voice dialing<br />Personalized bill payee list<br />Personalized menu options<br />One-step correction<br />Copyright © 2010 Nu Echo Inc.<br />
  5. 5. Use Cases<br />Offline generation (triggered)‏<br />Results from an external event<br />Examples:<br />Auto-attendant<br />Movie listings<br />Copyright © 2010 Nu Echo Inc.<br />
  6. 6. Use Cases<br />Offline generation (scheduled)‏<br />Grammar generation is part of a scheduled maintenance process<br />Examples<br />Phone numbers (area code may be added)‏<br />Postal/Zip codes<br />Stock quotes, mutual funds<br />Bill payee list management<br />Copyright © 2010 Nu Echo Inc.<br />
  7. 7. Use Cases<br />Offline generation (build time)‏<br />For grammars based on company-specific data<br />Usually requires scheduled maintenance process<br />Examples<br />Branch names and addresses<br />Stock quotes, mutual funds<br />Bill payee list management<br />Copyright © 2010 Nu Echo Inc.<br />
  8. 8. The NuGram Approach<br />Seamless evolution<br />Copyright © 2010 Nu Echo Inc.<br />
  9. 9. The Generation Process<br />ABNF<br />Grammar<br />Template<br />Grammar<br />GSL<br />Instantiation<br />context<br />GrXML<br />Copyright © 2010 Nu Echo Inc.<br />
  10. 10. Start with an ABNF grammar<br />#ABNF 1.0 ISO-8859-1;<br />languageen-US;<br />root$name;<br />public$name= <br /> [$pre_filler] $employeeName[$post_filler];<br />$employeeName= <br />[dominique] boucher;<br />Copyright © 2010 Nu Echo Inc.<br />
  11. 11. Add dynamic directives<br />#ABNF 1.0 ISO-8859-1;<br />language@string callerLanguage;<br />root$name;<br />public$name= <br /> [$pre_filler] $employeeName[$post_filler];<br />$employeeName = <br /> [@word employee.firstname] @word employee.lastname;<br />Copyright © 2010 Nu Echo Inc.<br />
  12. 12. Complex objects and control-flow<br />$employeeName = <br />@alt<br />@for(entry : entries)‏<br />@if(entry.isDepartment)‏<br />@word entry.name<br />@else<br /> ([@word entry.firstname]<br />@word entry.lastname<br />@end<br />@end<br />@end<br />;<br />Copyright © 2010 Nu Echo Inc.<br />
  13. 13. NuGram Server<br />Runtime infrastructure to deploy dynamic grammars<br />Java Servlettechnology<br />Can run in parallel/be packaged with your application<br />Outputs grammars in ABNF, GrXML, GSL<br />Fine-grained control of caching strategy<br />Using configuration or Java API<br />Two sets of APIs<br />JSP-like API <br />REST API<br />Copyright © 2010 Nu Echo Inc.<br />
  14. 14. NuGram Server<br />JSP-like API<br />Instantiation + Generation at once<br />Java code creates the instantiation context<br />Can access databases, webservices<br />Can access application data<br />Can access parameters passed on the request URL<br />Build the URL, let the ASR fetch the generated grammar<br />http://localhost:8800/nugram-servlet/grammars/address.grxml?code=h3b1a7<br />Output Format<br />HTTP Parameters<br />Copyright © 2010 Nu Echo Inc.<br />
  15. 15. NuGram Server<br />Java Context Initializers for full control<br />publicclassCanadianAddressContextInitializerimplementsContextInitializer{public Map getContext(Map httpParameters,GrammarFragmentFactory factory,CacheControl control) {Map context = new HashMap();// 1. Extract the HTTP parameterString[] postalCode = httpParameters.get(“code”); // 2. Look in the postal code databasePostalCodeRecord[] records = findRecords(postalCode);// 3. Populate the instantiation contextcontext.add(“records”, records);context.add(“helper”, new AddressHelper(factory));return context; }<br />Copyright © 2010 Nu Echo Inc.<br />
  16. 16. NuGram Server<br />JSP-like API – Tight integration with Java <br />#ABNF 1.0 UTF-8;languagefr-CA;mode voice;root$address;public$address = @alt@for (record : records)@fragmenthelper.civicNumber(record)@wordrecord.streetName [@wordrecord.streetType]@end@end;<br />Methods can be called on Java objects and produce grammar fragments (using a provided API)<br />Supports bean properties - the real method is “getStreetName()”<br />Copyright © 2010 Nu Echo Inc.<br />
  17. 17. NuGram Server<br />REST API<br />HTTP-based<br />Contexts sent to server as JSON objects<br />Instantiation decoupled from generation for more effective use of resources<br /> Application POSTs request to instantiate the grammar<br />NuGram Server replies with an URL<br /> Application passes the URL to the ASR<br /> ASR fetches grammar using the given URL<br />Copyright © 2010 Nu Echo Inc.<br />
  18. 18. Benefits<br />No distinction between dynamic grammars and static grammars<br />Supported by a complete development environment – NuGram IDE<br />Editor, debugging tools, coverage tool, sentence generation tool, etc. – they all work with dynamic grammars<br />Easy to use, easy to deploy<br />Pure Java servlet technology<br />A proven technology<br />Deployed in many large IVR applications<br />Copyright © 2010 Nu Echo Inc.<br />
  19. 19. Try it, it’s free!<br />NuGram Hosted Server (REST API only): http://www.grammarserver.com<br />Ideal for cloud-based telephony applications(Tropo, Voxeo Evolution, Teleku, etc.)<br />A bunch of client APIs: http://github.com/nuecho/nugramserver-clients<br />And of course the IDE: http://nugram.nuecho.com/<br />

×