Multi-syllable word disambiguation method and device, electronic equipment and readable storage medium

By decomposing the Transformer encoder into initial consonant, final vowel, and tone classifiers, and combining them with pinyin weight information, the problem of poor disambiguation effect of polyphonic characters is solved, and high-accuracy polyphonic character prediction is achieved even with limited or unbalanced data.

CN116597809BActive Publication Date: 2026-06-02BEIJING SINOVOICE TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING SINOVOICE TECH CO LTD
Filing Date
2023-04-28
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing methods for disambiguating polyphonic characters suffer from poor disambiguation performance, especially when the data volume is large or the data is unbalanced. They are computationally intensive, difficult to maintain, and prone to conflicts between rules.

Method used

The Transformer encoder is decomposed into an initial consonant classifier, a final vowel classifier, and a tone classifier. Combined with the pinyin weight information, the first pinyin prediction result is generated by obtaining the mask information, word segmentation information, part-of-speech information, and semantic information of the target polyphonic character. The final pinyin prediction result is determined based on the pinyin weight information.

Benefits of technology

In situations where the amount of data is limited or unbalanced, the accuracy of polyphonic character prediction is improved by limiting the possible pronunciations of polyphonic characters through pinyin weight information, thus ensuring the accuracy of the prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116597809B_ABST
    Figure CN116597809B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a multi-sound character disambiguation method and device, electronic equipment and storage medium, including: obtaining attribute information of a target multi-sound character including mask information, word segmentation information, part-of-speech information and semantic information, inputting the attribute information into a Transformer encoder including an initial classifier, a final classifier and a tone classifier, splicing the output results to generate a first pinyin prediction result, and determining a final pinyin prediction result according to pinyin weight information of the target multi-sound character and the first pinyin prediction result. In the case of insufficient data or data imbalance, the initial classifier, the final classifier and the tone classifier are used to fully train the initial classifier, the final classifier and the tone classifier, so as to improve the multi-sound character prediction accuracy. At the same time, by increasing the pinyin weight information, the possible multi-sound character pronunciation can be limited in advance, so that the multi-sound character disambiguation prediction result is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of speech processing technology, and in particular relates to a method, apparatus, electronic device and readable storage medium for disambiguating polyphonic characters. Background Technology

[0002] Text-to-speech (TTS) technology can generate audio from text. While TTS technology has undergone several stages of development, it always relies on a front-end system. This system typically includes modules for language identification, sentence segmentation, word segmentation, prosody prediction, and polyphonic character disambiguation. The polyphonic character disambiguation module in the TTS front-end plays a crucial role in the overall synthesis effect. Mispronouncing polyphonic characters or having prosodic pauses directly impacts the listener's experience. Therefore, optimizing the polyphonic character disambiguation module in the TTS front-end is a critical issue that needs to be addressed.

[0003] In existing technologies, polyphonic character disambiguation can be achieved through a combination of vocabularies and rules, or through model-based methods. The former combines general and custom vocabularies with a large number of rules or expert knowledge to achieve disambiguation, while the latter uses a common 2071-class classification model. However, the former suffers from maintenance costs and the potential for conflicts or mutual influence between rules, while the latter requires a large amount of data. Furthermore, a large sample size leads to increased computation, limiting the application of this method. Therefore, existing methods for polyphonic character disambiguation suffer from poor disambiguation performance. Summary of the Invention

[0004] This invention provides a method, apparatus, electronic device, and readable storage medium for disambiguating polyphonic characters, in order to solve the problem that existing methods for disambiguating polyphonic characters have poor disambiguation effects.

[0005] To solve the above-mentioned technical problems, the present invention is implemented as follows:

[0006] In a first aspect, the present invention provides a method for disambiguating polyphonic characters, the method comprising:

[0007] Obtain the attribute information of the target polyphonic character, the attribute information including the mask information, word segmentation information, part-of-speech information and semantic information of the target polyphonic character;

[0008] The attribute information is input into a Transformer encoder, which includes: a consonant classifier, a vowel classifier, and a tone classifier;

[0009] The outputs of the initial consonant classifier, the final vowel classifier, and the tone classifier are concatenated to generate the first pinyin prediction result.

[0010] The final pinyin prediction result is determined based on the pinyin weight information of the target polyphonic character and the first pinyin prediction result.

[0011] Furthermore, before obtaining the attribute information of the target polyphonic character, the process also includes:

[0012] Pre-set a list of polyphonic characters that includes the target number of polyphonic characters;

[0013] Obtain the target number of second polyphonic characters based on the polyphonic character list;

[0014] The second polyphonic character is annotated with pinyin, word segmentation, and part of speech, and then proofread.

[0015] Furthermore, after annotating the polyphonic characters with pinyin, word segmentation, and parts of speech, and then proofreading them, the process also includes:

[0016] If the proofreading is successful, the pinyin annotation information of the second polyphonic character corresponding to any first polyphonic character in the list of polyphonic characters is obtained;

[0017] The pinyin weight information of any of the first polyphonic characters is determined based on the pinyin annotation information.

[0018] Furthermore, after annotating the second polyphonic character with pinyin, word segmentation, and part-of-speech, and then proofreading it, the process also includes:

[0019] Obtain the text to be predicted;

[0020] The target polyphonic characters in the text to be predicted are determined based on the list of polyphonic characters.

[0021] Furthermore, after inputting the attribute information into the Transformer encoder, the process further includes:

[0022] The initial consonant prediction result of the target polyphonic character is confirmed by the initial consonant classifier and the attribute information;

[0023] The final prediction result of the target polyphonic character is confirmed by the final classifier and the attribute information.

[0024] The tone prediction result of the target polyphonic character is confirmed by the tone classifier and the attribute information.

[0025] Further, determining the final pinyin prediction result based on the pinyin weight information of the target polyphonic character and the first pinyin prediction result includes:

[0026] Obtain the pinyin weight information of the target polyphonic character;

[0027] The first pinyin prediction result and the pronunciation probability of other pinyin information of the target polyphonic character are calculated based on the pinyin weight information.

[0028] The pinyin information corresponding to the maximum value among the pronunciation probabilities is taken as the final pinyin prediction result.

[0029] Secondly, the present invention provides a polyphonic character disambiguation device, the device comprising:

[0030] The first acquisition module is used to acquire the attribute information of the target polyphonic character, the attribute information including the mask information, word segmentation information, part-of-speech information and semantic information of the target polyphonic character;

[0031] The first input module is used to input the attribute information into the Transformer encoder, which includes: a consonant classifier, a vowel classifier, and a tone classifier.

[0032] The first generation module is used to concatenate the output results of the initial consonant classifier, the final vowel classifier, and the tone classifier to generate a first pinyin prediction result.

[0033] The first determining module is used to determine the final pinyin prediction result based on the pinyin weight information of the target polyphonic character and the first pinyin prediction result.

[0034] Thirdly, the present invention provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described method for disambiguating polyphonic characters.

[0035] Fourthly, the present invention provides a readable storage medium that, when the instructions in the storage medium are executed by the processor of an electronic device, enables the electronic device to perform the above-described polyphonic character disambiguation method.

[0036] In this embodiment of the invention, attribute information of the target polyphonic character is obtained. The attribute information includes the pinyin information, mask information, word segmentation information, part-of-speech information, and semantic information of the target polyphonic character, so as to obtain more accurate pronunciation of the target polyphonic character during recognition. The attribute information is input into a Transformer encoder, which includes an initial consonant classifier, a final vowel classifier, and a tone classifier. The outputs of the initial consonant classifier, the final vowel classifier, and the tone classifier are concatenated to generate a first pinyin prediction result. By decomposing the Transformer encoder, the initial consonant and final vowel model can be fully trained even when the amount of data is small or the data is unbalanced, thereby improving the probability of correct prediction. The final pinyin prediction result is determined based on the pinyin weight information of the target polyphonic character and the first pinyin prediction result. By adding pinyin weight information, the possible pronunciations of polyphonic characters can be restricted in advance, making the prediction result of polyphonic character disambiguation more accurate. This invention decomposes the Transformer encoder into three classifiers, enabling the initial and final vowel model to be fully trained even with limited or imbalanced data, thus improving the probability of correctly predicting polyphonic characters. At the same time, by adding pinyin weight information (expert knowledge), possible polyphonic character pronunciations can be restricted in advance, making the polyphonic character disambiguation prediction results more accurate. Attached Figure Description

[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0038] Figure 1 This is a schematic diagram of the architecture of a speech synthesis technology system including a polyphonic character disambiguation method provided in an embodiment of the present invention;

[0039] Figure 2 This is a flowchart of the steps of a polyphonic character disambiguation method provided in an embodiment of the present invention;

[0040] Figure 3 This is a flowchart of another method for disambiguating polyphonic characters provided in an embodiment of the present invention;

[0041] Figure 4 yes Figure 2 The flowchart shown is a step 204 of a polyphonic character disambiguation method provided in an embodiment of the present invention.

[0042] Figure 5 This is a flowchart of another method for disambiguating polyphonic characters provided in an embodiment of the present invention;

[0043] Figure 6 This is a structural diagram of a polyphonic character disambiguation device provided in an embodiment of the present invention;

[0044] Figure 7 This is a structural diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0046] To address the problems existing in the prior art, the inventors of this invention have conducted in-depth research on existing speech synthesis technologies, such as... Figure 1 The diagram shows the architecture of a speech synthesis technology system that includes a polyphonic character disambiguation method. Taking Chinese as an example, after the input text to be predicted is processed by text analysis (including sentence segmentation, word segmentation, text regularization, named entity recognition, etc.), it enters the prosody prediction module. Then, the phonetic annotation module performs phoneme annotation (including polyphonic character disambiguation) on the output result. The resulting phoneme sequence is then used to train a duration model and an acoustic model. The trained result is passed through a vocoder to generate the audio result of the target speaker.

[0047] The polyphonic character disambiguation module is essentially a classification task, namely, selecting the most appropriate annotation result from numerous pinyin candidates. Based on this, this invention provides a polyphonic character disambiguation method that uses three small classification models (initial consonant classifier, final vowel classifier, and tone classifier) ​​and incorporates expert knowledge (pinyin weight information) to help improve prediction accuracy.

[0048] Figure 2 This is a flowchart illustrating the steps of a polyphonic character disambiguation method provided in an embodiment of the present invention, as follows: Figure 2 As shown, the method may include:

[0049] Step 201: Obtain the attribute information of the target polyphonic character.

[0050] The attribute information of the target polyphonic character in the embodiments of the present invention includes the mask information, word segmentation information,词性 information, and semantic information of the target polyphonic character. Among them, the mask information of the target polyphonic character is used to distinguish the target polyphonic character from non-target polyphonic characters, and mask the non-target polyphonic characters initially to avoid the influence of the attribute information of non-target polyphonic characters on the prediction result in the follow-up. The word segmentation information,词性 information, and semantic information are used to help distinguish pronunciations and improve the accuracy of the prediction result. The word segmentation information can be encoded and annotated using a natural language processing model. The词性 information can be encoded and annotated through a pre-designed mapping table. The semantic information can be encoded and annotated through a Bert pre-trained model. Of course, in the embodiments of the present invention, the word segmentation information,词性 information, and semantic information can also be encoded and annotated through other deep learning models or rule methods, and the present invention does not make specific limitations here.

[0051] For example, when the input text to be predicted is "Log in to the credit investigation system of the People's Bank of China", the target polyphonic character is determined to be "行". The word segmentation information is annotated using the common BIOS input method in the natural language processing model, that is, single characters are marked as 4, the beginning of a word is marked as 1, the end of a word is marked as 3, and the middle of a word is marked as 2. Therefore, the word segmentation information of the text to be predicted is "1, 3, 1, 3, 1, 3, 1, 3". The词性 information is encoded and annotated through a pre-designed mapping table. For example, a verb is marked as 5, and a noun is marked as 13. Then the词性 information of the text to be predicted is "5, 5, 13, 13, 13, 13, 13, 13". The encoding of the semantic information is obtained according to the pre-trained language model: taking the commonly used Bert as an example, since the Bert pre-trained model is trained from a large amount of unsupervised text and the encoding of the text by Bert is in vector form, the semantic information in the text can be well encoded.

[0052] Step 202, input the attribute information into the Transformer encoder.

[0053] The Transformer encoder in the embodiments of the present invention includes: an initial consonant classifier, a final classifier, and a tone classifier. The initial consonant classifier includes 27 classifications, the final classifier includes 35 classifications, and the tone classifier includes 5 classifications (high level, rising tone, falling-rising tone, falling tone, light tone). After disassembling the Transformer encoder, the initial consonant and final models can be fully trained in the case of insufficient data or unbalanced data (under the same amount of data, three small models are more likely to be fully trained), thereby increasing the probability of correct prediction.

[0054] It should be noted that after the attribute information is input into the Transformer encoder, the initial consonant, final, and tone of the target polyphonic character are mainly predicted from the three classifiers of the Transformer encoder based on the attribute information, obtaining the first pinyin prediction result. Specifically, after the attribute information is input into the Transformer encoder, it further includes:

[0055] Through the initial consonant classifier and the attribute information, confirm the initial consonant prediction result of the target polyphonic character;

[0056] Through the final classifier and the attribute information, confirm the final prediction result of the target polyphonic character;

[0057] Through the tone classifier and the attribute information, confirm the tone prediction result of the target polyphonic character.

[0058] For example, when the target polyphonic character is "行", input this information into the initial consonant classifier, final classifier, and tone classifier included in the Transformer encoder respectively, and obtain the prediction results from the three classifiers through the attribute information of the target polyphonic character. That is, the initial consonant prediction result obtained from the initial consonant classifier is "h", the final prediction result obtained from the final classifier is "ang", and the tone prediction result obtained from the tone classifier is "2 (rising tone)".

[0059] Step 203, splice the output results of the initial consonant classifier, final classifier, and tone classifier to generate the first pinyin prediction result.

[0060] In the embodiment of the present invention, the first pinyin prediction result is obtained by splicing the initial consonant prediction result, final prediction result, and tone prediction result respectively obtained by the initial consonant classifier, final classifier, and tone classifier according to the splicing rules of pinyin on the fully connected layer. It should be noted that after obtaining the output results of the initial consonant classifier, final classifier, and tone classifier, these three results will be spliced and input into the fully connected layer, and the most probable phonetic result is obtained as the first pinyin prediction result by calculating the cross entropy.

[0061] For example, according to the content of step 202 above, when the obtained initial consonant prediction result is "h", final prediction result is "ang", and tone prediction result is "2 (rising tone)", input these three results into the fully connected layer after deep learning, and the first pinyin prediction result obtained by reasonably splicing the three parts in the fully connected layer is "hang2".

[0062] Step 204, determine the final pinyin prediction result according to the pinyin weight information of the target polyphonic character and the first pinyin prediction result.

[0063] After obtaining the first pinyin prediction result through the attribute information and the initial consonant classifier, final consonant classifier, and tone classifier in the embodiments of the present invention, the pinyin weight information of the target polyphonic character will also be obtained. Since the probabilities of multiple pronunciations of different target polyphonic characters appearing in natural language vary greatly. For example, taking 170,000 sentences of polyphonic character annotation data as an example (data source: randomly crawled from the Internet), the distributions of the two pronunciations of "长" are relatively average (chang2: 7,613 times; zhang3: 5,973 times), and the weights can be set to 0.5 and 0.5. While the ratio of the two pronunciations of "正" is extremely skewed (zheng1: 20 times; zheng4: 8,342 times), and the weights are set to 0.01 and 0.99 at this time. Therefore, when the first pinyin prediction result obtained by analyzing the attribute information does not match the actual situation, the possible pinyin pronunciations of the polyphonic character can also be restricted in advance through the pinyin weight information, making the entire model training more accurate.

[0064] In the embodiments of the present invention, by obtaining the attribute information of the target polyphonic character, where the attribute information includes the target polyphonic character mask information, word segmentation information,词性 information, and semantic information, the pronunciation of the target polyphonic character can be obtained more accurately during subsequent recognition. The attribute information is input into the Transformer encoder, and the Transformer encoder includes: an initial consonant classifier, a final consonant classifier, and a tone classifier. The output results of the initial consonant classifier, the final consonant classifier, and the tone classifier are concatenated to generate the first pinyin prediction result. By disassembling the Transformer encoder, the initial and final consonant model can be fully trained in the case of insufficient data or unbalanced data, improving the probability of predicting correctly according to the attribute information. The final pinyin prediction result is determined according to the pinyin weight information of the target polyphonic character and the first pinyin prediction result. By adding the pinyin weight information, the possible pinyin pronunciations of the polyphonic character can be restricted in advance, making the prediction result of polyphonic character disambiguation more accurate. In the embodiments of the present invention, by disassembling the Transformer encoder into three classifiers, the initial and final consonant model can be fully trained in the case of insufficient data or unbalanced data, improving the probability of correctly predicting polyphonic characters. At the same time, by adding pinyin weight information (expert knowledge), the possible pinyin pronunciations of the polyphonic character can be restricted in advance, making the prediction result of polyphonic character disambiguation more accurate.

[0065] Figure 3 It is a flowchart of the steps of another polyphonic character disambiguation method provided by the embodiments of the present invention. The steps of the polyphonic character disambiguation method disclosed in this embodiment are basically the same as those shown in Figure 2 The difference is that before step 201, it may further include:

[0066] Step 301, preset a list of polyphonic characters including the target number of first polyphonic characters.

[0067] In the embodiments of the present invention, in order to accurately identify the polyphonic characters in the text to be predicted, a list of polyphonic characters will be preset in advance. The first polyphonic characters can be "xing, qia, wei, hai, chang...", and the target quantity can be 100 or 120. The present invention does not make specific limitations here.

[0068] Step 302: Obtain the target quantity of second polyphonic characters according to the list of polyphonic characters.

[0069] The target quantity in the embodiments of the present invention can be 5000 or 8000. The present invention does not make specific limitations here. The second polyphonic characters correspond to the first polyphonic characters. However, the second polyphonic characters are obtained from the target quantity of sentences randomly crawled from network data, so there will be duplicates among the second polyphonic characters.

[0070] For example, the list of polyphonic characters includes the first polyphonic character "xing". Among the 5000 pieces of data crawled from the network, 500 sentences contain this "xing". Therefore, there are 500 "xing" characters among the second polyphonic characters.

[0071] Step 303: Mark the second polyphonic characters with pinyin, word segmentation, and词性 (lexical category), and proofread them.

[0072] In the embodiments of the present invention, when obtaining the second polyphonic characters, a text will be obtained. Therefore, automatic pinyin, word segmentation, and lexical category marking can be performed according to the meaning of the text first and then manual proofreading can be carried out; or voice data can be crawled and proofread after recognition and transcription.

[0073] It should be noted that both the word segmentation information and the lexical category information can help distinguish pronunciations. Taking "log in to the credit reporting system of the People's Bank of China" and "The white snow covered the sidewalk with a white quilt" as examples, if the word segmentation is correct ("People's Bank of China" and "sidewalk"), it is easy to mark the correct pronunciation, that is, the pronunciation option for "People's Bank of China" is hang2, and the pronunciation option for "sidewalk" is xing2 (the difference between the words is large and the disambiguation difficulty is low). Another example is "This room faces the sun" and "My views on the development of sunrise industries". The pronunciation of "sunrise" cannot be distinguished only by word segmentation and requires the assistance of lexical category information. That is, in "This room faces the sun", "sunrise" is a verb, so the pronunciation option is chao2, while in "sunrise industry", "sunrise" is an adjective, so the pronunciation option is zhao1. Among them, 1 means that the tone of the pronunciation of this character is the first tone (yinping), 2 means that the tone of the pronunciation of this character is the second tone (yangping), in addition, 3 means that the tone of the pronunciation of this character is the third tone (shangsheng), 4 means that the tone of the pronunciation of this character is the fourth tone (qusheng), and 5 means that the tone of the pronunciation of this character is the light tone.

[0074] In addition, after passing the proofreading, the pinyin weight information will be calculated for each polyphonic character in the polyphonic character list. To ensure the rationality of the pinyin weight information, the calculated pinyin weight information will be made closer to the true ratio of natural language. For example, taking the polyphonic character '长' in the polyphonic character list, among 5000 sentences with polyphonic character annotations, there are 500 sentences including '长'. The distribution of its two pronunciations is: chang2: 240 times; zhang3: 260 times. Because the distribution is relatively even, the weights can be set to 0.5 and 0.5.

[0075] Specifically, after annotating the polyphonic characters with pinyin, word segmentation, and word nature, and after proofreading, it further includes:

[0076] If the proofreading passes, obtain the pinyin annotation information of the second polyphonic character corresponding to any first polyphonic character in the polyphonic character list;

[0077] Confirm the pinyin weight information of any first polyphonic character according to the pinyin annotation information.

[0078] It should be noted that the polyphonic character list set in the embodiment of the present invention can not only set the pinyin weight information of polyphonic characters but also determine the target polyphonic characters in the text to be predicted. That is, compare each character in the text to be predicted with the content in the polyphonic character list. When the comparison is consistent, confirm that the Chinese character at this time is the target polyphonic character.

[0079] Specifically, after annotating the second polyphonic character with pinyin, word segmentation, and word nature, and after proofreading, it further includes:

[0080] Step 304, obtain the text to be predicted.

[0081] Step 305, judge the text to be predicted according to the polyphonic character list, and determine the target polyphonic characters in the text to be predicted.

[0082] In an embodiment of the present invention, by obtaining the attribute information of the target polyphonic character, the attribute information includes the target polyphonic character mask information, word segmentation information,词性 information, and semantic information, so that a more accurate pronunciation of the target polyphonic character can be obtained during subsequent recognition. The attribute information is input into the Transformer encoder, and the Transformer encoder includes: an initial consonant classifier, a final classifier, and a tone classifier. The output results of the initial consonant classifier, the final classifier, and the tone classifier are concatenated to generate a first pinyin prediction result. By disassembling the Transformer encoder, the initial consonant and final model can be fully trained in the case of insufficient data or unbalanced data, improving the probability of predicting correctly according to the attribute information. The final pinyin prediction result is determined according to the pinyin weight information of the target polyphonic character and the first pinyin prediction result. By adding the pinyin weight information, the possible pronunciations of the polyphonic character can be restricted in advance, making the prediction result of polyphonic character disambiguation more accurate. In an embodiment of the present invention, by disassembling the Transformer encoder into three classifiers, the initial consonant and final model can be fully trained in the case of insufficient data or unbalanced data, improving the probability of correctly predicting polyphonic characters. At the same time, by adding pinyin weight information (expert knowledge), the possible pronunciations of the polyphonic character can be restricted in advance, making the prediction result of polyphonic character disambiguation more accurate. At the same time, the target polyphonic character of the text to be predicted can be determined through a preset list of polyphonic characters, so as to distinguish the target polyphonic character from the non-target polyphonic character when adding mask information later, and mask the non-target polyphonic character initially to prevent the attribute information of the non-target polyphonic character from affecting the prediction result later.

[0083] Figure 4 Yes Figure 2 A feasible implementation scheme of step 204 of a method for polyphonic character disambiguation provided by the embodiment of the present invention shown in the figure, specifically including:

[0084] Step 401, obtain the pinyin weight information of the target polyphonic character.

[0085] In an embodiment of the present invention, after obtaining the first pinyin prediction result through the attribute information, the initial consonant classifier, the final classifier, and the tone classifier, the pinyin weight information of the target polyphonic character will also be obtained, because the probabilities of multiple pronunciations of different target polyphonic characters in natural language vary greatly. In addition, the calculation of the weight information can also consider industry information. For example, for polyphonic characters used in the banking field, a higher weight can be given to "行hang2".

[0086] Step 402, calculate the pronunciation probabilities of the first pinyin prediction result and other pinyin information of the target polyphonic character according to the pinyin weight information.

[0087] In this embodiment of the invention, the weight of the pinyin of the target polyphonic character is input into a deep learning model to obtain the weight ratio of the first pinyin prediction result of the target polyphonic character. Then, it is fused with the weight ratio of other pinyin information of the target polyphonic character to calculate the pronunciation probability of all pinyin information of the target polyphonic character.

[0088] Step 403: Take the pinyin information corresponding to the maximum value in the pronunciation probability as the final pinyin prediction result.

[0089] In this embodiment of the invention, the first prediction result is obtained through attribute information and three classifiers of the Transformer encoder. Then, by adding pinyin weight information (expert knowledge), the pinyin weight information and the first prediction result obtained through the fully connected layer are used together to calculate the multivariate cross-entropy through softmax. The pinyin with the highest probability is taken as the final pinyin prediction result. The pinyin weight information can restrict the possible pronunciations of polyphonic characters in advance, making the prediction result of polyphonic character disambiguation more accurate.

[0090] Figure 5 This is a flowchart of another method for disambiguating polyphonic characters provided in an embodiment of the present invention, specifically including:

[0091] In this embodiment of the invention, after obtaining the text to be predicted, mask information, word segmentation information, and part-of-speech information are obtained. This information is then input into a pre-trained language model to obtain semantic information. The mask information, word segmentation information, part-of-speech information, and semantic information are collectively referred to as attribute information. The attribute information is input into the three classifiers of the Transformer encoder: the initial consonant classifier, the final vowel classifier, and the tone classifier. After obtaining the output results, they are concatenated and sent to the fully connected layer. By calculating the cross-entropy, the phonetic result with the highest probability is obtained as the first pinyin prediction result. Then, the final multivariate cross-entropy is calculated using the pinyin weight information and the first pinyin prediction result to obtain the final pinyin prediction result.

[0092] Figure 6 This is a structural diagram of a polyphonic character disambiguation device provided in an embodiment of the present invention. The device may include:

[0093] The first acquisition module 501 is used to acquire the attribute information of the target polyphonic character. The attribute information includes the mask information, word segmentation information, part-of-speech information and semantic information of the target polyphonic character.

[0094] The first input module 502 is used to input the attribute information into the Transformer encoder, which includes: a consonant classifier, a vowel classifier, and a tone classifier.

[0095] The first generation module 503 is used to concatenate the output results of the initial consonant classifier, the final vowel classifier, and the tone classifier to generate a first pinyin prediction result.

[0096] The first determining module 504 is used to determine the final pinyin prediction result based on the pinyin weight information of the target polyphonic character and the first pinyin prediction result.

[0097] Optionally, the polyphonic character disambiguation device further includes:

[0098] The pre-setting module is used to pre-set a list of polyphonic characters that includes the target number of polyphonic characters.

[0099] The second acquisition module is used to acquire a target number of second polyphonic characters based on the list of polyphonic characters.

[0100] The first proofreading module is used to annotate the second polyphonic character with pinyin, word segmentation, and part of speech, and then proofread it.

[0101] The third acquisition module is used to acquire the pinyin annotation information of the second polyphonic character corresponding to any of the first polyphonic characters in the polyphonic character list if the verification is successful.

[0102] The first confirmation module is used to confirm the pinyin weight information of any of the first polyphonic characters based on the pinyin annotation information.

[0103] The fourth acquisition module is used to acquire the text to be predicted.

[0104] The second determining module is used to judge the text to be predicted based on the list of polyphonic characters, and to determine the target polyphonic characters of the text to be predicted.

[0105] The second confirmation module is used to confirm the initial consonant prediction result of the target polyphonic character through the initial consonant classifier and the attribute information.

[0106] The third confirmation module is used to confirm the prediction result of the finals of the target polyphonic character through the finals classifier and the attribute information.

[0107] The fourth confirmation module is used to confirm the tone prediction result of the target polyphonic character through the tone classifier and the attribute information.

[0108] Optionally, the first determining module 504 further includes:

[0109] The first acquisition submodule is used to acquire the pinyin weight information of the target polyphonic character.

[0110] The first calculation submodule is used to calculate the first pinyin prediction result and the pronunciation probability of other pinyin information of the target polyphonic character based on the pinyin weight information.

[0111] The final pinyin prediction submodule is used to take the pinyin information corresponding to the maximum value among the pronunciation probabilities as the final pinyin prediction result.

[0112] In this embodiment of the invention, attribute information of the target polyphonic character is obtained. The attribute information includes the target polyphonic character mask information, word segmentation information, part-of-speech information, and semantic information, so that the pronunciation of the target polyphonic character can be obtained more accurately in subsequent recognition. The attribute information is input into a Transformer encoder, which includes an initial consonant classifier, a final vowel classifier, and a tone classifier. The outputs of the initial consonant classifier, the final vowel classifier, and the tone classifier are concatenated to generate a first pinyin prediction result. By decomposing the Transformer encoder, the initial consonant and final vowel model can be fully trained even when the amount of data is small or the data is unbalanced, thereby improving the probability of correct prediction based on the attribute information. The final pinyin prediction result is determined based on the pinyin weight information of the target polyphonic character and the first pinyin prediction result. By adding pinyin weight information, the possible pronunciations of polyphonic characters can be restricted in advance, making the prediction result of polyphonic character disambiguation more accurate. This invention decomposes the Transformer encoder into three classifiers, allowing the initial and final vowel model to be fully trained even with limited or imbalanced data, thus improving the probability of correctly predicting polyphonic characters. Simultaneously, by adding pinyin weight information (expert knowledge), possible polyphonic character pronunciations can be pre-limited, making the polyphonic character disambiguation prediction more accurate. Furthermore, a pre-set list of polyphonic characters can identify the target polyphonic characters in the text to be predicted, enabling the subsequent addition of masking information to distinguish between target and non-target polyphonic characters. Non-target polyphonic characters are masked initially to prevent their attribute information from affecting the prediction results.

[0113] The present invention also provides an electronic device, Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. See also... Figure 6 It includes a processor 601, a communication interface 602, a memory 603, and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.

[0114] Memory 603 is used to store computer programs;

[0115] When processor 601 executes a program stored in memory 603, it performs the following steps:

[0116] Obtain the attribute information of the target polyphonic character, the attribute information including the mask information, word segmentation information, part-of-speech information and semantic information of the target polyphonic character;

[0117] The attribute information is input into a Transformer encoder, which includes: a consonant classifier, a vowel classifier, and a tone classifier;

[0118] The outputs of the initial consonant classifier, the final vowel classifier, and the tone classifier are concatenated to generate the first pinyin prediction result.

[0119] The final pinyin prediction result is determined based on the pinyin weight information of the target polyphonic character and the first pinyin prediction result.

[0120] The present invention also provides a readable storage medium, wherein when the instructions in the storage medium are executed by the processor of an electronic device, the electronic device is able to perform the polyphonic character disambiguation method of the foregoing embodiments.

[0121] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0122] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. The structure required to construct such a system is readily apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the invention.

[0123] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0124] Similarly, it should be understood that, in order to simplify the invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into this detailed description, wherein each claim itself is a separate embodiment of the invention.

[0125] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0126] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention can also be implemented as a device or apparatus program for performing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0127] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0128] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0129] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

[0130] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

[0131] It should be noted that the various data-related processes in the embodiments of this application are carried out in compliance with the relevant data protection laws and policies of the country where the location is located, and with the authorization granted by the owner of the corresponding device.

Claims

1. A method for disambiguating polyphonic characters, characterized in that, The method includes: Obtain the attribute information of the target polyphonic character. The attribute information includes the mask information, word segmentation information, part-of-speech information, and semantic information of the target polyphonic character. The word segmentation information is used to mark the target polyphonic character as a single-character word, the beginning of a word, the end of a word, or the middle of a word. The mask information is used to distinguish the target polyphonic character from non-target polyphonic characters and to mask the non-target polyphonic characters initially. The attribute information is input into a Transformer encoder, which includes: a consonant classifier, a vowel classifier, and a tone classifier; The outputs of the initial consonant classifier, the final vowel classifier, and the tone classifier are concatenated to generate a first pinyin prediction result. The first pinyin prediction result is obtained by performing cross-entropy calculation on the outputs of the initial consonant classifier, the final vowel classifier, and the tone classifier in a fully connected layer. The first pinyin prediction result is the phonetic transcription result with the highest probability. The final pinyin prediction result is determined based on the pinyin weight information of the target polyphonic character and the first pinyin prediction result. The pinyin weight information is set based on the industry information corresponding to the target polyphonic character.

2. The method according to claim 1, characterized in that, Before obtaining the attribute information of the target polyphonic character, the process also includes: Pre-set a list of polyphonic characters that includes the target number of polyphonic characters; The target number of second polyphonic characters are obtained from the polyphonic character list; the second polyphonic characters correspond to the first polyphonic characters. The second polyphonic character is annotated with pinyin, word segmentation, and part of speech, and then proofread.

3. The method according to claim 2, characterized in that, After the second polyphonic character is annotated with pinyin, segmented, and marked with parts of speech, and then proofread, the method further includes: If the proofreading is successful, the pinyin annotation information of the second polyphonic character corresponding to any first polyphonic character in the list of polyphonic characters is obtained; The pinyin weight information of any of the first polyphonic characters is determined based on the pinyin annotation information.

4. The method according to claim 2, characterized in that, After the second polyphonic character is annotated with pinyin, segmented, and marked with parts of speech, and then proofread, the method further includes: Obtain the text to be predicted; The target polyphonic characters in the text to be predicted are determined based on the list of polyphonic characters.

5. The method according to claim 1, characterized in that, After inputting the attribute information into the Transformer encoder, the process further includes: The initial consonant prediction result of the target polyphonic character is confirmed by the initial consonant classifier and the attribute information; The final prediction result of the target polyphonic character is confirmed by the final classifier and the attribute information. The tone prediction result of the target polyphonic character is confirmed by the tone classifier and the attribute information.

6. The method according to claim 1, characterized in that, The step of determining the final pinyin prediction result based on the pinyin weight information of the target polyphonic character and the first pinyin prediction result includes: Obtain the pinyin weight information of the target polyphonic character; The first pinyin prediction result and the pronunciation probability of other pinyin information of the target polyphonic character are calculated based on the pinyin weight information. The pinyin information corresponding to the maximum value among the pronunciation probabilities is taken as the final pinyin prediction result.

7. A polyphonic character disambiguation device, characterized in that, The device includes: The first acquisition module is used to acquire the attribute information of the target polyphonic character. The attribute information includes the mask information, word segmentation information, part-of-speech information, and semantic information of the target polyphonic character. The word segmentation information is used to mark the target polyphonic character as a single-character word, the beginning of a word, the end of a word, or the middle of a word. The mask information is used to distinguish the target polyphonic character from non-target polyphonic characters and to mask the non-target polyphonic characters initially. The first input module is used to input the attribute information into the Transformer encoder, which includes: a consonant classifier, a vowel classifier, and a tone classifier. The first generation module is used to concatenate the output results of the initial consonant classifier, the final vowel classifier, and the tone classifier to generate a first pinyin prediction result. The first pinyin prediction result is obtained by performing cross-entropy calculation on the output results of the initial consonant classifier, the final vowel classifier, and the tone classifier in a fully connected layer. The first pinyin prediction result is the phonetic transcription result with the highest probability. The first determining module is used to determine the final pinyin prediction result based on the pinyin weight information of the target polyphonic character and the first pinyin prediction result, wherein the pinyin weight information is set based on the industry information corresponding to the target polyphonic character.

8. The apparatus according to claim 7, characterized in that, The polyphonic character disambiguation device also includes: The pre-setting module is used to pre-set a list of polyphonic characters that includes the target number of polyphonic characters; The second acquisition module is used to acquire a target number of second polyphonic characters based on the polyphonic character list; the second polyphonic characters correspond to the first polyphonic characters. The first proofreading module is used to annotate the second polyphonic character with pinyin, word segmentation, and part of speech, and then proofread it.

9. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the program, it implements the polyphonic character disambiguation method as described in any one of claims 1-6.

10. A readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform one or more of the polyphonic character disambiguation methods according to claims 1-6.