Model training method, multi-sound character disambiguation method and device, and computer storage medium

CN119626208BActive Publication Date: 2026-08-11GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-12
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

现有多音字消歧的训练方式均采用全局训练,导致模型的局部表现力较差

Benefits of technology

[0037] Compared with existing technologies, the beneficial effects of this application are as follows: the polyphonic character disambiguation device extracts the contextual features of target polyphonic characters in multiple sentences; it clusters all contextual features of the target polyphonic characters to obtain several sets of contextual features; and it trains the corresponding polyphonic character disambiguation sub-network using each set of contextual features to obtain a trained polyphonic character disambiguation model. By using the above polyphonic character disambiguation method, clustering the contextual features of the target polyphonic characters in each sentence, and training a separate polyphonic character disambiguation sub-network for each category, the local plasticity of the polyphonic character disambiguation model can be improved, thus enhancing the model training effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119626208B_ABST
    Figure CN119626208B_ABST
Patent Text Reader

Abstract

This application proposes a model training method, a method for disambiguating polyphonic characters, a device for disambiguating polyphonic characters, and a computer storage medium. The model training method includes: extracting contextual features of target polyphonic characters from multiple sentences; clustering all contextual features of the target polyphonic characters to obtain several sets of contextual features; and training a corresponding disambiguation sub-network for each set of contextual features to obtain a trained disambiguation model. By using the above disambiguation method, clustering the contextual features of the target polyphonic characters in each sentence, and training a separate disambiguation sub-network for each category, the local plasticity of the disambiguation model can be improved, thus enhancing the model training effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of speech recognition technology, and in particular to a model training method, a method for disambiguating polyphonic characters, a device for disambiguating polyphonic characters, and a computer storage medium. Background Technology

[0002] In TTS (Text to Speech) systems, G2P (Graphics to Phonetics) is a crucial module determining pronunciation accuracy. The purpose of G2P is to annotate the pronunciation of text. In languages ​​such as Chinese and Japanese, polyphonic character disambiguation is the core algorithm of G2P, directly determining the performance of the G2P module. Specifically, the polyphonic character disambiguation algorithm determines the pronunciation of polyphonic characters based on the context.

[0003] Current mainstream algorithms for polyphonic character disambiguation are all trained offline on pre-labeled datasets, allowing for long-term use after a single training session. However, existing training methods for polyphonic character disambiguation all employ global training, resulting in poor local performance of the models. Summary of the Invention

[0004] To address the aforementioned technical problems, this application proposes a model training method for polyphonic character disambiguation, a polyphonic character disambiguation method, a polyphonic character disambiguation device, and a computer storage medium.

[0005] To address the aforementioned technical problems, this application proposes a model training method for disambiguating polyphonic characters, the model training method comprising:

[0006] Extract contextual features of target polyphonic characters from multiple sentences;

[0007] Cluster all context features of the target polyphonic character to obtain several sets of context features;

[0008] The corresponding polyphonic character disambiguation network is trained using the context feature set of each class to obtain the trained polyphonic character disambiguation model.

[0009] The extraction of contextual features of target polyphonic characters in multiple sentences includes:

[0010] Extract the vector sequence of each sentence using a pre-trained language model;

[0011] The vector sequence is input into a multi-head self-attention layer to extract the contextual features of the target polyphonic characters in each sentence.

[0012] The step of training the corresponding polyphonic character disambiguation network using each type of contextual feature set includes:

[0013] Initialize the network parameters of the polyphonic character disambiguation subnetwork according to the network parameters of the polyphonic character disambiguation base network;

[0014] Fix the network parameters of the pre-trained language model and / or the network parameters of the polyphonic character disambiguation base network, and train the corresponding polyphonic character disambiguation sub-network using the context feature set of each class.

[0015] The model training method further includes:

[0016] The contextual features of the target polyphonic character in each sentence are input into the polyphonic character disambiguation network to obtain the predicted pronunciation of the target polyphonic character.

[0017] The multi-head self-attention layer is trained using the predicted pronunciation.

[0018] To address the aforementioned technical problems, this application also proposes a method for disambiguating polyphonic characters, the method comprising:

[0019] The sentence to be disambiguated and its target polyphonic characters are input into the polyphonic character disambiguation module, wherein the polyphonic character disambiguation module includes the polyphonic character disambiguation model trained by the above-mentioned model training method.

[0020] Obtain the pronunciation of the target polyphonic character output by the polyphonic character disambiguation module.

[0021] The step of inputting the sentence to be disambiguated and its target polyphonic character into the polyphonic character disambiguation module includes:

[0022] The sentence to be disambiguated is segmented using a word segmentation module to obtain the segmentation results of the target polyphonic character;

[0023] If the word segmentation result of the target polyphonic character is a single-character word, the sentence to be disambiguated and its target polyphonic character are input into the polyphonic character disambiguation model in the polyphonic character disambiguation module to predict the pronunciation of the target polyphonic character.

[0024] After obtaining the pronunciation of the target polyphonic character output by the polyphonic character disambiguation module, the polyphonic character disambiguation method further includes:

[0025] When the predicted pronunciation of the target polyphonic character output by the polyphonic character disambiguation module differs from the actual pronunciation, the classification of the target polyphonic character is obtained by using the polyphonic character disambiguation basic network in the polyphonic character disambiguation model.

[0026] The actual pronunciation is used to train the polyphonic character disambiguation network corresponding to the classification.

[0027] The step of training the polyphonic character disambiguation network corresponding to the classification using the actual pronunciation includes:

[0028] Obtain the number of data samples for the classification;

[0029] When the number of data samples exceeds a preset threshold, the context features of the target polyphonic characters in the sentence to be disambiguated are used as cluster centers to reclassify all data samples of the classification, and two new classifications are obtained.

[0030] The real pronunciation is used to train a new classification of polyphonic character disambiguation subnetworks for the contextual features of the target polyphonic characters in the sentence to be disambiguated.

[0031] The method for disambiguating polyphonic characters further includes the following steps: After segmenting the sentence to be disambiguated using a word segmentation module to obtain the segmentation results of the target polyphonic characters, the polyphonic character disambiguation method also includes:

[0032] If the word segmentation result of the target polyphonic character is a multi-character word, search the pre-stored pronunciation of the phrase containing the target polyphonic character from the pronunciation dictionary;

[0033] If the pronunciation dictionary contains a pre-stored pronunciation of the phrase containing the target polyphonic character, then the pre-stored pronunciation is used as the output of the polyphonic character disambiguation module;

[0034] If the pronunciation dictionary does not contain the pre-stored pronunciation of the phrase containing the target polyphonic character, the sentence to be disambiguated and its target polyphonic character are input into the polyphonic character disambiguation model in the polyphonic character disambiguation module to predict the pronunciation of the target polyphonic character, and the pronunciation dictionary is updated using the output of the polyphonic character disambiguation module.

[0035] To address the aforementioned technical problems, this application also proposes a polyphonic character disambiguation device, which includes a memory and a processor coupled to the memory; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the model training method and / or the polyphonic character disambiguation method as described above.

[0036] To address the aforementioned technical problems, this application also proposes a computer storage medium for storing program data, which, when executed by a computer, is used to implement the aforementioned model training method and / or polyphonic character disambiguation method.

[0037] Compared with existing technologies, the beneficial effects of this application are as follows: the polyphonic character disambiguation device extracts the contextual features of target polyphonic characters in multiple sentences; it clusters all contextual features of the target polyphonic characters to obtain several sets of contextual features; and it trains the corresponding polyphonic character disambiguation sub-network using each set of contextual features to obtain a trained polyphonic character disambiguation model. By using the above polyphonic character disambiguation method, clustering the contextual features of the target polyphonic characters in each sentence, and training a separate polyphonic character disambiguation sub-network for each category, the local plasticity of the polyphonic character disambiguation model can be improved, thus enhancing the model training effect. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] in:

[0040] Figure 1 This is a schematic diagram of the model structure of the polyphonic character disambiguation task scheme based on a pre-trained language model provided in this application;

[0041] Figure 2 This is a flowchart illustrating an embodiment of the polyphonic character disambiguation model training method provided in this application;

[0042] Figure 3 This is a schematic diagram of the structure of the polyphonic character disambiguation model provided in this application;

[0043] Figure 4 This is a flowchart illustrating an embodiment of the polyphonic character disambiguation method provided in this application;

[0044] Figure 5 This is a flowchart illustrating the process of online learning through updating a pronunciation dictionary, as provided in this application.

[0045] Figure 6 yes Figure 4 The diagram shows the detailed process flow of step S21 in the polyphonic character disambiguation method.

[0046] Figure 7 This is a flowchart illustrating the process of determining online learning pathways provided in this application;

[0047] Figure 8 This is a schematic diagram of an embodiment of the polyphonic character disambiguation device provided in this application;

[0048] Figure 9 This is a schematic diagram of the structure of an embodiment of the computer storage medium provided in this application. Detailed Implementation

[0049] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0050] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0051] There are various algorithms for disambiguating polyphonic characters. Currently, the mainstream algorithms include sequence labeling based on BLSTM models and downstream tasks based on pre-trained language models. These algorithms all belong to the classic offline supervised learning paradigm. Figure 1 The model structure of the polyphonic character disambiguation task based on the pre-trained language model is demonstrated.

[0052] Current mainstream algorithms for disambiguating polyphonic characters all involve offline training on pre-labeled datasets, allowing for long-term use after a single training iteration. While this classic offline supervised learning approach achieves good model performance, it encounters intractable application challenges in practice:

[0053] (1) Errors are difficult to correct. No matter how well a model is trained, it is impossible to be 100% accurate. If an error is found, it is basically impossible to accurately correct the error on a black-box deep learning model.

[0054] (2) The quality of labeled data affects the quality of the algorithm. If the labeled data used to train the model is incorrect, the better the model's metrics, the worse the algorithm's quality will be. To change this situation, the labeled data must be corrected and the model retrained, which is time-consuming and costly.

[0055] (3) The algorithm does not support online learning. That is, once the model is trained, all parameters are fixed and it cannot learn new knowledge from user feedback to update the model in real time. The user experience is that the algorithm does not have the ability to learn actively and is not that intelligent.

[0056] To address the application challenges encountered by mainstream algorithms in TTS systems during practice, this application proposes an online learning method for polyphonic character disambiguation. The overall approach is as follows: (1) a basic polyphonic character disambiguation model is trained offline and provided for service; (2) user feedback is collected during the service process, and the model is updated in real time using the feedback information; (3) when updating the model, the inference results of the model based on historical data are not changed as much as possible; (4) a pronunciation dictionary that can be updated online in real time is introduced to improve efficiency and accuracy.

[0057] The online learning method for disambiguation of polyphonic characters provided in this application is described below in two stages: the model training stage and the model usage stage.

[0058] Please refer to details. Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of the polyphonic character disambiguation model training method provided in this application.

[0059] During the model training phase, the polyphonic character disambiguation device trains the basic polyphonic character disambiguation model. Based on the scheme of using a pre-trained language model to perform the polyphonic character disambiguation task, offline training is conducted on pre-labeled data to train a basic model. This approach is similar to existing mainstream algorithms, but differs in that: (1) the model structure is specially designed to give the model good local plasticity, see details... Figure 3 , Figure 3 (1) This is a schematic diagram of the polyphonic character disambiguation model provided in this application; (2) The model training is divided into 3 stages, instead of the 2 stages of the existing mainstream algorithms; (3) The sub-networks used in the finished model are different.

[0060] The model training method of this application is applied to a polyphonic character disambiguation device. This device can be a server, a terminal device, or a system in which the server and terminal device cooperate. Accordingly, all components of the polyphonic character disambiguation device, such as units, subunits, modules, and submodules, can be entirely located in the server, entirely located in the terminal device, or separately located in both the server and the terminal device.

[0061] Furthermore, the aforementioned server can be either hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software programs or software modules, such as software or software modules used to provide distributed server functionality, or as a single software program or software module; no specific limitations are made here.

[0062] like Figure 2 As shown, the specific steps are as follows:

[0063] Step S11: Extract the contextual features of the target polyphonic characters in multiple sentences.

[0064] In the embodiments of this application, such as Figure 3 As shown, the polyphonic character disambiguation device trains the pre-trained language model during the pre-training phase.

[0065] Specifically, similar to language models such as BERT and GPT, Figure 3The pre-trained language model shown learns the representation of characters through self-supervised learning, encoding the character sequence into a hidden vector sequence α. 0 ,α 1 ,...α 12 This step only requires training. Figure 3 For the pre-trained language model part, you can also directly use ready-made models trained by third parties.

[0066] The polyphonic character disambiguation device extracts the vector sequence α for each sentence using a pre-trained language model trained during the pre-training phase. 0 ,a 1 ,...a 12 Then, the vector sequence is input. Figure 3 The multi-head self-attention layer.

[0067] Specifically, in Figure 3 The first training stage involves adding a polyphonic character disambiguation network to the pre-trained language model to enable the model to learn polyphonic character disambiguation. This network is typically simple, such as a two-layer BLSTM followed by a softmax layer. In this application, the first layer of the polyphonic character disambiguation model must be a multi-head self-attention layer. This step only requires training... Figure 3 The middle multi-head self-attention layer and the basic network for disambiguating polyphonic characters.

[0068] Furthermore, the Multi-head Self-attention layer can be trained using a polyphonic character disambiguation network. This involves inputting the contextual features of the target polyphonic characters extracted from the training set by the Multi-head Self-attention layer into the polyphonic character disambiguation network. The Multi-head Self-attention layer is then trained using the difference between the predicted and actual outputs of the polyphonic character disambiguation network. Once training is complete, the network parameters of both the Multi-head Self-attention layer and the polyphonic character disambiguation network are fixed. Alternatively, the network parameters of the polyphonic character disambiguation network can be directly fixed during the training of the Multi-head Self-attention layer.

[0069] Step S12: Cluster all context features of the target polyphonic character to obtain several sets of context features.

[0070] In this embodiment, the polyphonic character disambiguation device utilizes a multi-head self-attention layer to extract the vector sequence a. 0 ,a1 ,...α 12 The context feature, that is, the attention output of the Multi-head Self-attention layer is used as the context feature of the vector sequence.

[0071] Specifically, as Figure 3 In the input character sequence in, the character "倒" is the target polyphonic character, and its position in the sequence is the 3rd (the position starts from 0). α 3 is the hidden vector representing the character after encoding, and b 3 is the self-attention output of the character. a 3 , b 3 are both vectors rather than scalars. To reduce the computational complexity of the clustering algorithm, the dimension of b 3 is set to a smaller value, such as 64.

[0072] It should be noted that the position of the target polyphonic character needs to be specified in advance or provided synchronously.

[0073] The polyphonic character disambiguation device calculates the attention output for all target polyphonic characters in the training dataset, and then clusters these output vectors and divides them into C categories. For example, the polyphonic character disambiguation device obtains b 3 of each sentence, and then clusters all b 3 . Since the self-attention output of the target polyphonic character contains the context information of the target polyphonic character in the original sentence, through clustering, the context features with the same or similar context information can be assigned to the same category for training, which can accelerate the training efficiency of each category of polyphonic character disambiguation sub-networks.

[0074] Among them, the number of categories of C can be specified manually. The polyphonic character disambiguation device sets a polyphonic character disambiguation sub-network with the same network structure as the polyphonic character disambiguation basic network trained in the first stage of training for each category, and initializes the network parameters of the polyphonic character disambiguation sub-networks of all categories using the network parameters of the polyphonic character disambiguation basic network.

[0075] Therefore, in Figure 3 [[ID=3�]]the second stage of training, the polyphonic character disambiguation device freezes or fixes the network parameters that have been trained in the pre-training stage and the first stage of training, that is, only the network parameters of the polyphonic character disambiguation sub-networks corresponding to all categories are iteratively updated in the second stage of training. Moreover, during the training of the polyphonic character disambiguation sub-network, all training samples, that is, all sentences to be trained, are classified and only participate in the training of the polyphonic character disambiguation sub-network corresponding to their respective categories.

[0076] Step S13: Use each category of context feature sets to train the corresponding polyphonic character disambiguation sub-network to obtain a trained polyphonic character disambiguation model.

[0077] In this embodiment of the application, the polyphonic character disambiguation device completes... Figure 3 After three stages of model training, the final polyphonic character disambiguation model is obtained. Unlike existing mainstream algorithms, the polyphonic character disambiguation model exported after training does not include a basic polyphonic character disambiguation network; instead, it uses a sub-network. That is, during the usage phase, the polyphonic character disambiguation model hides the basic polyphonic character disambiguation network and uses the sub-network to perform the polyphonic character disambiguation task.

[0078] In this embodiment, the polyphonic character disambiguation device extracts contextual features of target polyphonic characters in multiple sentences; clusters all contextual features of the target polyphonic characters to obtain several sets of contextual features; and trains a corresponding polyphonic character disambiguation sub-network using each set of contextual features to obtain a trained polyphonic character disambiguation model. By using the above polyphonic character disambiguation method, clustering the contextual features of the target polyphonic characters in each sentence, and training a separate polyphonic character disambiguation sub-network for each category, the local plasticity of the polyphonic character disambiguation model can be improved, thus enhancing the model training effect.

[0079] The following section continues to describe the model usage phase of the online learning method for disambiguating polyphonic characters provided in this application. Please refer to the following for further details. Figure 4 , Figure 4 This is a flowchart illustrating an embodiment of the polyphonic character disambiguation method provided in this application.

[0080] like Figure 4 As shown, the specific steps are as follows:

[0081] Step S21: Input the sentence to be disambiguated and its target polyphonic characters into the polyphonic character disambiguation module, wherein the polyphonic character disambiguation module includes the polyphonic character disambiguation model trained by the above-mentioned model training method.

[0082] In the embodiments of this application, in Figure 2 Based on the polyphonic character disambiguation module formed by the polyphonic character disambiguation model trained by the model training method shown, the polyphonic character disambiguation device also creates a word segmentation module and a pronunciation dictionary. The word segmentation module and pronunciation dictionary are common in modern TTS systems. The pronunciation dictionary provided in this application is editable online, while the pronunciation dictionary in some existing TTS systems is frozen during service. Please refer to [link / reference] for details. Figure 5 , Figure 5 This is a flowchart illustrating the process of online learning through updating a pronunciation dictionary, as provided in this application.

[0083] Specifically, the polyphonic character disambiguation device needs to determine the online learning approach based on the word segmentation results of the target polyphonic character. Please refer to [link / reference needed]. Figure 6 and Figure 7 , Figure 6 yes Figure 4The specific process schematic diagram of step S21 of the polyphonic character disambiguation method shown Figure 7 is the process schematic diagram for judging the online learning path provided by this application.

[0084] As Figure 6 shown, the specific steps are as follows:

[0085] Step S211: Use the word segmentation module to segment the sentence to be disambiguated to obtain the word segmentation result of the target polyphonic character.

[0086] In the embodiment of this application, after the polyphonic character disambiguation device receives the correct pronunciation of the target polyphonic character feedback by the user, it first judges the online learning path. As Figure 7 shown, if the target polyphonic character is segmented into a two-character word or a multi-character word by the word segmentation module, online learning is realized by updating the pronunciation dictionary; otherwise, online learning is realized by updating the polyphonic character disambiguation model.

[0087] Step S212: If the word segmentation result of the target polyphonic character is a single-character word, input the sentence to be disambiguated and its target polyphonic character into the polyphonic character disambiguation model in the polyphonic character disambiguation module for pronunciation prediction of the target polyphonic character.

[0088] In the embodiment of this application, when the target polyphonic character is segmented into a single-character word by the word segmentation module, the polyphonic character disambiguation device can directly use the polyphonic character disambiguation module to realize online learning.

[0089] Specifically, in the example of "The bottle fell over and the water flowed out.", the word segmentation result is "bottle / fell over / and / water / flowed / out". The target polyphonic character "fell over" is segmented into a single-character word. The polyphonic character disambiguation device first obtains the predicted pronunciation of the polyphonic character disambiguation model, and then uses the real pronunciation feedback by the user to judge whether the prediction of the polyphonic character disambiguation model is correct.

[0090] If the pronunciation of the character "fell over" is predicted wrong by the G2P module, the text sequence of this sentence will be passed through the polyphonic character disambiguation basic network hidden in the polyphonic character disambiguation model to calculate its classification. Suppose it is the i-th class, then only the i-th class polyphonic character disambiguation sub-network is retrained, while keeping the other C-1 polyphonic character disambiguation sub-networks unchanged.

[0091] Specifically, the steps for retraining the polyphonic character disambiguation sub-network provided by this application are as follows:

[0092] (1) Generate a group of similar sentences containing the target polyphonic character through the similar sentence generation model, and mark the pronunciation of the target polyphonic character in them as the correct pronunciation feedback by the user.

[0093] (2) Retrain the polyphonic character disambiguation sub-network together with the sentence feedback by the user, the generated similar sentences, and the training samples involved when training the i-th class polyphonic character disambiguation sub-network.

[0094] (3) Class splitting. The i-th class will be split into two classes and retrained separately in the following two situations: i) The retrained subnetwork performs poorly (e.g., accuracy is below 99%), or the user feedback samples after retraining are still predicted incorrectly by the model; ii) There are too many data samples in this class (e.g., more than 32,768), which reduces the efficiency of online learning.

[0095] The classification splitting method provided in this application is as follows: the user feedback sample is used as the first cluster center, the second cluster center is selected by minimizing the SSE (Sum of Squared Error), and all samples are clustered into 2 classes.

[0096] (4) Update the training sample set of the subnetwork. Add the sentences of user feedback to the training sample set of their corresponding categories so that they will also participate in the training during the next retraining.

[0097] Step S213: If the word segmentation result of the target polyphonic character is a multi-character word, search for the pre-stored pronunciation of the phrase containing the target polyphonic character from the pronunciation dictionary.

[0098] In this embodiment of the application, when the target polyphonic character is segmented into a multi-character word by the word segmentation module, the polyphonic character disambiguation device needs to use the polyphonic character disambiguation module to query whether the pronunciation dictionary contains a pre-stored pronunciation of the word group containing the target polyphonic character. If yes, proceed to step S214; if no, proceed to step S215.

[0099] Step S214: If the pronunciation dictionary contains a pre-stored pronunciation of the phrase containing the target polyphonic character, then use the pre-stored pronunciation as the output of the polyphonic character disambiguation module.

[0100] Step S215: If the pronunciation of the target polyphonic character is not stored in the pronunciation dictionary, the sentence to be disambiguated and its target polyphonic character are input into the polyphonic character disambiguation model in the polyphonic character disambiguation module to predict the pronunciation of the target polyphonic character, and the pronunciation dictionary is updated using the output of the polyphonic character disambiguation module.

[0101] In this embodiment of the application, if the pronunciation dictionary does not contain the pre-stored pronunciation of the phrase containing the target polyphonic character, the polyphonic character disambiguation device needs to update the pronunciation dictionary to achieve online learning.

[0102] Specifically, considering that the pronunciation of most polyphonic characters is fixed in two-character and multi-character words, the effect of online learning can be achieved by updating the pronunciation dictionary in real time. Figure 5The following example is used for illustration. The input text is "Liu'an Guapian is tea, not melon". Before the pronunciation dictionary was updated, the G2P module mislabeled the character "六" as "liu4". Since the character "六" was segmented by the word segmentation module into the two-word phrase "六安", the correct pronunciation of "六" provided by the user feedback and the pronunciation of the character "安" given by the G2P module were combined, and "六安:lu4 an1" was updated into the pronunciation dictionary. After the update, whenever the G2P module encounters the word "六安" again, it will obtain the correct pronunciation "lu4 an1" from the pronunciation dictionary.

[0103] Step S22: Obtain the pronunciation of the target polyphonic character output by the polyphonic character disambiguation module.

[0104] Those skilled in the art can understand that in the above method of the specific implementation manner, the writing order of each step does not mean a strict execution order and does not constitute any limitation to the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0105] In the embodiment of the present application, in order to make the model have good local plasticity, the attention output of the target polyphonic character is clustered, and a polyphonic character disambiguation sub-network is trained separately for each category; in order to ensure the stability of the classification result, when training each polyphonic character disambiguation sub-network separately, the weights of the Multi-head Self-attention layer, which is the first layer of the polyphonic character disambiguation task model, are frozen; in order to ensure the performance of each classified polyphonic character disambiguation sub-network, a high-performance polyphonic character disambiguation sub-network is trained using all the training set data in the first stage of training, and its weights are used to initialize each classified polyphonic character disambiguation sub-network; classification fission is introduced to solve the problem that the user feedback samples still cannot be correctly predicted after retraining the polyphonic character disambiguation sub-network, and the problem of reducing the online learning efficiency as the training samples are expanded; the online learning path is judged according to the word segmentation result, and by reasonably using the word segmentation module and the online editable pronunciation dictionary, the effect of efficient online learning is achieved.

[0106] To implement the above model training method and / or polyphonic character disambiguation method, the present application also proposes a polyphonic character disambiguation device. For details, please refer to Figure 8 , Figure 8 is a schematic structural diagram of an embodiment of the polyphonic character disambiguation device provided by the present application.

[0107] The polyphonic character disambiguation device 400 in this embodiment includes a processor 41, a memory 42, an input / output device 43, and a bus 44.

[0108] The processor 41, memory 42, and input / output device 43 are respectively connected to the bus 44. The memory 42 stores program data, and the processor 41 is used to execute the program data to implement the model training method and / or polyphonic character disambiguation method described in the above embodiments.

[0109] In this embodiment, processor 41 can also be referred to as a CPU (Central Processing Unit). Processor 41 may be an integrated circuit chip with signal processing capabilities. Processor 41 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor, or processor 41 can be any conventional processor.

[0110] This application also provides a computer storage medium; please refer to the following: Figure 9 , Figure 9 This is a schematic diagram of a computer storage medium according to an embodiment of the present application. The computer storage medium 600 stores a computer program 61. When the computer program 61 is executed by the processor, it is used to implement the model training method and / or the polyphonic character disambiguation method of the above embodiment.

[0111] When the embodiments of this application are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0112] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for disambiguating polyphonic characters, characterized in that, The method for disambiguating polyphonic characters includes: Input the sentence to be disambiguated and its target polyphonic characters into the polyphonic character disambiguation module; Obtain the pronunciation of the target polyphonic character output by the polyphonic character disambiguation module; The polyphonic character disambiguation module includes a polyphonic character disambiguation model trained using the following model training method: Add a basic network for polyphonic character disambiguation to the pre-trained polyphonic character disambiguation model; Extract contextual features of target polyphonic characters from multiple sentences, input the contextual features into the polyphonic character disambiguation basic network for training, and fix the network parameters of the polyphonic character disambiguation basic network after training is completed; Cluster all context features of the target polyphonic character to obtain several sets of context features; For each class, a polyphonic character disambiguation subnetwork with the same network structure as the polyphonic character disambiguation base network is set up, and the network parameters of the polyphonic character disambiguation subnetworks of all classes are initialized using the network parameters of the polyphonic character disambiguation base network; The corresponding polyphonic character disambiguation network is trained using each class of contextual feature sets. During the training process, only the network parameters of the polyphonic character disambiguation networks corresponding to all classes are iteratively updated. Each class of contextual feature sets only participates in the training of the polyphonic character disambiguation network corresponding to its own class, thus obtaining a trained polyphonic character disambiguation model. The trained polyphonic character disambiguation model does not include the polyphonic character disambiguation base network, but is replaced by a polyphonic character disambiguation sub-network.

2. The method for disambiguating polyphonic characters according to claim 1, characterized in that, The process of inputting the sentence to be disambiguated and its target polyphonic character into the polyphonic character disambiguation module includes: The sentence to be disambiguated is segmented using a word segmentation module to obtain the segmentation results of the target polyphonic character; If the word segmentation result of the target polyphonic character is a single-character word, the sentence to be disambiguated and its target polyphonic character are input into the polyphonic character disambiguation model in the polyphonic character disambiguation module to predict the pronunciation of the target polyphonic character.

3. The method for disambiguating polyphonic characters according to claim 2, characterized in that, After obtaining the pronunciation of the target polyphonic character output by the polyphonic character disambiguation module, the polyphonic character disambiguation method further includes: When the predicted pronunciation of the target polyphonic character output by the polyphonic character disambiguation module differs from the actual pronunciation, the classification of the target polyphonic character is obtained by using the polyphonic character disambiguation basic network in the polyphonic character disambiguation model. The actual pronunciation is used to train the polyphonic character disambiguation network corresponding to the classification.

4. The method for disambiguating polyphonic characters according to claim 3, characterized in that, The step of training the polyphonic character disambiguation network corresponding to the classification using the actual pronunciation includes: Obtain the number of data samples for the classification; When the number of data samples exceeds a preset threshold, the context features of the target polyphonic characters in the sentence to be disambiguated are used as cluster centers to reclassify all data samples of the classification, and two new classifications are obtained. The real pronunciation is used to train a new classification of polyphonic character disambiguation subnetworks for the contextual features of the target polyphonic characters in the sentence to be disambiguated.

5. The method for disambiguating polyphonic characters according to claim 2, characterized in that, After segmenting the sentence to be disambiguated using the word segmentation module to obtain the segmentation result of the target polyphonic character, the polyphonic character disambiguation method further includes: If the word segmentation result of the target polyphonic character is a multi-character word, search the pre-stored pronunciation of the phrase containing the target polyphonic character from the pronunciation dictionary; If the pronunciation dictionary contains a pre-stored pronunciation of the phrase containing the target polyphonic character, then the pre-stored pronunciation is used as the output of the polyphonic character disambiguation module; If the pronunciation dictionary does not contain the pre-stored pronunciation of the phrase containing the target polyphonic character, the sentence to be disambiguated and its target polyphonic character are input into the polyphonic character disambiguation model in the polyphonic character disambiguation module to predict the pronunciation of the target polyphonic character, and the pronunciation dictionary is updated using the output of the polyphonic character disambiguation module.

6. The method for disambiguating polyphonic characters according to claim 1, characterized in that, The extraction of contextual features of target polyphonic characters in multiple sentences includes: Extract the vector sequence of each sentence using a pre-trained language model; The vector sequence is input into a multi-head self-attention layer to extract the contextual features of the target polyphonic characters in each sentence.

7. The method for disambiguating polyphonic characters according to claim 6, characterized in that, The method for disambiguating polyphonic characters also includes: The contextual features of the target polyphonic character in each sentence are input into the polyphonic character disambiguation network to obtain the predicted pronunciation of the target polyphonic character. The multi-head self-attention layer is trained using the predicted pronunciation.

8. A polyphonic character disambiguation device, characterized in that, The polyphonic character disambiguation device includes a memory and a processor coupled to the memory; The memory is used to store program data, and the processor is used to execute the program data to implement the polyphonic character disambiguation method as described in any one of claims 1 to 7.

9. A computer storage medium, characterized in that, The computer storage medium is used to store program data, which, when executed by the computer, is used to implement the polyphonic character disambiguation method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Polyphone disambiguation method and device, equipment and storage medium

    CN116266266A