US 20050149888 A1
A method and apparatus are provided for optimizing finite state machines with labeled nodes. Under the method, labels from the nodes are shifted onto the labels of the links connected to the nodes. The finite state machine is then optimized. After optimization, the labels on the links are examined to verify that the prefixes of the labels on each outgoing link match the suffixes of the labels on each incoming link to a particular node. After this verification, a portion of a label on a link is removed from the link and inserted onto the node.
18. A computer-readable medium having computer-executable instructions for performing steps comprising:
defining a finite state machine that has a structure that includes nodes connected by links, wherein the nodes and the links are labeled;
adding a label from a node to respective labels of each link connected to the node, wherein adding a label from a node to a label for a link comprises inserting a separator between the label from the node and the label for the link;
removing a labels from a node that was added to a label for a link;
changing the structure of the finite state machine; and
inserting a labels on a node.
20. The computer-readable medium of
21. The computer-readable medium of
23. The computer-readable medium of
24. The computer-readable medium of
25. The computer-readable medium of
26. The computer-readable medium of
This application is a divisional of and claims priority from U.S. patent application Ser. No. 10/620,996, filed Jul. 16, 2003 and titled METHOD AND APPARATUS FOR MINIMIZING WEIGHTED NETWORKS WITH LINK AND NODE LABELS.
The present invention relates to finite state machines. In particular, the present invention relates to optimizing finite state machines.
Finite state machines are a general way of efficiently representing sets of strings, probability distributions on strings, mappings between strings, and joint and conditional distributions on pairs of strings. They are used in speech recognition for representing grammars, language models, dictionaries, search networks, and the search space during decoding. In natural language processing, they are used for parsing, morphological analysis, and tokenization.
Traditionally, finite state machines are directed networks composed of a set of nodes and a set of directed links between those nodes. One of the nodes is identified as an initial node and at least one, but possibly many other nodes are designated as valid final nodes. A valid pass through the finite state machine starts at the initial node, follows links through the network, and ends at a final valid node. Before reaching the final node, the path may pass through other final nodes. While it is legal to stop at a final node, a valid path does not have to stop simply because it reaches a final node.
Each link is labeled with symbols from an alphabet. For example, the links may be labeled with letters, phonemes, triphones, words, or some other abstract symbol. Thus, the finite state machine represents a set of strings, each of which is generated by some legal path through the finite state machine.
To determine if a given string is in the set of strings represented by the finite state machine, one starts at the initial node and follows all the links with labels that agree with the next symbol in the string, keeping track of the set of nodes that are passed through. This process continues until there is either no link from the current node that matches the next symbol, in which case the string does not parse, or until the string ends. If the string ends and the set of current nodes contain a final state, the string is represented by the finite state machine, and if not, the string is not represented by the finite state machine.
In some finite state machines, a cost or probability is placed on each link in addition to the label. Costs or probabilities are combined during the traversal of the path through the finite state machine to give the cost or probability of generating a string.
Finite state machines can either be finite state acceptors or finite state transducers. Finite state acceptors have input symbols on each link while finite state transducers have input and output symbols on each link. For example, a final link for a string that represents a word in a finite state transducer can have an input symbol for the last phoneme in the word and an output symbol representing the complete word.
One of the advantages of finite state machines is that they can be optimized to remove redundancies and thereby reduce the time and space required to use the finite state machines. One optimization process is known as determinization. Under determinization, an equivalent finite state machine is created such that there is at most one link with a given label leaving each node. This means that during parsing, there is only one current state at a time instead of a set of current states. Another optimization technique is known as minimization in which the finite state machine is reduced to produce the smallest number of states possible. The goal in minimization is to create a finite state machine with the fewest possible nodes and links for the set of strings represented by the finite state machine.
Classical optimization routines only consider labels on links. As such, it has not been possible to use classical routines to optimize finite state machines that include labels on nodes. This has meant that such finite state machines are either not optimized or that some special optimization routine must be written that tracks the node labels as well as the link labels. Thus, a system is needed that allows link-based optimization routines to be used with finite state machines that include node labels.
A method and apparatus are provided for optimizing finite state machines with labeled nodes. Under the method, labels from the nodes are shifted onto the labels of the links connected to the nodes. The finite state machine is then optimized. After optimization, the labels on the links are examined to verify that the prefixes of the labels on each outgoing link match the suffixes of the labels on each incoming link to a particular node. After this verification, a portion of a label on a link is removed from the link and inserted into the node.
The invention is operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well-known computing systems, environments, and/or configurations that may be suitable for use with the invention include, but are not limited to, personal computers, server computers, hand-held or laptop devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, telephony systems, distributed computing environments that include any of the above systems or devices, and the like.
The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The invention is designed to be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules are located in both local and remote computer storage media including memory storage devices.
With reference to
Computer 110 typically includes a variety of computer readable media. Computer readable media can be any available media that can be accessed by computer 110 and includes both volatile and nonvolatile media, removable and non-removable media. By way of example, and not limitation, computer readable media may comprise computer storage media and communication media. Computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by computer 110. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. The term modulated data signal means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, RF, infrared and other wireless media. Combinations of any of the above should also be included within the scope of computer readable media.
The system memory 130 includes computer storage media in the form of volatile and/or nonvolatile memory such as read only memory (ROM) 131 and random access memory (RAM) 132. A basic input/output system 133 (BIOS), containing the basic routines that help to transfer information between elements within computer 110, such as during start-up, is typically stored in ROM 131. RAM 132 typically contains data and/or program modules that are immediately accessible to and/or presently being operated on by processing unit 120. By way of example, and not limitation,
The computer 110 may also include other removable/non-removable volatile/nonvolatile computer storage media. By way of example only,
The drives and their associated computer storage media discussed above and illustrated in
A user may enter commands and information into the computer 110 through input devices such as a keyboard 162, a microphone 163, and a pointing device 161, such as a mouse, trackball or touch pad. Other input devices (not shown) may include a joystick, game pad, satellite dish, scanner, or the like. These and other input devices are often connected to the processing unit 120 through a user input interface 160 that is coupled to the system bus, but may be connected by other interface and bus structures, such as a parallel port, game port or a universal serial bus (USB). A monitor 191 or other type of display device is also connected to the system bus 121 via an interface, such as a video interface 190. In addition to the monitor, computers may also include other peripheral output devices such as speakers 197 and printer 196, which may be connected through an output peripheral interface 195.
The computer 110 is operated in a networked environment using logical connections to one or more remote computers, such as a remote computer 180. The remote computer 180 may be a personal computer, a hand-held device, a server, a router, a network PC, a peer device or other common network node, and typically includes many or all of the elements described above relative to the computer 110. The logical connections depicted in
When used in a LAN networking environment, the computer 110 is connected to the LAN 171 through a network interface or adapter 170. When used in a WAN networking environment, the computer 110 typically includes a modem 172 or other means for establishing communications over the WAN 173, such as the Internet. The modem 172, which may be internal or external, may be connected to the system bus 121 via the user input interface 160, or other appropriate mechanism. In a networked environment, program modules depicted relative to the computer 110, or portions thereof, may be stored in the remote memory storage device. By way of example, and not limitation,
The present invention provides a means for optimizing finite state machines with labeled nodes such as finite state machine 200 of
Links that lead into a node are referred to as incoming links and links that leave a node are referred to as outgoing links. For example, for node 214 there is incoming link 230 and outgoing links 238.
Nodes 214 and 224 share a label 1.1 and nodes 208, 210, 212, 216, 218, 220, 222, 226, and 228 share a label of <null>. In some embodiments, such labels represent boundary times between speech units.
The method of
At step 300, a node in the finite state machine is selected. At step 302, the node label from the selected node and a comma separator are appended to the end of each label of each incoming link to the node. For example, for node 214, the label 1.1 and a comma separator are appended to each incoming link label such as the label for link 230 to form modified link label n:ALLEN, 1.1.
At step 304, the node label for the selected node is appended to the beginning of each link label for each outgoing link from the node. For example, for node 214, a node label 1.1 and a comma separator are appended to the link label for link 238 to form label 1.1, w:<null>.
At step 306, the label for the selected node is deleted from the node. After the label has been deleted from the selected node, the method determines if there are more nodes in the finite state machine at step 308. If there are more nodes, the next node is selected at step 300 and steps 302, 304 and 306 are repeated.
When there are no more nodes at step 308, the finite state machine of
After all the node labels have been shifted to the link labels at step 308, the finite state machine of
The result of determinization during the optimization of step 310 is finite state machine 500 of
State machine 500 is further optimized during optimization step 310 by minimizing the state machine. The results of such minimization are shown in
At step 312, the optimization is verified by verifying that the suffixes of all incoming links to a node and the prefixes of all outgoing links of a node match. For example, in
The results of steps 314 and 316 are shown in
By appending the node labels to the link labels before optimization, the present invention preserves the position of the node labels relative to the link labels while allowing the finite state machine to be minimized and determinized.
Although the present invention has been described with reference to particular embodiments, workers skilled in the art will recognize that changes may be made in form and detail without departing from the spirit and scope of the invention. In particular, although the present invention has been discussed with reference to finite state machines used in language processing, the techniques of the present invention may be used with finite state machines that are designed for other purposes. In addition, although finite state transducers have been discussed above, those skilled in the art will recognize that the invention can be used with finite state acceptors, which do not generate an output string from the input string. Further, such finite state acceptors can include probabilities on the links thus forming weighted finite state acceptors.