Polyphone disambiguation method and device, equipment and storage medium

By using the part-of-speech classifier model assisted training method in the multiphonetic word disambiguation task, the multiphonetic word disambiguation efficiency of the high-dimensional BERT model is improved, the problem of inefficiency in the existing technology is solved, and the memory and computing power are realized Highly efficient polyphonic disambiguation under limited conditions.

CN119150853APending Publication Date: 2024-12-17GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310721944.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-16
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In the prior art, the multitone word disambiguation task based on the high-dimensional BERT model has the problem of inefficiency, especially under the condition of limited memory space and computing power, the reasoning process is cumbersome and time-consuming.

Method used

By obtaining the coding sequence and polyphonic position of the target text, input it to the language model to obtain a high-dimensional representation vector, and input it into the disambiguation classifier model, combining the mask vector to determine the target pronunciation, the part-of-speech classifier model is used during the training process. Perform assisted training to improve model accuracy and reduce the steps of part-of-speech prediction to improve efficiency.

Benefits of technology

It improves the efficiency and accuracy of polyphonic disambiguation, reduces the time-consuming of the inference process, is suitable for application under conditions of limited memory space and computing power, and improves the performance of speech synthesis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150853A_ABST
    Figure CN119150853A_ABST
Patent Text Reader

Abstract

The invention discloses a polyphone disambiguation method and device, equipment and a storage medium, and the method comprises the steps: firstly determining a coding sequence corresponding to a target text and a target position of a target polyphone in the target text after obtaining the target text, and then inputting the coding sequence and the target position into a preset language model, and extracting the high-dimensional representation vector of the target polyphone by the language model, finally inputting the high-dimensional representation vector into the disambiguation classifier model, and outputting the target pronunciation of the target polyphone through the disambiguation classifier model and the mask vector. In the training process of the language model and the disambiguation classifier model, the part-of-speech classifier model is used for auxiliary training, the auxiliary information of the part-of-speech is added in the training process, the accuracy of the polyphone disambiguation model can be improved, meanwhile, the part-of-speech classifier model does not need to output the part-of-speech in the reasoning stage, time is saved, and the efficiency is improved. The efficiency of predicting the target pronunciation of the target polyphone is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of speech processing, and in particular to a method, apparatus, device and storage medium for disambiguating polyphones. Background Art

[0002] Polyphone disambiguation refers to the technology used to confirm the correct pronunciation of certain characters with multiple pronunciations in the text in the current context. Polyphone disambiguation is an important part of the front-end task of speech synthesis. At present, the language model trained based on the BERT model is usually used to perform polyphone disambiguation tasks. However, in some existing solutions, when the high-dimensional BERT model is used as the language model, the size of the language model is about 450M, and the part of speech of the polyphone needs to be predicted during the inference process, which is time-consuming and cumbersome. It is difficult to apply under the conditions of limited memory space and computing power.

[0003] In summary, the prior art uses a high-dimensional BERT model to train a language model, and the polyphone disambiguation task requires prediction of the part of speech during the reasoning process, but there is a problem of low efficiency in polyphone disambiguation. Summary of the invention

[0004] The embodiments of the present invention provide a method, apparatus, device and storage medium for disambiguating polyphones, which can improve the efficiency of disambiguating polyphones, and solve the problem of low efficiency in the prior art of disambiguating polyphones, which requires training a language model based on a high-dimensional BERT model and predicting the part of speech during the reasoning process.

[0005] In a first aspect, an embodiment of the present invention provides a method for disambiguating polyphones, comprising:

[0006] Obtaining a target text, determining a coding sequence corresponding to the target text and a target position of a target polyphone in the target text;

[0007] Input the encoding sequence and the target position into a preset language model to obtain a high-dimensional representation vector corresponding to the target polyphone;

[0008] Inputting the high-dimensional representation vector of the target polyphone into a preset disambiguation classifier model to obtain a first probability sequence corresponding to different pronunciations of the target polyphone and all polyphones;

[0009] Inputting the first probability sequence into the corresponding mask vector to obtain the target pronunciation of the target polyphonetic character;

[0010] Among them, during the training process of the language model and the disambiguation classifier model, the part-of-speech classifier model is used for auxiliary training. During the training process, the parameters of the part-of-speech classifier directly affect the parameters of the language model and indirectly affect the parameters of the disambiguation classifier model. The part-of-speech classifier model is used to output the part of speech of each character in the text after the text is input.

[0011] In a second aspect, an embodiment of the present invention provides a polyphonetic character disambiguation device, including:

[0012] A coding determination module, used to obtain a target text, determine a coding sequence corresponding to the target text and a target position of a target polyphone in the target text;

[0013] A high-dimensional vector acquisition module is used to input the coding sequence and the target position into a preset language model to obtain a high-dimensional representation vector corresponding to the target polyphone;

[0014] A probability determination module, used for inputting the high-dimensional representation vector of the target polyphone into a preset disambiguation classifier model to obtain a first probability sequence corresponding to different pronunciations of the target polyphone and all polyphones;

[0015] A pronunciation determination module, used for inputting the first probability sequence into a corresponding mask vector to obtain a target pronunciation of the target polyphone;

[0016] Among them, during the training process of the language model and the disambiguation classifier model, the part-of-speech classifier model is used for auxiliary training. During the training process, the parameters of the part-of-speech classifier directly affect the parameters of the language model and indirectly affect the parameters of the disambiguation classifier model. The part-of-speech classifier model is used to output the part of speech of each character in the text after the text is input.

[0017] In a third aspect, an embodiment of the present invention provides a polyphonetic character disambiguation device, the polyphonetic character disambiguation device comprising a processor and a memory;

[0018] The memory is used to store the computer program and transmit the computer program to the processor;

[0019] The processor is used to execute a polyphone disambiguation method according to the instructions in the computer program.

[0020] In a fourth aspect, an embodiment of the present invention provides a storage medium storing computer executable instructions, which, when executed by a computer processor, are used to perform a polyphone disambiguation method as in the first aspect.

[0021] As mentioned above, an embodiment of the present invention provides a method for disambiguating polyphones. After acquiring the target text, the embodiment of the present invention first determines the coding sequence corresponding to the target text and the target position of the target polyphone in the target text, and then inputs the coding sequence and the target position into a preset language model, extracts a high-dimensional representation vector of the target polyphone by the language model, and finally inputs the high-dimensional representation vector into the disambiguation classifier model, and outputs the target pronunciation of the target polyphone through the disambiguation classifier model and the mask vector. In the training process of the language model and the disambiguation classifier model, the present application uses a part-of-speech classifier model for auxiliary training. By adding auxiliary information of the part of speech during the training process, the accuracy of the polyphone disambiguation model can be improved. At the same time, in the reasoning stage, there is no need to output the part of speech through the part-of-speech classifier model, which saves the time consumed in predicting the part of speech and improves the efficiency of predicting the target pronunciation of the target polyphone. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A schematic flow chart of a polyphone disambiguation method provided in an embodiment of the present invention.

[0023] Figure 2 A schematic diagram of a framework for determining a target pronunciation of a target polyphone character provided by an embodiment of the present invention.

[0024] Figure 3 A schematic flow chart of another polyphone disambiguation method provided in an embodiment of the present invention.

[0025] Figure 4 Another schematic diagram of a framework for determining a target pronunciation of a target polyphone character provided by an embodiment of the present invention.

[0026] Figure 5 A schematic diagram of a flowchart for training a language model and a disambiguation classifier model provided in an embodiment of the present invention.

[0027] Figure 6 A schematic diagram of the structure of a polyphone disambiguation device provided in an embodiment of the present invention.

[0028] Figure 7 A schematic diagram of the structure of a polyphone disambiguation device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The following description and drawings fully disclose specific embodiments of the present application, enabling those skilled in the art to practice them. The embodiments only represent possible variations. Unless explicitly required, individual components and functions are optional, and the order of operations can vary. Parts and features of some embodiments can be included in or replace parts and features of other embodiments. The scope of the embodiments of the present application includes the entire scope of the claims and all available equivalents of the claims. Herein, each embodiment can be individually or collectively referred to by the term "invention" for convenience only, and if more than one invention is actually disclosed, it is not intended to automatically limit the scope of the application to any single invention or inventive concept. Herein, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method or device comprising a series of elements includes not only those elements but also other elements not expressly listed. Each embodiment herein is described in a progressive manner, with each embodiment highlighting the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the structures, products, etc. disclosed in the embodiments, since they correspond to the parts disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0030] Currently, disambiguation of polyphonic characters is an important part of the front-end task of speech synthesis. Taking the example of "The bottle fell over and the water poured out.", the character "倒" is a polyphonic character. The first "倒" is pronounced as dao3 (dao is the pinyin syllable, and 3 indicates the tone is the rising tone), meaning that something standing upright lies down; the second "倒" is pronounced as dao4, meaning to invert or tilt a container to make the contents come out. When the above example sentence is input into the polyphonic character disambiguation module of the speech synthesis task, the polyphonic character disambiguation module needs to determine the pronunciation of each character in the example sentence. If the character is not a polyphonic character, the pronunciation of the character can be determined by querying the dictionary. However, if the character is a polyphonic character, usually a more complex method is needed to confirm the pronunciation of the character, and the prediction result of the pronunciation will greatly affect the final speech synthesis result. For example, if the pronunciation of the first "倒" is predicted as dao4, the semantics of the entire example sentence will be incorrect.

[0031] With the development of deep neural networks, especially the introduction of language models such as BERT (Bidirectional Encoder Representations from Transformers) and their application in the field of speech synthesis, the task of disambiguating polyphones has become relatively mature. Among them, the language model (LM) occupies an important position in natural language processing. Its task is to predict the probability of a sentence appearing in a language. By using language models, on the open source test set CPP (Chinese Polyphones with Pinyin), the academic community has gradually increased the prediction accuracy of polyphone pronunciation from 97.31% to 99.08%, basically meeting the requirements for use.

[0032] However, in addition to pronunciation accuracy, the size of the pre-trained model and the system inference time are also important indicators for speech synthesis tasks. In the above scheme with an accuracy of 99.08%, a 768-dimensional BERT model was used, whose model size is about 450M, and the part of speech of polyphones needs to be predicted during the inference process. The process is cumbersome and time-consuming, resulting in low efficiency in polyphone disambiguation, and it is difficult to apply under the conditions of limited memory space and computing power.

[0033] In summary, in order to solve the problem of low efficiency of polyphone disambiguation in the prior art of training a language model based on a high-dimensional BERT model and requiring prediction of part of speech in the inference process, the embodiment of the present invention provides a polyphone disambiguation method. Figure 1 As shown, Figure 1 A flowchart of a polyphone disambiguation method provided in an embodiment of the present invention. The polyphone disambiguation method provided in an embodiment of the present invention can be executed by a polyphone disambiguation device, which can be implemented by software and / or hardware. The polyphone disambiguation device can be composed of two or more physical entities, or can be composed of one physical entity. For example, the polyphone disambiguation device can be a computer, a host computer, or a server. The method includes the following steps:

[0034] Step 101: Obtain a target text, determine a coding sequence corresponding to the target text and a target position of a target polyphone in the target text.

[0035] In this embodiment, it is first necessary to obtain the target text, where the target text is the text pre-specified by the user or currently selected by the user, and the method of obtaining the target text can be set according to actual needs. For example, the polyphone disambiguation device can obtain the target text from a pre-set storage path, or the polyphone disambiguation device can obtain the target text from the cloud through the server, or the polyphone disambiguation device can obtain the target text by communicating with other devices. Exemplarily, the content included in the target text can be the above-mentioned "The bottle fell over and the water poured out."

[0036] After obtaining the target text, the polyphone disambiguation device needs to further determine the coding sequence corresponding to the target text. Here, coding is the process of converting information from one form or format to another, also known as the code of a computer programming language. The polyphone disambiguation device can use a pre-specified method to encode characters, numbers or other objects into digital codes, or convert information and data into specified electrical pulse signals to obtain the coding. In one embodiment, the coding corresponding to each character in the target text can be determined by looking up a table. After determining the coding corresponding to each character, the coding is arranged according to the position where each character appears in the target text, and the coding sequence corresponding to the target text can be obtained.

[0037] After determining the coding sequence corresponding to the target text, it is also necessary to further determine the polyphones in the target text, that is, the target polyphones. Then, determine the target positions of the target polyphones in the target text. Exemplarily, for the target text "The bottle fell over and the water poured out.", the polyphone disambiguation device can pre-determine that the target polyphones in the target text are the four target polyphones "fell", "over", "poured", "out". Assuming that the position of the first character starts from 0, the positions of the target polyphones can be expressed as [2, 3, 7, 10].

[0038] Step 102: Input the coding sequence and the target positions into a pre-set language model to obtain a high-dimensional representation vector corresponding to the target polyphone.

[0039] After obtaining the coding corresponding to the target polyphone, the polyphone disambiguation device needs to further input the coding sequence and the target positions of the target polyphones into a pre-set language model, so that the language model determines the target coding corresponding to the target polyphone in the coding sequence according to the target positions, and extracts the high-dimensional representation vector corresponding to the target polyphone from the target coding. The pre-set language model refers to a pre-trained language model. For example, the language model can adopt the BERT model. By training the BERT model, a trained language model can be obtained. The high-dimensional representation vector refers to a vector with high dimensions. Due to the representation ability of the language model, the high-dimensional representation vector includes rich context features of the target polyphone.

[0040] Step 103: Input the high-dimensional representation vector of the target polyphonic character into a preset disambiguation classifier model to obtain a first probability sequence corresponding to different pronunciations of the target polyphonic character and all polyphonic characters.

[0041] After obtaining the high-dimensional representation vector of the target polyphonic character, the polyphonic character disambiguation device needs to further input the high-dimensional representation vector of the target polyphonic character into a preset disambiguation classifier model. After receiving the high-dimensional representation vector, the disambiguation classifier model will output a first probability sequence corresponding to different pronunciations of the target polyphonic character and all polyphonic characters, where the first probability sequence is a sequence including multiple probabilities.

[0042] Exemplarily, assume that there are 200 polyphonic characters in the polyphonic character list, and each polyphonic character usually has 2 to 3 different pronunciations (the pronunciations of different polyphonic characters may overlap. For example, "地" has pronunciations de and di4, and "的" has de, di2, di4, and di1, where de and di4 are overlapping pinyin). After counting the number of different pronunciations of all polyphonic characters, assume the number is 300. Then, the number of pronunciation categories predicted by the disambiguation classifier model is 300 in total. That is, after inputting the high-dimensional representation vector of the target polyphonic character into the preset disambiguation classifier model, the disambiguation classifier model will output the probabilities corresponding to 300 different pronunciations of the target polyphonic character, thereby obtaining the first probability sequence.

[0043] Step 104: Input the first probability sequence into a corresponding mask vector to obtain the target pronunciation of the target polyphonic character.

[0044] After obtaining the first probability sequence, the polyphonic character disambiguation device needs to further pass the first probability sequence through a corresponding mask vector. The mask vector is used to ignore the unspecified labels and focus on the clearly known labels provided by a specific dataset. That is, through the mask vector, the predicted pronunciation of each target polyphonic character can be restricted to the correct pronunciations of the target polyphonic character. Then, the correct pronunciation with the highest probability is determined as the target pronunciation of the target polyphonic character. Specifically, the values of the mask vector are composed of 0 and 1, and the dimension of the mask vector is the same as the dimension of the disambiguation classifier model. That is, when the dimension of the first probability sequence output by the disambiguation classifier model is 300, the mask vector also includes 300 values composed of 0 and 1. It can be understood that different target polyphonic characters correspond to different mask vectors. The value 1 in the mask vector corresponds to the probability of the correct pronunciation of the target polyphonic character in the first probability sequence, and the values corresponding to the probabilities of other pronunciations are all 0.

[0045] Among them, during the training process of the language model and the disambiguation classifier model, the part-of-speech classifier model is used for auxiliary training. During the training process, the parameters of the part-of-speech classifier directly affect the parameters of the language model and indirectly affect the parameters of the disambiguation classifier model. The part-of-speech classifier model is used to output the part of speech of each character in the text after the input text.

[0046] In addition, it should be further noted that in this embodiment, during the training process of the language model and the disambiguation classifier model, the part-of-speech classifier model is used for auxiliary training. The part-of-speech classifier model is used to output the part of speech of each character in the text after the input text. Among them, part of speech is a linguistic term, which is a grammatical classification of words in a language. It is the result of classifying words mainly based on grammatical features (including syntactic functions and morphological changes) and taking into account lexical meanings, and is used to represent the different components that each word plays in a sentence after word segmentation. Usually, the part of speech of each character in a word is represented by the part of speech of the word. Taking the sentence "Xiaoming runs happily on this vast land." as an example for illustration, the word segmentation result of this sentence is "Xiaoming runs happily on this vast land.", and the words are separated by spaces. Among them, the "de" in "happily" is a particle, pronounced as de; while the "di" in "land" is a noun, pronounced as di4. From this, it can be seen that the polyphonic character "di" has different pronunciations under different parts of speech. When "di" is used as a noun, it is pronounced as di4, and when it is used as a particle, it is pronounced as de. Before predicting the target pronunciation of the target polyphonic character, if the part of speech of the target polyphonic character can be considered, it is obvious that the accuracy of predicting the target pronunciation of the target polyphonic character can be improved.

[0047] Therefore, in this embodiment, during the training process of the language model and the disambiguation classifier model, the part-of-speech classifier model can be used for auxiliary training. During the training process, after the training set is input into the language model, the language model will output a high-dimensional feature vector, and the high-dimensional feature vector will be input into the disambiguation classifier model and the part-of-speech classifier model respectively. Then, after the output of the disambiguation classifier model passes through a corresponding mask vector, the predicted pronunciation can be obtained. The first loss is calculated by using the loss function for the predicted pronunciation and the pronunciation pre-labeled in the training set, and then the parameters of the disambiguation classifier model are updated by backpropagation according to the first loss. Since the input of the disambiguation classifier model is the output of the language model, the parameters of the language model can be further updated according to the parameters of the disambiguation classifier model. Similarly, for the part-of-speech classifier model, during the training process, after the high-dimensional feature vector is input into the part-of-speech classifier model, the part of speech output by the part-of-speech classifier model is obtained, and the second loss is calculated by using the loss function for the output part of speech and the part of speech pre-labeled in the training set. Then, the parameters of the part-of-speech classifier and the language model are updated by backpropagation according to the second loss.

[0048] It can be seen that the parameter update of the part-of-speech classifier model directly affects the parameter update of the language model, and the update of the language parameters directly affects the parameter update of the disambiguation classifier model, resulting in the parameter update of the part-of-speech classifier model indirectly affecting the parameter update of the disambiguation classifier model. During the training process, by using the part-of-speech classifier model to add auxiliary information of the part of speech during the training of the language model and the disambiguation classifier model, the performance of the polyphone disambiguation model can be improved. Specifically, Figure 2 As shown, Figure 2 The specific process of determining the target pronunciation of the target polyphone character according to the embodiment of the present invention is as follows: Figure 2 The process in the dashed box is only executed during training and does not need to be executed during the actual inference process.

[0049] As mentioned above, an embodiment of the present invention provides a method for disambiguating polyphones. After acquiring the target text, the embodiment of the present invention first determines the coding sequence corresponding to the target text and the target position of the target polyphone in the target text, and then inputs the coding sequence and the target position into a preset language model, extracts a high-dimensional representation vector of the target polyphone by the language model, and finally inputs the high-dimensional representation vector into the disambiguation classifier model, and outputs the target pronunciation of the target polyphone through the disambiguation classifier model and the mask vector. In the training process of the language model and the disambiguation classifier model, the present application uses a part-of-speech classifier model for auxiliary training. By adding auxiliary information of the part of speech during the training process, the accuracy of the polyphone disambiguation model can be improved. At the same time, in the reasoning stage, there is no need to output the part of speech through the part-of-speech classifier model, which saves the time consumed in predicting the part of speech and improves the efficiency of predicting the target pronunciation of the target polyphone.

[0050] like Figure 3 As shown, Figure 3 A flow chart of another polyphone disambiguation method provided in an embodiment of the present invention is provided. The polyphone disambiguation method provided in an embodiment of the present invention is a specific embodiment of the polyphone disambiguation method described above. The method includes:

[0051] Step 201: Obtain a target text, determine the code corresponding to each character in the target text, and construct a code sequence according to the code.

[0052] In this embodiment, after obtaining the target text, the code corresponding to each character in the target text is first determined, where a character refers to a glyph unit or symbol, including letters, numbers, operation symbols, punctuation marks and other symbols. Then, according to the order in which each character appears in the target text, a code sequence corresponding to the target text is constructed, that is, the order in which the code corresponding to each character appears in the code sequence is consistent with the order in which each character appears in the target text.

[0053] Based on the above embodiments, determining the encoding corresponding to each character in the target text in step 201 includes:

[0054] Step 2011: Determine the encoding corresponding to each character in the target text from a preset dictionary, where the dictionary corresponds to a language model.

[0055] In one embodiment, when determining the encoding corresponding to each character in the target text, the encoding corresponding to each character in the target text can be looked up from a preset dictionary, where the dictionary is a reference book that收录 has the encoding corresponding to each character, and the dictionary is provided by a language model, for example, it can be provided by a BERT model. In this embodiment, taking the target text "The bottle fell over and the water poured out." as an example for illustration, the text length is 12. After querying the preset dictionary, the obtained encoding sequence is represented in vector form as [1878, 85, 1099, 15, 4, 101, 113, 1099, 39, 61, 15, 12043], where "1878" corresponds to the character "瓶".

[0056] Step 202: Determine the target polyphonic characters in the target text and determine the target positions of the target polyphonic characters in the target text.

[0057] After obtaining the encoding sequence, it is necessary to further determine the target polyphonic characters in the target text. Exemplarily, the target polyphonic characters in the target text can be determined one by one through a pre-organized list of polyphonic characters, and then the target positions of the target polyphonic characters in the target text are determined. For example, in the target text, there are two polyphonic characters, "倒" and "了", and both appear twice. Assuming that the position of the first character starts from 0, the target positions of the target polyphonic characters in the target text can be represented in vector form as [2, 3, 7, 10].

[0058] Step 203: Input the encoding sequence and the target positions into a preset language model to obtain a high-dimensional representation vector corresponding to the target polyphonic characters.

[0059] After determining the target positions of the target polyphonic characters in the target text, the encoding sequence and the target positions can be input into a preset language model to obtain a high-dimensional representation vector corresponding to the target polyphonic characters. Assuming that the representation dimension of the language model is 312 dimensions, the dimension of the encoding sequence is extended to 12 * 312, where 12 is the length of the encoding sequence (corresponding to 12 characters, including Chinese characters and punctuation marks), and each element in the encoding sequence is represented by a 312-dimensional vector. Then, according to the position vector [2, 3, 7, 10], the high-dimensional representation vector corresponding to the target polyphonic characters is extracted, that is, the vectors with indices 2, 3, 7, and 10 are extracted from the first dimension of the 12 * 312 vector to obtain a 4 * 312 vector, and this vector is the high-dimensional representation vector corresponding to the target polyphonic characters.

[0060] Step 204: Input the high-dimensional representation vector of the target polyphonic character into a preset disambiguation classifier model to obtain a first probability sequence corresponding to different pronunciations of the target polyphonic character and all polyphonic characters.

[0061] After the language model outputs the high-dimensional representation vector of the target polyphonic character, the polyphonic character disambiguation device can further input the high-dimensional representation vector into the disambiguation classifier model, so that the disambiguation classifier model outputs a first probability sequence corresponding to different pronunciations of the target polyphonic character and all polyphonic characters. Exemplarily, assume that the disambiguation classifier model predicts 300 classes of pronunciations, each class corresponding to a pinyin. Assume that the first 4 dimensions correspond to the four pinyins dao3, dao4, le3, and liao3 respectively. Taking the first "倒" character in the input text as an example, after the high-dimensional representation vector of the "倒" character passes through the disambiguation classifier model, a 300-dimensional first probability sequence (the sum of probabilities is 1) is obtained. Assume that the first probability sequence is [0.192, 0.082, 0.205,..., 0.03], where 0.205 is the largest value in this vector. Usually, the prediction result of the disambiguation classifier model takes the class corresponding to the largest value in the vector. Since 0.205 is the largest, the second dimension corresponding to this value (counting from the 0th dimension) is selected as the prediction result. And the second dimension exactly corresponds to the pinyin le3. So the disambiguation classifier model predicts the pronunciation of the "倒" character as le3.

[0062] Step 205: Input the first probability sequence into a mask vector, so that the mask vector filters out the first probability corresponding to the pronunciation of the target polyphonic character from the first probability sequence, and takes the pronunciation corresponding to the largest first probability as the target pronunciation of the target polyphonic character;

[0063] Among them, during the training process of the language model and the disambiguation classifier model, a part-of-speech classifier model is used for auxiliary training. During the training process, the parameters of the part-of-speech classifier directly affect the parameters of the language model and indirectly affect the parameters of the disambiguation classifier model. The part-of-speech classifier model is used to output the part of speech of each character in the input text after the input text.

[0064] In the above embodiments, since the disambiguation classifier model predicts that the pronunciation of the character "倒" is le3, which does not belong to one of the correct pronunciations of the character "倒" itself, in this embodiment, it is necessary to further pass the first probability sequence output by the disambiguation classifier model through a corresponding mask vector to ensure that the predicted target pronunciation is restricted within the correct pronunciations of the polyphonic character. Taking the character "倒" as an example, the correct pronunciations of this character include dao3 and dao4. Assuming that these two pinyins are in the first two dimensions of the pronunciation category, the corresponding mask vector of the character "倒" is [1, 1, 0, ……, 0]. The values of the first two dimensions of this mask vector are 1, and the values of the other dimensions are 0. Then multiply this mask vector by the first probability sequence [0.192, 0.082, 0.205, ……, 0.03] output by the disambiguation classifier model to obtain [0.192, 0.082, 0, ……, 0]. At this time, the maximum value is 0.192, which is in the 0th dimension, and the corresponding pinyin is dao3. Then the predicted target pronunciation of the character "倒" is dao3. The processing process of the remaining other target polyphonic characters in the target text is similar. Just pass the first probability sequence of other target polyphonic characters through the mask vector corresponding to other target polyphonic characters, and this will not be elaborated in this embodiment. The specific process of predicting the target pronunciation of the target polyphonic characters in this embodiment is as Figure 4 shown.

[0065] As described above, the embodiments of the present invention provide a method for disambiguating polyphonic characters. After obtaining the target text, the embodiments of the present invention first determine the encoding sequence corresponding to the target text and the target position of the target polyphonic character in the target text, and then input the encoding sequence and the target position into a preset language model. The language model extracts the high-dimensional feature vector of the target polyphonic character, and finally inputs the high-dimensional feature vector into the disambiguation classifier model. The disambiguation classifier model outputs the first probability sequence corresponding to the different pronunciations of the target polyphonic character and all polyphonic characters. Finally, the first probability sequence is passed through the mask vector corresponding to the target polyphonic character, so as to restrict the predicted target pronunciation within the correct pronunciations of the polyphonic character. In the training process of the language model and the disambiguation classifier model in the embodiments of the present invention, a part-of-speech classifier model is used for auxiliary training. By adding auxiliary information of the part-of-speech during the training process, the accuracy of the polyphonic character disambiguation model in predicting the target pronunciation of the target polyphonic character can be improved. At the same time, in the inference stage, it is not necessary to pass through the part-of-speech classifier model to output the part-of-speech, saving the time consumed for predicting the part-of-speech and improving the efficiency of predicting the target pronunciation of the target polyphonic character.

[0066] As Figure 5 shown, Figure 5 is a schematic flow chart for training the above language model and disambiguation classifier model provided by the embodiments of the present invention. The training process of the language model and the disambiguation classifier model includes:

[0067] Step 301: Obtain training text, determine the training coding sequence corresponding to the training text and the position of the training polyphone in the training text.

[0068] In the present embodiment, in the process of training the language model and the disambiguation classifier model, it is first necessary to obtain the training text, and the training text refers to the text used to train the language model and the disambiguation classifier model. In the present embodiment, the method for obtaining the training text can be set according to actual needs. For example, the user can obtain the training text in the cloud, or the user can input the training text by himself. After obtaining the training text, it is necessary to further determine the training coding sequence corresponding to the training text. The training coding sequence is the coding sequence corresponding to each character in the training text. It can be understood that the training coding sequence can also be obtained by querying the dictionary. At the same time, it is also necessary to determine the position of the training polyphone in the training text, wherein the training polyphone refers to the polyphone in the training text.

[0069] Step 302: Mark the first pronunciation and the first part of speech corresponding to the training polyphonetic character on the training coding sequence.

[0070] After converting the training text into a training coding sequence, it is necessary to further mark the first pronunciation and the first part of speech corresponding to each training polyphone in the training text on the training coding sequence, wherein the first pronunciation is the correct pronunciation of the training polyphone, and the first part of speech is the correct part of speech of the training polyphone.

[0071] Step 303: Perform multiple rounds of training on the language model and the disambiguation classifier model according to the training coding sequence.

[0072] After the training coding sequence is marked, the training coding sequence can be used to perform multiple rounds of training on the language model and the disambiguation classifier model, and in each round of training, the parameters of the language model and the disambiguation classifier model are updated until the output error of the disambiguation classifier model is within a preset range.

[0073] During each round of training, the language model and disambiguation classifier model undergo the following parameter processing:

[0074] Step 3031: input a preset number of training coding sequences and the positions of training polyphones into the language model to obtain training high-dimensional representation vectors corresponding to the training polyphones.

[0075] Specifically, in each round of training, the embodiment of the present invention first needs to input a preset number of training coding sequences and the positions of training polyphones in the training coding sequences into the language model, so that the language model outputs a training high-dimensional representation vector corresponding to the training polyphones in the training coding sequence. The process of the language model outputting the training high-dimensional representation vector is similar to the process of the language model outputting the high-dimensional representation vector, which will not be described in detail in this embodiment. In addition, the preset number can be set according to actual needs, and the specific value of the preset number is not limited in this embodiment.

[0076] Step 3032: input the training high-dimensional representation vector into the disambiguation classifier model to obtain a second probability sequence corresponding to the different pronunciations of the training polyphone and all polyphones, input the second probability sequence into the corresponding mask vector to obtain the predicted pronunciation of the training polyphone.

[0077] After obtaining the training high-dimensional representation vector output by the language model, the training high-dimensional representation vector needs to be input into the disambiguation classifier model, and the disambiguation classifier model outputs a second probability sequence corresponding to the different pronunciations of the training polyphones and all polyphones. The second probability sequence is then further input into the corresponding mask vector to obtain the predicted pronunciation of the training polyphones.

[0078] Step 3033: input the training high-dimensional representation vector into the part-of-speech classifier model to obtain the predicted part-of-speech of the training polyphone.

[0079] When the training high-dimensional representation vector is input into the disambiguation classifier model, the training high-dimensional representation vector needs to be input into the part-of-speech classifier model, and the part-of-speech classifier model is used to output the predicted part-of-speech of the training polyphone. Specifically, the part-of-speech classifier model can be constructed using a neural network, such as an LSTM (Long Short Term Memory), a BP (back propagation) neural network, or a CNN (Convolutional Neural Network), etc. The specific process can refer to the prior art and will not be repeated in this embodiment.

[0080] Step 3034: When it is confirmed that the output of the disambiguation classifier model does not meet the preset end condition, it is confirmed that the next round of training is required, and the language model, disambiguation classifier model and part-of-speech classifier model are updated according to the first pronunciation, the first part of speech, the predicted pronunciation and the predicted part of speech.

[0081] During each round of training, it is necessary to determine whether the output of the disambiguation classifier model meets the preset end condition, where the preset end condition refers to the pre-set condition for ending training. Exemplarily, the user can pre-set the end condition to the loss between the output and input of the disambiguation classifier model to be within a specified range. If the output of the disambiguation classifier model does not meet the preset end condition after each round of training, it is determined that the next round of training is required, and the parameters of the language model, the parameters of the disambiguation classifier model, and the parameters of the part-of-speech classifier model are updated according to the first pronunciation, the first part of speech, the predicted pronunciation, and the predicted part of speech.

[0082] Based on the above embodiment, in step 3034, the language model, the disambiguation classifier model and the part-of-speech classifier model are updated according to the first pronunciation, the first part-of-speech, the predicted pronunciation and the predicted part-of-speech, including:

[0083] First, the first loss of the disambiguation classifier model is calculated based on the first utterance and the predicted utterance.

[0084] In this embodiment, when updating the parameters of the disambiguation classifier model, it is first necessary to calculate the first loss of the disambiguation classifier model according to the first pronunciation and the predicted pronunciation, wherein the first loss refers to the internal loss of the disambiguation classifier model. In one embodiment, assuming that the training encoding sequence is x, the first parameter of the language model is W1, the second parameter of the disambiguation classifier model is W2, the mask vector is m, and the predicted pronunciation is o p , the first pronunciation is o t , then the first parameter W1 of the disambiguation classifier model is updated as follows:

[0085] The training high-dimensional representation vector y1 output by the language model can be expressed as y1=f1(x,W1), which is obtained by operating the input training coding sequence x and the parameter W1 of the language model, and the operation is recorded as f1.

[0086] Calculate the output after the disambiguation classifier model and mask vector, that is, the predicted pronunciation of the polyphone is o p , which can be expressed as o p =f2(y1,W2,m), which is obtained by calculating y1, disambiguation classifier parameter W2 and mask vector m, and the operation is recorded as f2.

[0087] Through the first loss function f loss1 Calculate the first loss e, which can be expressed as e = f loss1 (o p ,o t ), predicted by the pronunciation o p and the first pronunciation o t After the first loss function, o p =f2(y1,W2,m)Substitute into e=floss1 (o p ,o t ) to obtain e = f loss1 (f2(y1,W2,m),o t ).

[0088] Then, the second parameters of the disambiguation classifier model are updated by backpropagation based on the first loss.

[0089] After calculating the first loss, the second parameter of the disambiguation classifier model can be updated by back propagation. Back propagation, referred to as BP algorithm, is a learning algorithm suitable for multi-layer neural networks. It is based on the gradient descent method. The input-output relationship of the BP network is essentially a mapping relationship: the function of a BP neural network with n inputs and m outputs is a continuous mapping from n-dimensional Euclidean space to a finite field in m-dimensional Euclidean space. This mapping is highly nonlinear.

[0090] Exemplarily, the specific process of updating the second parameter of the disambiguation classifier model is as follows:

[0091] The updated second parameter is W2', which can be expressed as Where η is the learning rate, which can be set as a constant. It represents the partial derivative of the first loss e with respect to W2. Through this operation, the second parameter W2' of the updated disambiguation classifier model can be obtained.

[0092] At the same time, a second loss of the part-of-speech classifier model is determined based on the first part-of-speech and the predicted part-of-speech.

[0093] Similarly, when updating the parameters of the part-of-speech classifier model, it is first necessary to calculate the second loss of the part-of-speech classifier model based on the first part-of-speech and the predicted part-of-speech, where the second loss refers to the internal loss of the part-of-speech classifier model. For example, it is still assumed that the training encoding sequence is x, the parameter of the language model is W1, the third parameter of the part-of-speech classifier model is W3, and the predicted part-of-speech is o s , the first part of speech is o l , then the update steps of the third parameter of the part-of-speech classifier model are as follows:

[0094] The output y1 of the language model can be expressed as y1=f1(x,W1), which is obtained by operating the input training coding sequence x and the parameter W1 of the language model, and the operation is recorded as f1.

[0095] Calculate the output of the part-of-speech classifier model, i.e., predict the part of speech o s , which can be expressed as o s =f3(y1,W3), which is obtained by calculating y1 and the part-of-speech classifier model parameter W3, and the calculation is recorded as f3.

[0096] Through the second loss function f loss2 Calculate the second loss d, which can be expressed as d = f loss2 (o s ,o l ), by predicting the part of speech s and the first part of speech o l After the second loss function, o s =f3(y1,W3)Substitute d into d=f loss2 (o s ,o l ) to obtain d = f loss2 (f3(y1,W3),o l ).

[0097] Furthermore, the third parameter of the part-of-speech classifier model is updated by back-propagation according to the second loss.

[0098] After calculating the second loss, we can back propagate and update the third parameter of the part-of-speech classifier model. Specifically, the updated third parameter is W3', which can be expressed as Where η is the learning rate, which can be set as a constant. It represents the partial derivative of loss d with respect to W3. Through this operation, the third parameter W3′ after the disambiguation classifier model is updated can be obtained.

[0099] Finally, the first parameter of the language model is updated according to the first loss and the second loss.

[0100] After the first parameter of the disambiguation classifier model and the third parameter of the part-of-speech classifier model are updated, the first parameter of the language model can be further updated according to the first loss and the second loss. In one embodiment, the first parameter of the language model can be partially derived using the first loss and the second loss in sequence, and the first parameter of the language model can be updated according to the result of the partial derivative.

[0101] On the basis of the above embodiment, updating the first parameter of the language model according to the first loss and the second loss includes:

[0102] First, a first processing result after partial derivative of the first loss with respect to the first parameter is determined.

[0103] In this embodiment, when the first parameter of the language model is updated, the first processing result after the partial derivative of the first loss with respect to the first parameter is calculated, wherein the partial derivative refers to the calculation of the partial derivative. In mathematics, the partial derivative of a function of multiple variables is its derivative with respect to one variable while keeping the other variables constant. In this embodiment, the first processing result after the partial derivative is recorded as

[0104] Then, a second processing result after taking the partial derivative of the second loss with respect to the first parameter is determined.

[0105] Similarly, the second processing result after calculating the partial derivative of the second loss with respect to the first parameter is recorded as

[0106] Finally, the first parameter of the language model is updated according to the first parameter, the first processing result and the second processing result.

[0107] Afterwards, the first parameter of the language model can be updated according to the first parameter, the first processing result and the second processing result. Exemplarily, when updating the first parameter, the first processing result and the second processing result can be summed, and then the product of the summation result and the preset learning rate can be subtracted from the first parameter to obtain the updated first parameter.

[0108] On the basis of the above embodiment, the first parameter of the language model is updated according to the first parameter, the first processing result and the second processing result, including:

[0109] First, the first processing result and the second processing result are summed to obtain a sum result.

[0110] In one embodiment, when the first parameter is updated, the first processing result and the second processing result are first calculated to obtain a sum result.

[0111] Then, the product of the summation result and the preset learning rate is subtracted from the first parameter to obtain an updated first parameter.

[0112] After obtaining the summation result, the first parameter can be further subtracted from the product of the summation result and the preset learning rate to obtain an updated first parameter, where the learning rate represents the speed of information accumulation in the neural network over time. The learning rate is one of the hyperparameters that most affects the performance of the neural network. In this embodiment, the preset learning rate can be set to a constant.

[0113] Exemplarily, when the first loss is used to update the first parameter, the updated first parameter is recorded as W1', which can be expressed as:

[0114]

[0115] in It means that the partial derivative of the first loss e with respect to the first parameter W1 is obtained. Through this operation, the first parameter W1' of the updated language model can be obtained.

[0116] When the second loss is used to update the first parameter, the updated first parameter is recorded as W1', which can be expressed as:

[0117]

[0118] in It means that the partial derivative of the second loss d with respect to W1 is obtained. Through this operation, the first parameter W1' of the updated language model can be obtained.

[0119] It should be noted that for the sake of convenience, the steps of updating the parameters of the disambiguation classifier model, the part-of-speech classifier model and the language model are described separately, but in actual situations, the updates are performed synchronously, that is, the second parameter of the multi-disambiguation classifier model and the third parameter of the part-of-speech classifier model will simultaneously affect the update of the first parameter of the language model, which can be expressed as As described above, through multiple rounds of training and parameter iteration, a trained language model, a trained disambiguation classifier model, and a trained part-of-speech classifier model are finally obtained.

[0120] During the verification process, a 312-dimensional BERT model was selected as the language model. The size of the language model and the disambiguation classifier model was about 70M in total. The accuracy of polyphone disambiguation on the own test set can reach 98.27%. If the part-of-speech classifier model is not used for auxiliary training, the accuracy of polyphone disambiguation is 98.08%, which is 0.19% lower than before. It shows that the auxiliary training of the part-of-speech classifier model can improve the accuracy of the polyphone disambiguation model. In addition, the embodiment of the present invention does not need to make part-of-speech predictions during actual application, which saves the time-consuming polyphone disambiguation.

[0121] As mentioned above, in the process of training the language model and the disambiguation classifier model, the embodiment of the present invention uses the part-of-speech classifier model as an auxiliary training model. The part-of-speech classifier model only participates in the training and does not need to be used in the actual reasoning process. Since the update of the parameters of the language model and the disambiguation classifier model will be directly and indirectly affected by the part-of-speech classifier model during the training process, it is ensured that the training process of the disambiguation classifier model utilizes the part-of-speech features. That is, the update of the parameters of the disambiguation classifier model directly affects the update of the parameters of the language model, and the update of the language model parameters directly affects the update of the parameters of the disambiguation classifier model, resulting in the update of the parameters of the part-of-speech classifier model indirectly affecting the update of the parameters of the disambiguation classifier model. By adding auxiliary information of the part of speech during the training process, the performance of polyphone disambiguation can be improved. At the same time, in the reasoning stage, there is no need to go through the part-of-speech classifier, which saves the time consumed by the part-of-speech prediction. In summary, the embodiment of the present invention can occupy less memory, consume less time for reasoning, and be more efficient while ensuring a high accuracy rate. It is suitable for application under conditions of limited memory space and computing power, and has strong applicability.

[0122] like Figure 6 As shown, Figure 6 A schematic diagram of the structure of a polyphone disambiguation device provided in an embodiment of the present invention. The polyphone disambiguation device provided in an embodiment of the present invention includes:

[0123] The coding determination module 401 is used to obtain a target text, determine a coding sequence corresponding to the target text and a target position of a target polyphone in the target text.

[0124] The high-dimensional vector acquisition module 402 is used to input the coding sequence and the target position into a preset language model to obtain a high-dimensional representation vector corresponding to the target polyphone.

[0125] The probability determination module 403 is used to input the high-dimensional representation vector of the target polyphone into a preset disambiguation classifier model to obtain a first probability sequence corresponding to different pronunciations of the target polyphone and all polyphones.

[0126] The pronunciation determination module 404 is used to input the first probability sequence into the corresponding mask vector to obtain the target pronunciation of the target polyphone.

[0127] Among them, during the training process of the language model and the disambiguation classifier model, the part-of-speech classifier model is used for auxiliary training. During the training process, the parameters of the part-of-speech classifier directly affect the parameters of the language model and indirectly affect the parameters of the disambiguation classifier model. The part-of-speech classifier model is used to output the part of speech of each character in the text after the text is input.

[0128] Based on the above embodiment, the encoding determination module 401 includes:

[0129] The sequence construction submodule is used to determine the encoding corresponding to each character in the target text and construct the encoding sequence according to the encoding.

[0130] The position determination submodule is used to determine the target polyphone in the target text and determine the target position of the target polyphone in the target text.

[0131] On the basis of the above embodiment, the position determination submodule is specifically used to determine the code corresponding to each character in the target text from a preset dictionary, and the dictionary corresponds to the language model.

[0132] Based on the above embodiment, the pronunciation determination module 404 is specifically used to input the first probability sequence into the mask vector so that the mask vector filters out the first probability corresponding to the pronunciation of the target polyphone from the first probability sequence, and uses the pronunciation corresponding to the first probability with the largest value as the target pronunciation of the target polyphone.

[0133] Based on the above embodiment, it also includes:

[0134] The training text acquisition module is used to acquire the training text, determine the training coding sequence corresponding to the training text and the position of the training polyphone in the training text.

[0135] The marking module is used to mark the first pronunciation and the first part of speech corresponding to the training polyphone on the training coding sequence.

[0136] The training module is used to perform multiple rounds of training on the language model and the disambiguation classifier model according to the training encoding sequence.

[0137] The training modules include:

[0138] The first input submodule is used to input a preset number of training coding sequences and the positions of training polyphones into the language model to obtain a training high-dimensional representation vector corresponding to the training polyphones.

[0139] The second input submodule is used to input the training high-dimensional representation vector into the disambiguation classifier model to obtain a second probability sequence corresponding to the different pronunciations of the training polyphone and all polyphones, and input the second probability sequence into the corresponding mask vector to obtain the predicted pronunciation of the training polyphone.

[0140] The third input submodule is used to input the training high-dimensional representation vector into the part-of-speech classifier model to obtain the predicted part-of-speech of the training polyphone.

[0141] The parameter updating submodule is used to confirm that when the output of the disambiguation classifier model does not meet the preset end condition, it is necessary to confirm that the next round of training is required, and update the language model, the disambiguation classifier model and the part-of-speech classifier model according to the first pronunciation, the first part of speech, the predicted pronunciation and the predicted part of speech.

[0142] Based on the above embodiment, the parameter updating submodule includes:

[0143] The first loss calculation unit is used to calculate the first loss of the disambiguation classifier model according to the first pronunciation and the predicted pronunciation.

[0144] The second parameter updating unit is used to update the second parameter of the disambiguation classifier model according to the first loss back propagation.

[0145] The second loss calculation unit is used to determine a second loss of the part-of-speech classifier model according to the first part-of-speech and the predicted part-of-speech.

[0146] The third parameter updating unit is used to update the third parameter of the part-of-speech classifier model according to the second loss back propagation.

[0147] A first parameter updating unit is used to update a first parameter of the language model according to the first loss and the second loss.

[0148] Based on the above embodiment, the first parameter updating unit includes:

[0149] The first processing subunit is used to determine a first processing result after taking a partial derivative of the first loss with respect to the first parameter.

[0150] The second processing subunit is used to determine a second processing result after taking the partial derivative of the second loss with respect to the first parameter.

[0151] The parameter updating subunit is used to update the first parameter of the language model according to the first parameter, the first processing result and the second processing result.

[0152] Based on the above embodiment, the parameter updating subunit is specifically used for:

[0153] The first processing result and the second processing result are summed to obtain a sum result.

[0154] The product of the summation result and the preset learning rate is subtracted from the first parameter to obtain an updated first parameter.

[0155] The polyphone disambiguation apparatus provided in the embodiment of the present invention is included in the polyphone disambiguation device and can be used to execute the polyphone disambiguation method provided in the above embodiment, and has corresponding functions and beneficial effects.

[0156] It is worth noting that in the embodiment of the above-mentioned polyphone disambiguation device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the various functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0157] This embodiment also provides a polyphone disambiguation device, such as Figure 7 As shown, the polyphone disambiguation device 50 includes a processor 500 and a memory 501;

[0158] The memory 501 is used to store the computer program 502 and transmit the computer program 502 to the processor 500;

[0159] The processor 500 is used to execute the steps in the above-mentioned embodiment of the method for disambiguating polyphones according to the instructions in the computer program 502.

[0160] Exemplarily, the computer program 502 may be divided into one or more modules / units, one or more modules / units are stored in the memory 501, and are executed by the processor 500 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 502 in the polyphonetic character disambiguation device 50.

[0161] The polyphone disambiguation device 50 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The polyphone disambiguation device 50 may include, but is not limited to, a processor 500 and a memory 501. Those skilled in the art will appreciate that Figure 7 It is only an example of the polyphonetic character disambiguation device 50 and does not constitute a limitation of the polyphonetic character disambiguation device 50. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the polyphonetic character disambiguation device 50 may also include input and output devices, network access devices, buses, etc.

[0162] The processor 500 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0163] The memory 501 may be an internal storage unit of the polyphonetic character disambiguation device 50, such as a hard disk or memory of the polyphonetic character disambiguation device 50. The memory 501 may also be an external storage device of the polyphonetic character disambiguation device 50, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the polyphonetic character disambiguation device 50. Further, the memory 501 may also include both an internal storage unit and an external storage device of the polyphonetic character disambiguation device 50. The memory 501 is used to store computer programs and other programs and data required by the polyphonetic character disambiguation device 50. The memory 501 may also be used to temporarily store data that has been output or is to be output.

[0164] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0165] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0166] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0167] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0168] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store computer programs.

[0169] The embodiment of the present invention further provides a storage medium containing computer executable instructions. When the computer executable instructions are executed by a computer processor, they are used to perform a polyphone disambiguation method. The method includes the following steps:

[0170] Obtaining a target text, determining a coding sequence corresponding to the target text and a target position of a target polyphone in the target text;

[0171] Input the encoding sequence and the target position into a preset language model to obtain a high-dimensional representation vector corresponding to the target polyphone;

[0172] Inputting the high-dimensional representation vector of the target polyphone into a preset disambiguation classifier model to obtain a first probability sequence corresponding to different pronunciations of the target polyphone and all polyphones;

[0173] Inputting the first probability sequence into the corresponding mask vector to obtain the target pronunciation of the target polyphonetic character;

[0174] Among them, during the training process of the language model and the disambiguation classifier model, the part-of-speech classifier model is used for auxiliary training. During the training process, the parameters of the part-of-speech classifier directly affect the parameters of the language model and indirectly affect the parameters of the disambiguation classifier model. The part-of-speech classifier model is used to output the part of speech of each character in the text after the text is input.

[0175] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the embodiments of the present invention are not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the embodiments of the present invention. Therefore, although the embodiments of the present invention are described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the embodiments of the present invention, and the scope of the embodiments of the present invention is determined by the scope of the appended claims.

Claims

1. A method for disambiguating polyphones, characterized in that: include: Acquire a target text, determine a coding sequence corresponding to the target text and a target position of a target polyphone in the target text; Inputting the encoding sequence and the target position into a preset language model to obtain a high-dimensional representation vector corresponding to the target polyphone; Inputting the high-dimensional representation vector of the target polyphone into a preset disambiguation classifier model to obtain a first probability sequence corresponding to different pronunciations of the target polyphone and all polyphones; Inputting the first probability sequence into a corresponding mask vector to obtain a target pronunciation of the target polyphonetic character; During the training process, the language model and the disambiguation classifier model use a part-of-speech classifier model for auxiliary training. During the training process, the parameters of the part-of-speech classifier directly affect the parameters of the language model and indirectly affect the parameters of the disambiguation classifier model. The part-of-speech classifier model is used to output the part of speech of each character in the text after the text is input.

2. A polyphone disambiguation method according to claim 1, characterized in that: The step of determining a coding sequence corresponding to the target text and a target position of a target polyphone in the target text comprises: Determine a code corresponding to each character in the target text, and construct a code sequence according to the code; A target polyphone in the target text is determined, and a target position of the target polyphone in the target text is determined.

3. A polyphone disambiguation method according to claim 2, characterized in that: The determining of the code corresponding to each character in the target text includes: The encoding corresponding to each character in the target text is determined from a preset dictionary, wherein the dictionary corresponds to the language model.

4. A polyphone disambiguation method according to claim 1, characterized in that: The step of inputting the first probability sequence into a mask vector to obtain a target pronunciation of the target polyphonetic character comprises: The first probability sequence is input into a mask vector so that the mask vector selects a first probability corresponding to the pronunciation of the target polyphone from the first probability sequence, and uses the pronunciation corresponding to the first probability with the largest value as the target pronunciation of the target polyphone.

5. A polyphone disambiguation method according to claim 1, characterized in that: The training process of the language model and the disambiguation classifier model includes: Acquire a training text, determine a training coding sequence corresponding to the training text and a position of a training polyphone in the training text; Marking a first pronunciation and a first part of speech corresponding to the training polyphonetic character on the training coding sequence; Performing multiple rounds of training on the language model and the disambiguation classifier model according to the training coding sequence; During each round of training, the language model and the disambiguation classifier model undergo the following parameter processing: Inputting a preset number of training coding sequences and the positions of the training polyphones into the language model to obtain a training high-dimensional representation vector corresponding to the training polyphones; Inputting the training high-dimensional representation vector into the disambiguation classifier model to obtain a second probability sequence corresponding to different pronunciations of the training polyphone and all polyphones, and inputting the second probability sequence into a corresponding mask vector to obtain a predicted pronunciation of the training polyphone; Inputting the training high-dimensional representation vector into the part-of-speech classifier model to obtain the predicted part-of-speech of the training polyphone; When it is confirmed that the output of the disambiguation classifier model does not meet the preset end condition, it is confirmed that the next round of training is required, and the language model, the disambiguation classifier model and the part-of-speech classifier model are updated according to the first pronunciation, the first part of speech, the predicted pronunciation and the predicted part of speech.

6. A polyphone disambiguation method according to claim 5, characterized in that: The updating of the language model, the disambiguation classifier model and the part-of-speech classifier model according to the first pronunciation, the first part-of-speech, the predicted pronunciation and the predicted part-of-speech comprises: Calculating a first loss of the disambiguation classifier model based on the first pronunciation and the predicted pronunciation; Back-propagation updates a second parameter of the disambiguation classifier model according to the first loss; Determining a second loss of the part-of-speech classifier model based on the first part-of-speech and the predicted part-of-speech; Back-propagating the second loss to update a third parameter of the part-of-speech classifier model; A first parameter of the language model is updated according to the first loss and the second loss.

7. A polyphone disambiguation method according to claim 6, characterized in that: The updating of the first parameter of the language model according to the first loss and the second loss includes: Determine a first processing result after taking a partial derivative of the first loss with respect to the first parameter; Determine a second processing result after taking a partial derivative of the second loss with respect to the first parameter; The first parameter of the language model is updated according to the first parameter, the first processing result and the second processing result.

8. A polyphone disambiguation method according to claim 7, characterized in that: The updating of the first parameter of the language model according to the first parameter, the first processing result and the second processing result includes: Sum the first processing result and the second processing result to obtain a summation result; The product of the summation result and a preset learning rate is subtracted from the first parameter to obtain an updated first parameter.

9. A polyphonetic character disambiguation device, characterized in that: include: A coding determination module, used to obtain a target text, determine a coding sequence corresponding to the target text and a target position of a target polyphone in the target text; A high-dimensional vector acquisition module, used for inputting the coding sequence and the target position into a preset language model to obtain a high-dimensional representation vector corresponding to the target polyphone; A probability determination module, used for inputting the high-dimensional representation vector of the target polyphone into a preset disambiguation classifier model to obtain a first probability sequence corresponding to different pronunciations of the target polyphone and all polyphones; A pronunciation determination module, used for inputting the first probability sequence into a corresponding mask vector to obtain a target pronunciation of the target polyphonetic character; During the training process, the language model and the disambiguation classifier model use a part-of-speech classifier model for auxiliary training. During the training process, the parameters of the part-of-speech classifier directly affect the parameters of the language model and indirectly affect the parameters of the disambiguation classifier model. The part-of-speech classifier model is used to output the part of speech of each character in the text after the text is input.

10. A polyphone disambiguation device, characterized in that: The polyphone disambiguation device comprises a processor and a memory; The memory is used to store a computer program and transmit the computer program to the processor; The processor is used to execute a polyphone disambiguation method according to any one of claims 1 to 8 according to the instructions in the computer program.

11. A storage medium storing computer executable instructions, characterized in that: The computer executable instructions are used to perform a polyphone disambiguation method according to any one of claims 1 to 8 when executed by a computer processor.