Open and Extendable Speech Recognition Application Architecture for Mobile Environments

Open and Extendable Speech Recognition Application Architecture for Mobile Environments

OPEN AND EXTENDABLE SPEECH RECOGNITION APPLICATION ARCHITECTURE FOR MOBILE ENVIRONMENTS Tanel Alumäe∗ Kaarel Kaljurand Institute of Cybernetics Institute of Computational Linguistics Tallinn University of Technology, Estonia University of Zurich, Switzerland ABSTRACT Estonian is the official language of Estonia, spoken by This paper describes a cloud-based speech recognition archi- about one million people. It is a Uralic language and is closely tecture primarily intended for mobile environments. The sys- related to Finnish. The need for support for language technol- tem consists of a speech recognition server and a client for ogy has been recognized by the Estonian government and the the Android mobile operating system. The system enables to field is now actively supported [2]. In recent years, several implement Android’s Voice Input functionality for languages speech recognition system prototypes for Estonian have been that are not supported by the default Google implementation. developed [3, 4]. However, the support for Estonian in com- The architecture supports both large vocabulary speech recog- mercial products, especially concerning spoken language, is nition as well as grammar-based recognition, where gram- still lacking. mars can be implemented in JSGF or Grammatical Frame- This paper describes a cloud-based ASR system mainly work. The system is open source and easily extendable. We intended for mobile environments. We give an overview of used the architecture to implement Estonian speech recogni- the server’s features, the client applications for Android and tion for Android. describe public deployment of the system for the Estonian language. The developed software is open source, easily ex- Index Terms— Speech recognition, CMU Sphinx, mo- tendable and adaptable for other languages. bile devices, Android, open source, Estonian, Grammatical Framework 2. DESIGN AND IMPLEMENTATION 1. INTRODUCTION 2.1. Requirements Entering text on a small mobile device is often sluggish and As many aspects of our system were modeled after Google error-prone, compared to text input via full-sized keyboard. Voice Search, our goal was to provide a similar user experi- This fact has been noticed by mobile software manufactur- ence for Estonian as Google Voice Search offers for its sup- ers and today many phone operating systems offer text input ported languages. Thus, the main design goals for the usabil- by means of automatic speech recognition (ASR). For exam- ity of our system were: ple, on the Android platform, Google Voice Search (applica- • ASR accuracy: although the system is a research pro- tion that lets user search the web using a spoken query) [1] is totype, we still have to provide acceptable word error supported in 29 languages and accents (at the end of January rate for people to use it. 2012). Although the breath and width of Google’s language tech- • Low latency, where latency is defined as the time from nology support is remarkable, there are many reasons not to when the user finishes speaking until the result appears rely only on the official vendor for having ASR on mobile de- on the screen. vices. First, there are still numerous languages with a large In addition to usability, we had a number of aspects in number of speakers for which platform-native ASR probably mind when designing the architecture of the system: won’t be supported anytime in the future. Second, there are reasons one might want to replace the built-in ASR service • Scalability: it must be easy to scale the system to a large with a custom implementation also for already supported lan- number of concurrent users. guages: an alternative service might provide better control over privacy, it may support more features and it may be use- • Language independence: it must be possible to port the ful for scientific reasons. system to other languages with minimal effort. ∗This work was partly funded by the Estonian Ministry of Education and • Extendability and flexibility: the system must support Research target-financed research theme no. 0140007s12. both free-form large vocabulary continuous speech recognition (LVCSR) as well as grammar-based speech to a single abstract syntax, and the respective languages can recognition with limited vocabulary. Furthermore, it be thus automatically translated from one to the other. should be easy to add new features to the system, e.g., GF is optimized to handle natural language features like support for different kinds of grammars, support for morphological variation, agreement, long-distance depen- adaptation based on different aspects of the query, dencies, etc. As a grammar formalism GF covers context support for various audio encodings, etc. free languages and even goes beyond. GF grammars can • Free and open source: we wanted the system to be com- be implemented in a modular fashion and tested e.g. by pletely free, so that it could be modified and deployed random or exhaustive generation of abstract trees and their with minimal cost. linearizations. GF comes with various tools that cover gram- mar authoring, compatibility with most popular programming languages, conversion into other grammar formats (including 2.2. Implementation several speech recognition formats), and a reusable grammar As with most ASR systems for mobile devices, our system library for ∼20 world (natural) languages. is also based on cloud technology: speech is recorded on the device and sent over mobile data connection to a server which 2.4. Web service API delivers the recognition result. While this approach has some Communication with the recognition server is loosely based disadvantages (such as requirement for a data connection, pri- on the (undocumented) Google Speech API used by the vacy issues), it also has a number of advantages, which have Chrome browser to implement the W3C Speech Input API. been discussed in detail in previous papers [1]. To invoke a recognition request, client makes a HTTP Our ASR server is based on various open-source tech- POST request to the web service URL, with speech data in the nologies. The core of the system is the Pocketsphinx decoder request body. Currently, the server supports raw, wav, ogg, of the CMU Sphinx speech recognition toolkit 1 . We selected MPEG and FLAC audio encodings. Server responds with a this decoder as opposed to many other freely available recog- JSON object that contains the results. Multiple N-best hy- nition engines because we have found it to be accurate, fast potheses are optionally returned, as shown below. and have a relatively small memory footprint. The decoder is integrated with other parts of our server via its GStreamer in- { 2 terface. We also use the GStreamer framework for decoding "status": 0, and resampling audio from various formats. The main request "hypotheses": [ handling and management code is written in the Ruby pro- {"utterance": "see on esimene lause"}, gramming language and uses the Sinatra web framework 3 . {"utterance": "see on esimene lause on"}, The ASR server has a modular architecture, with different {"utterance": "see on esimene lausa"}, modules responsible for trigram and grammar-based recogni- ], tion. Clients specify the language model when making the "id": "61c78c7271026153b83f39a514dc0c41" } recognition request. Clients can also upload new grammars in JSGF and Grammatical Framework formats. Source code By default, an n-gram language model configured in the of the server is available with the BSD-license 4 . server is used to recognize speech. To use grammar-based recognition, the grammar file has to be first uploaded to the 2.3. Support for Grammatical Framework grammars web service. Then, client can specify the grammar identifier in the recognition query to request recognition based on the Most common grammar formats used in speech recogni- grammar. tion (JSGF, SRGS, GSL, grXML) are based on (augmented) As explained earlier, GF grammars can contain concrete Backus-Naur Form. Grammatical Framework (GF) [5], on grammars in several languages. When making a recognition the other hand, is a functional programming language for query using a GF grammar, clients can specify the input and grammar engineering. The grammar author implements an output language of the GF grammar: input language grammar abstract syntax and its corresponding concrete syntax and by is used for recognition, and the recognized utterance is auto- doing that describes a mapping between language strings and matically translated to the output language(s). The example their corresponding abstract syntax trees. This mapping is below using a toy robot grammar demonstrates this: the ut- bidirectional — strings can be parsed to trees, and trees lin- terance ‘mine neli meetrit edasi’ (‘go four meters forward’) is earized to strings. This architecture supports multilinguality translated to English and to an “application” language (pre- as there can exist multiple concrete syntaxes corresponding sumably used by the robot), the result is given in the field linearizations: 1[http://cmusphinx.org] 2[http://gstreamer.freedesktop.org] { 3[http://www.sinatrarb.com] "status": 0, 4[http://github.com/alumae/ruby-pocketsphinx-server] "hypotheses": [ { ditional random field model. The LM vocabulary consists "utterance": "mine neli meetrit edasi", of most likely 200K units. Due to the limitation of Pocket- "linearizations": [ sphinx, trigram LM was used. Estonian is an almost phonetic { "lang": "App", language which lets us use a simple hand-built transducer for "output": "4 m >" } building a pronunciation dictionary,

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    4 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us