1. Field of the Invention
The present invention is directed to a system which provides for simple creation of grammar files, which can be used for natural language parsing. More particularly, the system learns the grammar via a graphical user interface from examples of possible text strings and outputs a grammar file using a specific format for use with a particular automatic speech recognition engine.
2. Description of the Related Art
Teaching computers to understand a naturally spoken language is a difficult and evolving field. The natural language has to be entered into a computer, and then processed by the computer so its contents are understood by the computer (parsing).
Naturally spoken language can be entered into a computer by numerous methods, such as typing on a keyboard or by speaking words into a microphone. The spoken words are then analyzed by an Automatic Speech Recognition (ASR) engine and translated into their textual equivalent (speech to text). The spoken words can also be spoken by a user via a telephone to the processing computer. Such a system allows a computer to carry out tasks previously requiring a human being, such as conducting banking transactions.
In order to carry out speech to text processing, an ASR engine must be programmed to understand certain words. Defining the syntax for a set of sentences that are valid at each state in an ASR transaction is a difficult task for the most experienced linguist. Understanding the language structure and the words of the target language is required. Translating this into a standard formalism understood by a computer or software developer adds even more complexity to the task.
Once the spoken words are translated into text by a programmed ASR engine, the text still needs to be parsed. One method of parsing language is known as Syntactic Parsing, in which rules are entered describing the relationship of words in a particular language. See U.S. Pat. No. 5,960,384, xe2x80x9cMethod and Device for Parsing Natural Language Sentences and Other Sequential Symbolic Expressionsxe2x80x9d for a more complete discussion of parsing.
One approach for defining words that are meaningful and their relationships is called a Backus Normal Form (xe2x80x9cBNFxe2x80x9d) grammar. For example, the following are BNF grammar rules:
 less than object greater than =xe2x80x9cwindowxe2x80x9d|xe2x80x9cdoorxe2x80x9d;
 less than operation greater than =xe2x80x9copenxe2x80x9d|xe2x80x9cclosexe2x80x9d;
 less than command greater than = less than operation greater than the  less than object greater than 
This small set of BNF grammar rules contains three definitions, the  less than object greater than ,  less than operation greater than  and  less than command greater than . There are two possible objects (xe2x80x9cwindowxe2x80x9d and xe2x80x9cdoorxe2x80x9d), two possible operations (xe2x80x9copenxe2x80x9d and xe2x80x9cclosexe2x80x9d), and four possible commands (xe2x80x9copen the windowxe2x80x9d, xe2x80x9cclose the doorxe2x80x9d, xe2x80x9copen the doorxe2x80x9d, and xe2x80x9cclose the windowxe2x80x9d). Thus, when a computer receives the naturally spoken phrase of xe2x80x9copen the window,xe2x80x9d it will search the grammar rules until it finds the word xe2x80x9copenxe2x80x9d which it will interpret to be an  less than operation greater than . It will similarly process the word xe2x80x9cwindowxe2x80x9d which it would find to be an  less than object greater than . The phrase then becomes xe2x80x9c less than operation greater than  the  less than object greater than xe2x80x9d which the computer will find in the grammar rules to be a  less than command greater than . Therefore, the input string of xe2x80x9copen the window,xe2x80x9d based on the BNF grammar entered, will be interpreted by a computer to be a  less than command greater than , wherein the  less than operation greater than =xe2x80x9copenxe2x80x9d and the  less than object greater than =xe2x80x9cwindow.xe2x80x9d Once this information is obtained, it would typically then be passed to another routine or computer for further processing. For example, a voice activated robot using the grammar rules listed above would first parse the spoken phrase xe2x80x9copen the window,xe2x80x9d then pass the command to another module of the robot so the command can actually be carried out.
The above example is very simple, however in order to define a BNF grammar which has practical applications, all variations of a natural language command should be considered. For example, using the above grammar rules, the phrase xe2x80x9cshut the doorxe2x80x9d would not be recognized because of the undefined word xe2x80x9cshut.xe2x80x9d For a set of grammar rules to be implemented as part of a practical application, tens of thousands of rules may need to be defined, an arduous task.
There are many proprietary types of ASRs which use BNF grammar, however there is no standard format for inputting a BNF grammar into an ASR. If one generic set of BNF grammar is to be used with numerous ASR engines, then each grammar set will have to be specifically translated to run on that engine. With a large set of grammar rules, such translation would be very time consuming.
Previously, the only way to create a set of grammar rules for a specific ASR engine is to use the proprietary tools provided by the specific vendor of the ASR engine. There are no industry standards. These tools are not extendable across multiple vendors. Conversion from BNF to a vendor specific syntax is a one-to-one mapping that is generated by a Context Free Grammar (CFG) conversion. The conversion is done prior to run-time, and is specific to the technology implemented on the target platform.
In addition, creating a large set of rules can be a very difficult and time consuming process. Grammar rules are typically entered by entering one definition at a time using a text interface.
What is needed is a system which allows for an easy and intuitive way to create grammar rules. What is also needed is a way to generate grammar rules specific for any ASR engine, without the user having knowledge of specific ASR engine syntax.
Various embodiments of the invention include a method and apparatus creating a set of grammar rules using a graphical user interface; creating a set of grammar rules by analyzing examples provided by the user; creating grammar rules for a variety of ASR engines without the operator having personal knowledge of each particular ASR format; reading proprietary ASR engine files and allowing a user to modify them using the methods described herein; and accepting queries from a user and using the ASR files generated by the methods or apparatus described herein to process the query.