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

More Related Content

Similar to The NuGram approach to dynamic grammars

ESWC2008 Identity OpenLink - On The Evolution of Terms
ESWC2008 Identity OpenLink - On The Evolution of TermsESWC2008 Identity OpenLink - On The Evolution of Terms
ESWC2008 Identity OpenLink - On The Evolution of Terms
rumito
 
Let's Peel Mangos
Let's Peel MangosLet's Peel Mangos
Let's Peel Mangos
Sam Basu
 

Similar to The NuGram approach to dynamic grammars (20)

Rest overview briefing
Rest  overview briefingRest  overview briefing
Rest overview briefing
 
Mobile Development integration tests
Mobile Development integration testsMobile Development integration tests
Mobile Development integration tests
 
JAX-RS.next
JAX-RS.nextJAX-RS.next
JAX-RS.next
 
Sun Web Server Brief
Sun Web Server BriefSun Web Server Brief
Sun Web Server Brief
 
Desktop, Embedded and Mobile Apps with PrismTech Vortex Cafe
Desktop, Embedded and Mobile Apps with PrismTech Vortex CafeDesktop, Embedded and Mobile Apps with PrismTech Vortex Cafe
Desktop, Embedded and Mobile Apps with PrismTech Vortex Cafe
 
Desktop, Embedded and Mobile Apps with Vortex Café
Desktop, Embedded and Mobile Apps with Vortex CaféDesktop, Embedded and Mobile Apps with Vortex Café
Desktop, Embedded and Mobile Apps with Vortex Café
 
sMash at May NYPHP UG
sMash at May NYPHP UGsMash at May NYPHP UG
sMash at May NYPHP UG
 
Software testing tools
Software testing toolsSoftware testing tools
Software testing tools
 
Erlang at Nu Echo
Erlang at Nu EchoErlang at Nu Echo
Erlang at Nu Echo
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007
 
Designing a Language and System for REST-oriented service composition,as a se...
Designing a Language and System for REST-oriented service composition,as a se...Designing a Language and System for REST-oriented service composition,as a se...
Designing a Language and System for REST-oriented service composition,as a se...
 
Sun Web Server Brief
Sun Web Server BriefSun Web Server Brief
Sun Web Server Brief
 
The NuGram dynamic grammar language
The NuGram dynamic grammar languageThe NuGram dynamic grammar language
The NuGram dynamic grammar language
 
ESWC2008 Identity OpenLink - On The Evolution of Terms
ESWC2008 Identity OpenLink - On The Evolution of TermsESWC2008 Identity OpenLink - On The Evolution of Terms
ESWC2008 Identity OpenLink - On The Evolution of Terms
 
Ramji
RamjiRamji
Ramji
 
Let's Peel Mangos
Let's Peel MangosLet's Peel Mangos
Let's Peel Mangos
 
Resume
ResumeResume
Resume
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices
 
Testing Mozilla Web Properties
Testing Mozilla Web PropertiesTesting Mozilla Web Properties
Testing Mozilla Web Properties
 
OTN Tour 2013: What's new in java EE 7
OTN Tour 2013: What's new in java EE 7OTN Tour 2013: What's new in java EE 7
OTN Tour 2013: What's new in java EE 7
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

The NuGram approach to dynamic grammars

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