A pronunciation prediction method and electronic device
By using pre-acquired networks and optimized pronunciation dictionaries in electronic devices to predict the Chinese pronunciation of foreign words, it solves the problem of limited capacity of manual annotation dictionaries, improves the recognition and wake-up support of foreign words, and achieves more efficient prediction efficiency. .
Patent Information
- Application Number
- CN201910942223.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-30
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2039-09-30
AI Technical Summary
The pronunciation dictionary obtained through manual annotation in the existing technology has limited capacity and cannot effectively obtain the Chinese pronunciation of foreign words that do not appear in the dictionary, resulting in insufficient foreign word recognition and wake-up support.
The pre-acquisition network is used to predict through the pronunciation dictionary to obtain the pronunciation of the word to be tested, and the fence network and Gaussian mixture model are used to optimize the pronunciation score value, expand the number of predictable words, reduce labor costs and improve prediction efficiency.
It improves the prediction ability of Chinese pronunciation of foreign words, expands the number of predictable words, reduces manual annotation costs, improves prediction efficiency, and can effectively support speech recognition and awakening in more scenarios.
Smart Images

Figure CN112579734B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a pronunciation prediction method and electronic equipment. Background Art
[0002] In scenarios such as speech recognition and wake-up, it is necessary to support mixed Chinese and foreign languages, such as foreign trademarks, names, proper nouns, etc. Since the pronunciation units of Chinese and foreign languages are different, different modeling units are usually required for modeling. By taking advantage of the similarity between Chinese and foreign pronunciations, the Chinese pronunciation of foreign words can be added to the pure Chinese model, so that the pure Chinese model can support foreign language recognition and wake-up.
[0003] Currently, foreign words and their Chinese pronunciations are obtained by manually annotating the pronunciation dictionary. However, the capacity of the pronunciation dictionary obtained by manual annotation is limited, and for foreign words that do not appear in the pronunciation dictionary, the Chinese pronunciation of the foreign words cannot be obtained through the pronunciation dictionary. Summary of the invention
[0004] The embodiments of the present invention provide a pronunciation prediction method and electronic device to solve the problem that the capacity of the pronunciation dictionary obtained by manual annotation is limited and the number of foreign words corresponding to Chinese pronunciation is small.
[0005] To solve the above technical problems, the present invention is achieved as follows:
[0006] In a first aspect, an embodiment of the present invention provides a pronunciation prediction method, which is applied to an electronic device, comprising:
[0007] Get the word to be tested;
[0008] Predicting the word to be tested by using the pre-acquired first network to obtain the pronunciation of the word to be tested;
[0009] The first network is determined according to a pronunciation dictionary, wherein the pronunciation dictionary includes words and pronunciations corresponding to the words.
[0010] In a second aspect, an embodiment of the present invention further provides an electronic device, including:
[0011] An acquisition module is used to acquire the words to be tested;
[0012] A prediction module, used to predict the word to be tested through a pre-acquired first network to obtain the pronunciation of the word to be tested;
[0013] The first network is determined according to a pronunciation dictionary, wherein the pronunciation dictionary includes words and pronunciations corresponding to the words.
[0014] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the above-mentioned pronunciation prediction method when executed by the processor.
[0015] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned pronunciation prediction method are implemented.
[0016] In an embodiment of the present invention, a word to be tested is obtained; the word to be tested is predicted by a pre-acquired first network to obtain the pronunciation of the word to be tested; wherein the first network is determined according to a pronunciation dictionary, and the pronunciation dictionary includes words and pronunciations corresponding to the words. In this way, since the number of words composed of characters determined according to the pronunciation dictionary is greater than the number of words manually annotated, the words that can be predicted by the first network are not limited to the words manually annotated, which increases the number of words with predictable pronunciation, reduces labor costs, and improves prediction efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is one of the flow charts of the pronunciation prediction method provided by the embodiment of the present invention;
[0018] Figure 2 This is the second flowchart of the pronunciation prediction method provided by the embodiment of the present invention;
[0019] Figure 3 It is one of the structural diagrams of the electronic device provided by the embodiment of the present invention;
[0020] Figure 4 This is the second structural diagram of the electronic device provided by the embodiment of the present invention;
[0021] Figure 5 It is a structural diagram of an electronic device provided by another embodiment of the present invention. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] See also Figure 1 , Figure 1 is one of the flow charts of the pronunciation prediction method provided by the embodiment of the present invention, such as Figure 1As shown, this embodiment provides a pronunciation prediction method, which is applied to an electronic device and includes the following steps:
[0024] Step 101: Obtain a word to be tested.
[0025] The word to be tested may be a word composed of multiple characters, for example, an English word, a German word, a Russian word, etc. The pronunciation of each character in the word constitutes the pronunciation of the word.
[0026] Step 102: predict the word to be tested through a pre-acquired first network to obtain the pronunciation of the word to be tested; wherein the first network is determined according to a pronunciation dictionary, and the pronunciation dictionary includes words and pronunciations corresponding to the words.
[0027] The words in the pronunciation dictionary and the pronunciations corresponding to the words can be obtained by manual annotation. The words in the pronunciation dictionary all have corresponding pronunciations. The first network can be determined according to the pronunciation dictionary.
[0028] The process of acquiring the first network includes:
[0029] A prediction network is constructed according to a sample character set and a sample pronunciation set, and the prediction network is optimized to obtain a first network; an arc of the prediction network includes a first input value, a first output value and a pronunciation score value, wherein the first input value is a character in the sample character set, the first output value is a pronunciation in the sample pronunciation set, and the pronunciation score value is a likelihood corresponding to the first input value and the first output value.
[0030] When constructing a prediction network, a fence network (i.e., a lattice network) can be constructed, and each arc on the network includes a first input value, a first output value, and a pronunciation score value. In addition, each arc also includes a starting point and an end point. The first input value is a character in a sample character set, and the first output value is a pronunciation in a sample pronunciation set. The pronunciation score value is the likelihood corresponding to the first input value and the first output value. The greater the likelihood, the greater the possibility that the first input value (i.e., the character included in the arc) corresponds to the first output value (i.e., the pronunciation included in the arc). For example, if the first input value is the first character and the first output value is the first pronunciation, then the greater the pronunciation score value, the greater the possibility that the first character pronounces the first pronunciation. The pronunciation score value in the prediction network can be a preset value or a random value, which is not limited here. Each path in the prediction network corresponds to a word, that is, each path includes multiple arcs, the first input values of the multiple arcs constitute a word, the first output values of the multiple arcs constitute the pronunciation of the word, and the sum of the pronunciation score values of the multiple arcs represents the probability that the word corresponds to the pronunciation composed of multiple arcs.
[0031] For example, when building a prediction network, these relationships can be expressed by building a fence network (i.e., lattice network): the information included on each arc is: input value, output value, pronunciation score value, and each arc can also include a start point and an end point. The input value is an element in set A (i.e., the sample character set), the output value is an element in set B (i.e., the sample pronunciation set), and the pronunciation score value represents the mapping probability from the input value to the output value. Initially, the pronunciation score value can use a random value.
[0032] Since the pronunciation score value in the prediction network is a preset value or a random value at the beginning, which is not accurate enough, the prediction network needs to be optimized, the pronunciation score value in the prediction network needs to be adjusted, and the accuracy of the pronunciation score value needs to be improved. The first network can be regarded as a network after the pronunciation score value of the prediction network is continuously optimized. Compared with the prediction network, the pronunciation score value in the first network is more accurate. The arc of the first network includes a first input value, a first output value, and an optimized pronunciation score value.
[0033] The pronunciation of the word to be tested is predicted by a first network constructed by using a sample character set and a sample pronunciation set. Since the words that can be predicted by the first network are words composed of characters in the sample character set, and the characters in the sample character set can be obtained from manually annotated words, the number of words composed of characters in the sample character set is greater than the number of manually annotated words, and the words that can be predicted by the first network are not limited to manually annotated words, the number of words with predictable pronunciation is increased, the labor cost is reduced, and the prediction efficiency is improved.
[0034] In the embodiment of the present invention, the electronic device may be a mobile phone, a tablet computer (Tablet Personal Computer), a laptop computer (Laptop Computer), a personal digital assistant (PDA), a mobile Internet device (MID) or a wearable device (Wearable Device), etc.
[0035] The pronunciation prediction method of the embodiment of the present invention obtains a word to be tested; predicts the word to be tested through a pre-acquired first network to obtain the pronunciation of the word to be tested; wherein the first network is determined according to a pronunciation dictionary, and the pronunciation dictionary includes words and pronunciations corresponding to the words. Since the first network is determined according to the pronunciation dictionary, the words that can be predicted by the first network are words composed of characters determined by the pronunciation dictionary, and the characters determined by the pronunciation dictionary can be obtained from manually annotated words. In this way, the number of words composed of characters determined according to the pronunciation dictionary is greater than the number of manually annotated words, and the words that can be predicted by the first network are not limited to manually annotated words, which increases the number of words with predictable pronunciation, reduces labor costs, and improves prediction efficiency.
[0036] Furthermore, before constructing the prediction network according to the sample character set and the sample pronunciation set, the acquisition process of the first network also includes:
[0037] According to the pronunciation dictionary, the sample character set and the sample pronunciation set are obtained.
[0038] Specifically, the words in the pronunciation dictionary and the pronunciations corresponding to the words can be obtained by manual annotation. According to the pronunciation dictionary, a sample character set and a sample pronunciation set are obtained. The characters in the sample character set are obtained by splitting the words. The pronunciations in the sample pronunciation set correspond to the pronunciations of the characters in the sample character set (the pronunciations are not necessarily correct, and are represented by pronunciation score values). A character in the sample character set can correspond to a pronunciation in the sample pronunciation set. The pronunciation dictionary is obtained by manual annotation, and the sample character set and the sample pronunciation set are further obtained. In this way, the first network finally obtained can predict the pronunciations of words not included in the pronunciation dictionary in addition to the words included in the pronunciation dictionary.
[0039] Furthermore, the optimizing the prediction network to obtain the first network includes:
[0040] According to the prediction network, an optimal path of the word is obtained, wherein the optimal path includes each character of the word, a pronunciation corresponding to each character, and a first pronunciation score value of each character of the word;
[0041] Inputting each character of the word and the pronunciation corresponding to each character into a Gaussian mixture model (GMM) model to obtain a second pronunciation score value of each character of the word;
[0042] If the difference between the first pronunciation score value and the second pronunciation score value of each character of the word is not greater than a preset threshold, determining the prediction network as the first network;
[0043] If the difference between the first pronunciation score value and the second pronunciation score value of at least one character of the word is greater than a preset threshold, the pronunciation score value of the arc of the prediction network is updated according to the second pronunciation score value, and the step of obtaining the optimal path of the word according to the prediction network is performed.
[0044] Specifically, the optimal path is the path with the highest pronunciation score value among the multiple paths corresponding to the word in the prediction network. The pronunciation score value of the path is the sum of the pronunciation score values of the arcs included in the path. The optimal path includes multiple arcs, each arc corresponds to the character of the word, the pronunciation of the character, and the pronunciation score value of the pronunciation corresponding to the character. The first input value combination of each arc on the optimal path is the word, and the first output value combination of each arc on the optimal path is the pronunciation corresponding to the word.
[0045] Each character of the word on the optimal path and the pronunciation corresponding to each character are input into a Gaussian mixture model (GMM) to obtain a second pronunciation score value of each character of the word. For example, if the word includes 5 characters, 5 second pronunciation score values will be obtained here, and each character corresponds to a second pronunciation score value.
[0046] If the difference between the first pronunciation score and the second pronunciation score of each character of the word is not greater than the preset threshold, the prediction network is determined as the first network, where the difference is a positive value. If the first pronunciation score is greater than the second pronunciation score, the second pronunciation score is subtracted from the first pronunciation score, and if the first pronunciation score is less than or equal to the second pronunciation score, the first pronunciation score is subtracted from the second pronunciation score. Preferably, the preset threshold is 0, that is, the first pronunciation score and the second pronunciation score of each character of the word are equal.
[0047] For example, if the word includes 5 characters, the first pronunciation score values corresponding to the 5 characters are compared with the second pronunciation score values respectively. If the difference between the first pronunciation score values corresponding to each of the 5 characters and the second pronunciation score values is not greater than a preset threshold, the prediction network is determined to be the first network.
[0048] If the difference between the first pronunciation score and the second pronunciation score of at least one character of the word is greater than a preset threshold, the pronunciation score of the arc of the prediction network is updated according to the second pronunciation score, and the step of obtaining the optimal path of the word according to the prediction network is performed. In other words, if the difference between the first pronunciation score and the second pronunciation score of at least one character of the word is greater than the preset threshold, the pronunciation score on the arc included in the optimal path of the word in the prediction network is updated to the second pronunciation score, and step 101 is performed again until the difference between the first pronunciation score and the second pronunciation score of each character of the word is not greater than the preset threshold, and the prediction network obtained at this time is the first network.
[0049] By continuously predicting the network, each character on the optimal path of the word and the pronunciation corresponding to each character are input into the Gaussian mixture model to obtain a second pronunciation score value, and the prediction network is updated according to the second pronunciation score value until the prediction network converges. At this time, the prediction network has been trained and can be used to predict pronunciation. The condition for the prediction network to converge is that the change in the pronunciation score value of the arc of the prediction network is very small, which can be determined by the difference between the first pronunciation score value and the second pronunciation score value of each character of the word is not greater than a preset threshold.
[0050] Further, such as Figure 2 As shown, step 102, predicting the word to be tested by using the pre-acquired first network to obtain the pronunciation of the word to be tested, includes:
[0051] Step 1021, split the word to be tested, and obtain a character set corresponding to the word to be tested, wherein the sample character set includes the character set corresponding to the word to be tested;
[0052] Step 1022: construct a character network of the word to be tested, wherein the second input value and the second output value corresponding to each arc on the character network are characters in the character set;
[0053] Step 1023: synthesize the character network and the first network through an algorithm to obtain a second network, wherein the arc of the second network includes a third input value, a third output value and a third pronunciation score value, the third input value is a character in the character set corresponding to the word to be tested, the third output value is the pronunciation of the third input value, and the third pronunciation score value is the likelihood corresponding to the third input value and the third output value;
[0054] Step 1024: Obtain N optimal paths of the word to be tested according to the second network, where N is a positive integer;
[0055] Step 1025: Obtain N pronunciations of the word to be tested according to the N optimal paths.
[0056] Specifically, when predicting a word to be tested, the word to be tested is first split, and the splitting method can be based on the characters included in the sample character set. For example, if there is no second character in the sample character set, or the probability of the second character appearing is very low, the word to be tested may not be split into the second character. For example, if the sample character set includes a / l / e / x / al / ale / le, but does not include ex, then for the word alex to be tested, alex can be split into a / l / e / x, al / e / x, ale / x, a / le / x, instead of splitting alex into a / l / ex.
[0057] According to the character set of the word to be tested, a character network of the word to be tested is constructed. The second input value and the second output value corresponding to each arc on the character network are characters in the character set, so that the word to be tested corresponds to each path of the character network, and a splitting method of the word to be tested corresponds to a path in the character network.
[0058] The character network and the first network are synthesized by an algorithm to obtain a second network. Specifically, the character network and the first network can be synthesized by a compose algorithm. The arc of the second network includes a third input value, a third output value and a third pronunciation score value, wherein the third input value is a character in the character set corresponding to the word to be tested, the third output value is the pronunciation of the third input value, and the third pronunciation score value is the likelihood of the third input value corresponding to the third output value. In other words, the arc of the second network includes the pronunciations corresponding to the characters obtained by multiple splitting methods of the word to be tested, and the corresponding likelihoods.
[0059] By obtaining N optimal paths of the second network, N pronunciations corresponding to the word to be tested can be obtained. The N optimal paths can be understood as the paths corresponding to the top N pronunciation scores in the second network, among the multiple paths corresponding to the word to be tested, sorted from high to low. The pronunciation score of a path is the sum of the pronunciation scores of the arcs included in the path.
[0060] Each optimal path of the N optimal paths includes multiple arcs, and each arc corresponds to the character of the word to be tested, the pronunciation of the character, and the pronunciation score value of the pronunciation corresponding to the character. On each optimal path of the N optimal paths, the third input value of each arc is combined into a word, and the third output value of each arc on the optimal path is combined into the pronunciation corresponding to the word. According to the N optimal paths, N pronunciations of the word to be tested can be obtained, and each optimal path corresponds to one pronunciation of the word to be tested.
[0061] In this embodiment, since N optimal paths of the word to be tested can be obtained according to the second network, N pronunciations can be obtained to adapt to more scenarios and improve prediction efficiency.
[0062] The following describes the above prediction method by listing specific embodiments.
[0063] First, through manual annotation, a pronunciation dictionary is obtained as training material. This pronunciation dictionary is only used for training, so that when predicting, in addition to the words in the pronunciation dictionary, the Chinese pronunciation of words that are not in the pronunciation dictionary can also be predicted. It is divided into two steps: training and prediction:
[0064] Training steps: Based on the pronunciation dictionary, two sets are established: set A (i.e., sample character set), which stores character combinations; set B (i.e., sample pronunciation set), which stores pronunciation sets. There is a mapping from set A to set B, which is the probability of a character combination corresponding to a certain pronunciation combination. GMM is used to model this distribution.
[0065] Take the Chinese pronunciation of English words as an example. Construct a lattice network (i.e. prediction network), each arc contains five pieces of information: starting point, end point, input, output, and score. The input is the element in set A, and the output is the element in set B. The score represents the mapping probability from A to B. Each path of the network represents a word and its corresponding pronunciation. The sum of the scores on the arc represents the likelihood of the word corresponding to the pronunciation.
[0066] Use the Expectation-Maximization algorithm (EM) to optimize the lattice network:
[0067] Step 1: Calculate the optimal path for each word through the lattice network. The pronunciation sequence combination corresponding to the optimal path is used as the pronunciation combination of the word. After obtaining the combination of pronunciation sequences of all words, update the parameters of GMM as the observation distribution, that is, input the characters on the optimal path and the pronunciation of the characters into GMM, and obtain the pronunciation score value of the characters through GMM.
[0068] Step 2: After obtaining the new GMM, rebuild a new lattice network and repeat steps 1 and 2 until convergence. The convergence condition is that the pronunciation score of the characters on the optimal path tends to be stable, with little or no change. At this time, according to set A, set B and the corresponding GMM model parameters (i.e., pronunciation score values), a lattice network L is constructed to predict pronunciation.
[0069] Prediction step: Given a word (this word may not be in the pronunciation dictionary), split the word into all possible combinations based on set A. For example, alex can be split into a / l / e / x, al / e / x, ale / x, etc. The specific splitting method depends on the elements of set A, that is, characters that are not in set A, or characters with a very low probability of appearing, the word to be tested may not be split into these characters. For example, if the sample character set includes a / l / e / x / al / ale / le, but does not include ex, then for the word to be tested alex, alex can be split into a / l / e / x, al / e / x, ale / x, a / le / x, instead of splitting alex into a / l / ex. Using the characters obtained after splitting, alex is constructed into a character network C, where the input and output on each arc of the network are characters, and there is no weight on the arc.
[0070] The character network C and the trained network L are combined into a new network D through the compose algorithm. D expresses the pronunciation combinations and corresponding likelihoods corresponding to multiple splitting methods of Alex. The Dijkstra algorithm (Djkstra algorithm) is used to calculate the optimal path in network D. The pronunciation sequence corresponding to the path is the Chinese pronunciation of the word.
[0071] If the word to be tested is relatively ambiguous and multiple Chinese pronunciations of the word to be tested are desired, N optimal paths (ie, Nbest paths) are calculated from the network D, and the Nbest results are used as the N Chinese pronunciations of the word.
[0072] The prediction method in this embodiment is more objective and more stable than manual labeling. It can predict the pronunciation of any word. If it is an uncommon word that is difficult to label manually, the pronunciation can still be obtained using this method. It can give multiple most likely pronunciations, which is very useful in command word recognition.
[0073] See also Figure 3 , Figure 3 is one of the structural diagrams of the electronic device provided by the embodiment of the present invention, such as Figure 3 As shown, the electronic device 300 includes:
[0074] An acquisition module 301 is used to acquire a word to be tested;
[0075] A prediction module 302 is used to predict the word to be tested through a pre-acquired first network to obtain the pronunciation of the word to be tested;
[0076] The first network is determined according to a pronunciation dictionary, wherein the pronunciation dictionary includes words and pronunciations corresponding to the words.
[0077] Furthermore, the process of acquiring the first network includes:
[0078] Constructing a prediction network according to a sample character set and a sample pronunciation set, wherein an arc of the prediction network includes a first input value, a first output value, and a pronunciation score value, wherein the first input value is a character in the sample character set, the first output value is a pronunciation in the sample pronunciation set, and the pronunciation score value is a likelihood corresponding to the first input value and the first output value;
[0079] The prediction network is optimized to obtain a first network.
[0080] Furthermore, before constructing the prediction network according to the sample character set and the sample pronunciation set, the acquisition process of the first network also includes:
[0081] According to the pronunciation dictionary, the sample character set and the sample pronunciation set are obtained.
[0082] Furthermore, the optimizing the prediction network to obtain the first network includes:
[0083] According to the prediction network, an optimal path of the word is obtained, wherein the optimal path includes each character of the word, a pronunciation corresponding to each character, and a first pronunciation score value of each character of the word;
[0084] Inputting each character of the word and the pronunciation corresponding to each character into a Gaussian mixture model (GMM) model to obtain a second pronunciation score value of each character of the word;
[0085] If the difference between the first pronunciation score value and the second pronunciation score value of each character of the word is not greater than a preset threshold, determining the prediction network as the first network;
[0086] If the difference between the first pronunciation score value and the second pronunciation score value of at least one character of the word is greater than a preset threshold, the pronunciation score value of the arc of the prediction network is updated according to the second pronunciation score value, and the step of obtaining the optimal path of the word according to the prediction network is performed.
[0087] Further, such as Figure 5 As shown, the prediction module 302 includes:
[0088] The splitting submodule 3021 is used to split the word to be tested and obtain the character set corresponding to the word to be tested, wherein the sample character set includes the character set corresponding to the word to be tested;
[0089] A construction submodule 3022 is used to construct a character network of the word to be tested, wherein the second input value and the second output value corresponding to each arc on the character network are characters in the character set;
[0090] A synthesis submodule 3023 is used to synthesize the character network and the first network through an algorithm to obtain a second network, wherein the arc of the second network includes a third input value, a third output value and a third pronunciation score value, the third input value is a character in the character set corresponding to the word to be tested, the third output value is the pronunciation of the third input value, and the third pronunciation score value is the likelihood corresponding to the third input value and the third output value;
[0091] A path acquisition submodule 3024 is used to acquire N optimal paths of the word to be tested according to the second network, where N is a positive integer;
[0092] The pronunciation acquisition submodule 3025 is used to acquire N pronunciations of the word to be tested according to the N optimal paths.
[0093] The electronic device 300 can realize Figure 1 To avoid repetition, the various processes implemented by the electronic device in the method embodiment will not be described again here.
[0094] The electronic device 300 of the embodiment of the present invention obtains a word to be tested; predicts the word to be tested through a pre-acquired first network to obtain the pronunciation of the word to be tested; wherein the first network is determined according to a pronunciation dictionary, and the pronunciation dictionary includes words and pronunciations corresponding to the words. In this way, since the number of words composed of characters determined according to the pronunciation dictionary is greater than the number of words manually annotated, the words that can be predicted by the first network are not limited to the words manually annotated, which increases the number of words with predictable pronunciation, reduces labor costs, and improves prediction efficiency.
[0095] Figure 5 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention is shown in FIG. Figure 5 As shown, the electronic device 400 includes but is not limited to: a radio frequency unit 401, a network module 402, an audio output unit 403, an input unit 404, a sensor 405, a display unit 406, a user input unit 407, an interface unit 408, a memory 409, a processor 410, and a power supply 411. Those skilled in the art will understand that Figure 5 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.
[0096] The processor 410 is used to obtain a word to be tested;
[0097] Predicting the word to be tested by using the pre-acquired first network to obtain the pronunciation of the word to be tested;
[0098] The first network is determined according to a pronunciation dictionary, wherein the pronunciation dictionary includes words and pronunciations corresponding to the words.
[0099] Furthermore, the process of acquiring the first network includes:
[0100] Constructing a prediction network according to a sample character set and a sample pronunciation set, wherein an arc of the prediction network includes a first input value, a first output value, and a pronunciation score value, wherein the first input value is a character in the sample character set, the first output value is a pronunciation in the sample pronunciation set, and the pronunciation score value is a likelihood corresponding to the first input value and the first output value;
[0101] The prediction network is optimized to obtain a first network.
[0102] Furthermore, before constructing the prediction network according to the sample character set and the sample pronunciation set, the acquisition process of the first network also includes:
[0103] According to the pronunciation dictionary, the sample character set and the sample pronunciation set are obtained.
[0104] Furthermore, the optimizing the prediction network to obtain the first network includes:
[0105] According to the prediction network, an optimal path of the word is obtained, wherein the optimal path includes each character of the word, a pronunciation corresponding to each character, and a first pronunciation score value of each character of the word;
[0106] Inputting each character of the word and the pronunciation corresponding to each character into a Gaussian mixture model (GMM) model to obtain a second pronunciation score value of each character of the word;
[0107] If the difference between the first pronunciation score value and the second pronunciation score value of each character of the word is not greater than a preset threshold, determining the prediction network as the first network;
[0108] If the difference between the first pronunciation score value and the second pronunciation score value of at least one character of the word is greater than a preset threshold, the pronunciation score value of the arc of the prediction network is updated according to the second pronunciation score value, and the step of obtaining the optimal path of the word according to the prediction network is performed.
[0109] Further, the processor 410 is further configured to split the word to be tested, and obtain a character set corresponding to the word to be tested, wherein the sample character set includes a character set corresponding to the word to be tested;
[0110] Constructing a character network of the word to be tested, wherein the second input value and the second output value corresponding to each arc on the character network are characters in the character set;
[0111] The character network and the first network are synthesized by an algorithm to obtain a second network, wherein the arc of the second network includes a third input value, a third output value and a third pronunciation score value, the third input value is a character in the character set corresponding to the word to be tested, the third output value is the pronunciation of the third input value, and the third pronunciation score value is the likelihood of the third input value and the third output value;
[0112] According to the second network, obtaining N optimal paths of the word to be tested, where N is a positive integer;
[0113] According to the N optimal paths, N pronunciations of the word to be tested are obtained.
[0114] The electronic device 400 can implement various processes implemented by the electronic devices in the aforementioned embodiments, which will not be described again here to avoid repetition.
[0115] The electronic device 400 of the embodiment of the present invention obtains a word to be tested; predicts the word to be tested through a pre-acquired first network to obtain the pronunciation of the word to be tested; wherein the first network is determined according to a pronunciation dictionary, and the pronunciation dictionary includes words and pronunciations corresponding to the words. In this way, since the number of words composed of characters determined according to the pronunciation dictionary is greater than the number of words manually annotated, the words that can be predicted by the first network are not limited to the words manually annotated, which increases the number of words with predictable pronunciation, reduces labor costs, and improves prediction efficiency.
[0116] It should be understood that in the embodiment of the present invention, the radio frequency unit 401 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 410 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 401 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 401 can also communicate with the network and other devices through a wireless communication system.
[0117] The electronic device provides users with wireless broadband Internet access through the network module 402, such as helping users to send and receive emails, browse web pages, and access streaming media.
[0118] The audio output unit 403 can convert the audio data received by the RF unit 401 or the network module 402 or stored in the memory 409 into an audio signal and output it as sound. Moreover, the audio output unit 403 can also provide audio output related to a specific function performed by the electronic device 400 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 403 includes a speaker, a buzzer, a receiver, etc.
[0119] The input unit 404 is used to receive audio or video signals. The input unit 404 may include a graphics processor (GPU) 4041 and a microphone 4042, and the graphics processor 4041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 406. The image frame processed by the graphics processor 4041 can be stored in the memory 409 (or other storage medium) or sent via the radio frequency unit 401 or the network module 402. The microphone 4042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 401 in the case of a telephone call mode.
[0120] The electronic device 400 also includes at least one sensor 405, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 4061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 4061 and / or the backlight when the electronic device 400 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 405 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.
[0121] The display unit 406 is used to display information input by the user or information provided to the user. The display unit 406 may include a display panel 4061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0122] The user input unit 407 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 407 includes a touch panel 4071 and other input devices 4072. The touch panel 4071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 4071 or near the touch panel 4071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 4071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the contact point coordinates, and then sends it to the processor 410, receives the command sent by the processor 410 and executes it. In addition, the touch panel 4071 can be implemented using various types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 4071, the user input unit 407 may also include other input devices 4072. Specifically, other input devices 4072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail here.
[0123] Furthermore, the touch panel 4071 may be overlaid on the display panel 4061. When the touch panel 4071 detects a touch operation on or near it, it is transmitted to the processor 410 to determine the type of the touch event. Then, the processor 410 provides a corresponding visual output on the display panel 4061 according to the type of the touch event. Figure 5 In the figure, the touch panel 4071 and the display panel 4061 are two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 4071 and the display panel 4061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.
[0124] The interface unit 408 is an interface for connecting an external device to the electronic device 400. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 408 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 400 or may be used to transmit data between the electronic device 400 and an external device.
[0125] The memory 409 can be used to store software programs and various data. The memory 409 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 409 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0126] The processor 410 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 409, and calling data stored in the memory 409, so as to monitor the electronic device as a whole. The processor 410 may include one or more processing units; preferably, the processor 410 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 410.
[0127] The electronic device 400 may also include a power supply 411 (such as a battery) for supplying power to each component. Preferably, the power supply 411 may be logically connected to the processor 410 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0128] In addition, the electronic device 400 includes some functional modules not shown, which will not be described in detail here.
[0129] Preferably, an embodiment of the present invention further provides an electronic device, comprising a processor 410, a memory 409, and a computer program stored in the memory 409 and executable on the processor 410. When the computer program is executed by the processor 410, each process of the above-mentioned pronunciation prediction method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0130] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned pronunciation prediction method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Wherein, the computer-readable storage medium is such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0131] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0132] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0133] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A pronunciation prediction method, applied to electronic equipment, characterized in that: include: Get the word to be tested; Predicting the word to be tested by using the pre-acquired first network to obtain the pronunciation of the word to be tested; wherein the first network is determined according to a pronunciation dictionary, the pronunciation dictionary including words and pronunciations corresponding to the words; The process of acquiring the first network includes: Constructing a prediction network according to a sample character set and a sample pronunciation set, wherein an arc of the prediction network includes a first input value, a first output value, and a pronunciation score value, wherein the first input value is a character in the sample character set, the first output value is a pronunciation in the sample pronunciation set, and the pronunciation score value is a likelihood corresponding to the first input value and the first output value; Optimizing the prediction network to obtain a first network; The step of predicting the word to be tested by using the pre-acquired first network to obtain the pronunciation of the word to be tested includes: Splitting the word to be tested to obtain a character set corresponding to the word to be tested, wherein the sample character set includes the character set corresponding to the word to be tested; Constructing a character network of the word to be tested, wherein the second input value and the second output value corresponding to each arc on the character network are characters in the character set; The character network and the first network are synthesized by an algorithm to obtain a second network, wherein the arc of the second network includes a third input value, a third output value and a third pronunciation score value, the third input value is a character in the character set corresponding to the word to be tested, the third output value is the pronunciation of the third input value, and the third pronunciation score value is the likelihood of the third input value and the third output value; According to the second network, obtaining N optimal paths of the word to be tested, where N is a positive integer; According to the N optimal paths, N pronunciations of the word to be tested are obtained.
2. The method according to claim 1, characterized in that Before constructing the prediction network according to the sample character set and the sample pronunciation set, the acquisition process of the first network also includes: According to the pronunciation dictionary, the sample character set and the sample pronunciation set are obtained.
3. The method according to claim 1, characterized in that The step of optimizing the prediction network to obtain a first network includes: According to the prediction network, an optimal path of the word is obtained, wherein the optimal path includes each character of the word, a pronunciation corresponding to each character, and a first pronunciation score value of each character of the word; Inputting each character of the word and the pronunciation corresponding to each character into a Gaussian mixture model (GMM) model to obtain a second pronunciation score value of each character of the word; If the difference between the first pronunciation score value and the second pronunciation score value of each character of the word is not greater than a preset threshold, determining the prediction network as the first network; If the difference between the first pronunciation score value and the second pronunciation score value of at least one character of the word is greater than a preset threshold, the pronunciation score value of the arc of the prediction network is updated according to the second pronunciation score value, and the step of obtaining the optimal path of the word according to the prediction network is performed.
4. An electronic device, characterized in that: include: An acquisition module is used to acquire the words to be tested; A prediction module, used to predict the word to be tested through a pre-acquired first network to obtain the pronunciation of the word to be tested; wherein the first network is determined according to a pronunciation dictionary, the pronunciation dictionary including words and pronunciations corresponding to the words; The process of acquiring the first network includes: Constructing a prediction network according to a sample character set and a sample pronunciation set, wherein an arc of the prediction network includes a first input value, a first output value, and a pronunciation score value, wherein the first input value is a character in the sample character set, the first output value is a pronunciation in the sample pronunciation set, and the pronunciation score value is a likelihood corresponding to the first input value and the first output value; Optimizing the prediction network to obtain a first network; The prediction module comprises: A splitting submodule, used for splitting the word to be tested, and obtaining a character set corresponding to the word to be tested, wherein the sample character set includes a character set corresponding to the word to be tested; A construction submodule, used for constructing a character network of the word to be tested, wherein the second input value and the second output value corresponding to each arc on the character network are characters in the character set; A synthesis submodule, configured to synthesize the character network and the first network through an algorithm to obtain a second network, wherein the arc of the second network includes a third input value, a third output value and a third pronunciation score value, the third input value is a character in the character set corresponding to the word to be tested, the third output value is the pronunciation of the third input value, and the third pronunciation score value is the likelihood corresponding to the third input value and the third output value; A path acquisition submodule, used for acquiring N optimal paths of the word to be tested according to the second network, where N is a positive integer; The pronunciation acquisition submodule is used to acquire N pronunciations of the word to be tested according to the N optimal paths.
5. The electronic device according to claim 4, characterized in that: Before constructing the prediction network according to the sample character set and the sample pronunciation set, the acquisition process of the first network also includes: According to the pronunciation dictionary, the sample character set and the sample pronunciation set are obtained.
6. The electronic device according to claim 4, characterized in that: The step of optimizing the prediction network to obtain a first network includes: According to the prediction network, an optimal path of the word is obtained, wherein the optimal path includes each character of the word, a pronunciation corresponding to each character, and a first pronunciation score value of each character of the word; Inputting each character of the word and the pronunciation corresponding to each character into a Gaussian mixture model (GMM) model to obtain a second pronunciation score value of each character of the word; If the difference between the first pronunciation score value and the second pronunciation score value of each character of the word is not greater than a preset threshold, determining the prediction network as the first network; If the difference between the first pronunciation score value and the second pronunciation score value of at least one character of the word is greater than a preset threshold, the pronunciation score value of the arc of the prediction network is updated according to the second pronunciation score value, and the step of obtaining the optimal path of the word according to the prediction network is performed.
7. An electronic device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the pronunciation prediction method according to any one of claims 1 to 3 when executed by the processor.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the pronunciation prediction method according to any one of claims 1 to 3 are implemented.
