Grammar generation from graphical models Kim Sullivan () Lukáš Záruba ()

Download Report

Transcript Grammar generation from graphical models Kim Sullivan () Lukáš Záruba ()

IBM - CVUT Student Research Projects
Grammar generation from
graphical models
Kim Sullivan ([email protected])
Lukáš Záruba ([email protected])
The Idea
• Generating grammars for speech
recognition manually is tedious and error
prone
• Changes in application capabilities require
manual rewrite of the grammar
• Solution: Model Driven Development generate the grammar automatically from a
graphical model
IBM - CVUT Student Research Projects
2
Solution Design
1) Enhance a graphical model with textual
annotations in a visual editor
2) Transform annotations into grammar rules
3) Transform left recursive rules into right
recursive rules (suitable for speech
recognition)
4) Generate grammar file
IBM - CVUT Student Research Projects
3
Implementation
• Use the existing Eclipse Modeling
Framework ECore model technology
• Leverage the existing visual ECore editor
from the Eclipse Graphical Modeling
Framework (GMF)
• Use Java Emmiter Templates (JET2) and
custom classes to generate the grammar
IBM - CVUT Student Research Projects
4
The Graphical Model
IBM - CVUT Student Research Projects
5
Generated Grammar
(example of Song class)
<Song> =
(<Author> 's <Song> <Song_>) |
(all songs <Song_>) |
(<~Song_name> <Song_>) |
(<~Song_genre> <Song> <Song_>) |
([a | the] song <Song_>);
<Song_> =
(([recorded] by | from) <Author> <Song_>) |
(on <Album> <Song_>) |
((with the name | called | where the name is)
<~Song_name> <Song_>) |
(recorded in [the year] <~Song_year> <Song_>) |
(in the genre <~Song_genre> <Song_>) |
(<NULL>);
IBM - CVUT Student Research Projects
6