Polyphonetic character processing method and device, model training method and device

By receiving Chinese statements containing polyphonic characters, determining the positional characteristics and part-of-speech characteristics of polyphonic characters, and inputting them into the polyphonic characters disambiguation model, the problem of low pronunciation prediction efficiency in the prior art is solved, and higher prediction accuracy and smaller feature vocabulary scale are achieved.

CN111967260BActive Publication Date: 2025-03-11BEIJING KINGSOFT DIGITAL ENTERTAINMENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011121064.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-20
Publication Date
2025-03-11
Estimated Expiration
2040-10-20

AI Technical Summary

Technical Problem

In the prior art, rules-based Chinese polyphonic ambiguity elimination system is prone to rule conflicts, while statistical model-based neural network systems have problems such as excessive feature dimensions, high training and inference costs, and excessive feature vocabulary lists, resulting in low efficiency in pronunciation prediction of polyphonic pronunciation.

Method used

By receiving Chinese statements containing polyphonic characters, the first position feature, part of speech feature and second position feature of polyphonic characters are determined, and these features are input into the polyphonic character disambiguation model to obtain the pronunciation of polyphonic characters. This method combines the relative position characteristics of sentences, relative position characteristics of words and part-of-speech characteristics, reducing the scale of the feature vocabulary list.

Benefits of technology

It effectively resolves the problem of conflict of rules, reduces the scale of feature vocabulary list, and improves the accuracy and efficiency of pronunciation prediction of polyphonic characters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111967260B_ABST
    Figure CN111967260B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for processing polyphones, and a model training method and device, wherein the polyphone processing method includes receiving a Chinese sentence containing polyphones, and determining a first position feature of the polyphones in the Chinese sentence; segmenting the Chinese sentence, and determining the part-of-speech feature of the polyphones based on the words obtained by the word segmentation and the part-of-speech of the words; obtaining a word containing the polyphone, and determining a second position feature of the polyphone in the word containing the polyphone; inputting the first position feature, the part-of-speech feature, and the second position feature into a polyphone disambiguation model to obtain the pronunciation corresponding to the polyphone.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for processing polyphones, a method and device for training models, a computing device, and a computer-readable storage medium. Background Art

[0002] The earliest Chinese polyphone disambiguation systems were rule-based. These rules were summarized by linguists and encoded into computers in a way that computers can understand. However, as the size of data increased, data-based statistical models gradually became the preferred solution for the Chinese polyphone disambiguation task. That is, traditional machine learning models (such as decision tree models, maximum entropy models) and deep neural networks began to be applied to the Chinese polyphone disambiguation task.

[0003] However, the rule-based Chinese polyphone disambiguation system has the problem that one polyphone may match multiple rules or one rule may match multiple correct pronunciations of a polyphone, resulting in rule conflicts. The statistical model neural network Chinese polyphone disambiguation system, when using neural networks as feature extraction modules, has the problem of complex feature forms and too high dimensionality of extracted features, which increases the cost of training and reasoning and reduces prediction efficiency. When using the traditional semantic analysis process as the feature extraction module, the required feature vocabulary is too large and the encoding is not accurate enough.

[0004] Therefore, there is an urgent need to provide a polyphone processing method that does not cause rule conflicts, can reduce the size of the feature word list, and improve the pronunciation prediction accuracy of polyphones. Summary of the invention

[0005] In view of this, the embodiments of the present application provide a polyphonetic character processing method and apparatus, a model training method and apparatus, a computing device, and a computer-readable storage medium to address the technical defects existing in the prior art.

[0006] According to a first aspect of an embodiment of the present application, a method for processing a polyphonetic character is provided, comprising:

[0007] Receiving a Chinese sentence containing a polyphonetic character, and determining a first position feature of the polyphonetic character in the Chinese sentence;

[0008] Segmenting the Chinese sentence, and determining the part-of-speech features of the polyphonetic character based on the words obtained by the segmentation and the part-of-speech of the words;

[0009] Acquire a word containing a polyphonetic character, and determine a second position feature of the polyphonetic character in the word containing the polyphonetic character;

[0010] The first position feature, the part-of-speech feature, and the second position feature are input into a polyphone disambiguation model to obtain a pronunciation corresponding to the polyphone.

[0011] Optionally, determining the first position feature of the polyphone in the Chinese sentence includes:

[0012] Obtaining polyphones in the Chinese sentence, and determining position index values ​​of the polyphones in the Chinese sentence and the total length of the Chinese sentence;

[0013] Based on the position index value of the polyphone in the Chinese sentence and the total length of the Chinese sentence, a first position feature of the polyphone in the Chinese sentence is calculated.

[0014] Optionally, before segmenting the Chinese sentence, the method further includes:

[0015] Filter out numbers contained in the Chinese sentence.

[0016] Optionally, the word segmentation of the Chinese sentence includes:

[0017] The Chinese sentences after filtering the numbers are segmented through the preset segmentation tool, and the parts of speech are tagged for the segmented words.

[0018] Optionally, determining the part-of-speech feature of the polyphone based on the words obtained by word segmentation and the part-of-speech of the words includes:

[0019] Obtaining words after word segmentation of the Chinese sentence, and determining the part of speech of each word;

[0020] The word containing the polyphone, the part of speech of the word containing the polyphone, the part of speech of the previous word adjacent to the word containing the polyphone, and the part of speech of the next word adjacent to the word containing the polyphone are determined as part-of-speech features of the polyphone.

[0021] Optionally, the determining of the second position feature of the polyphonetic character in the word containing the polyphonetic character comprises:

[0022] Determine the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character;

[0023] Based on the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character, a second position feature of the polyphonetic character in the word containing the polyphonetic character is calculated.

[0024] Optionally, the polyphone disambiguation model includes a word embedding layer, a BLSTM layer, and a fully connected layer;

[0025] Correspondingly, inputting the first position feature, the part-of-speech feature, and the second position feature into a polyphone disambiguation model to obtain the pronunciation corresponding to the polyphone includes:

[0026] Inputting the first position feature, the part-of-speech feature, and the second position feature into the word embedding layer for encoding to obtain a first vector;

[0027] Input the first vector into the BLSTM layer to obtain context information to obtain a second vector;

[0028] Inputting the second vector into the fully connected layer to obtain candidate pronunciations of the polyphonetic character and a probability value of each candidate pronunciation;

[0029] The candidate pronunciation with the highest probability value is output as the pronunciation corresponding to the polyphonetic character.

[0030] According to a second aspect of an embodiment of the present application, a model training method is provided, including:

[0031] Obtaining Chinese sentence samples containing polyphones and labels corresponding to the Chinese sentence samples;

[0032] Determining a first position feature of the polyphonetic character in the Chinese sentence sample;

[0033] Segmenting the Chinese sentence sample, and determining the part-of-speech features of the polyphonetic character based on the words obtained by the segmentation and the part-of-speech of the words;

[0034] Acquire a word containing a polyphonetic character, and determine a second position feature of the polyphonetic character in the word containing the polyphonetic character;

[0035] A polyphone disambiguation model is trained based on the first position feature, the part-of-speech feature, the second position feature, and the label corresponding to the Chinese sentence sample to obtain the polyphone disambiguation model.

[0036] Optionally, determining the first position feature of the polyphone in the Chinese sentence sample includes:

[0037] Acquire polyphones in the Chinese sentence sample, and determine the position index value of the polyphones in the Chinese sentence sample and the total length of the Chinese sentence sample;

[0038] Based on the position index value of the polyphone in the Chinese sentence sample and the total length of the Chinese sentence sample, a first position feature of the polyphone in the Chinese sentence sample is calculated.

[0039] Optionally, before segmenting the Chinese sentence sample, the method further includes:

[0040] The numbers contained in the Chinese sentence sample are filtered out.

[0041] Optionally, the segmenting the Chinese sentence sample includes:

[0042] The preset word segmentation tool is used to segment the Chinese sentence samples after filtering the numbers, and the part-of-speech tags are performed on the segmented words.

[0043] Optionally, determining the part-of-speech feature of the polyphone based on the words obtained by word segmentation and the part-of-speech of the words includes:

[0044] Obtaining words after word segmentation of the Chinese sentence sample, and determining the part of speech of each word;

[0045] The word containing the polyphone, the part of speech of the word containing the polyphone, the part of speech of the previous word adjacent to the word containing the polyphone, and the part of speech of the next word adjacent to the word containing the polyphone are determined as part-of-speech features of the polyphone.

[0046] Optionally, the determining of the second position feature of the polyphonetic character in the word containing the polyphonetic character comprises:

[0047] Determine the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character;

[0048] Based on the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character, a second position feature of the polyphonetic character in the word containing the polyphonetic character is calculated.

[0049] Optionally, the polyphone disambiguation model includes a word embedding layer, a BLSTM layer and a fully connected layer; and the label corresponding to the Chinese sentence sample is the pronunciation corresponding to the polyphone in the Chinese sentence sample.

[0050] According to a third aspect of an embodiment of the present application, a polyphonetic character processing device is provided, comprising:

[0051] A first position feature determination module is configured to receive a Chinese sentence containing a polyphonetic character and determine a first position feature of the polyphonetic character in the Chinese sentence;

[0052] a part-of-speech feature determination module configured to segment the Chinese sentence and determine the part-of-speech feature of the polyphone based on the words obtained by segmentation and the part-of-speech of the words;

[0053] A second position feature determination module is configured to obtain a word containing a polyphonetic character and determine a second position feature of the polyphonetic character in the word containing the polyphonetic character;

[0054] The pronunciation acquisition module is configured to input the first position feature, the part-of-speech feature and the second position feature into a polyphone disambiguation model to obtain the pronunciation corresponding to the polyphone.

[0055] Optionally, the first position feature determination module is further configured to:

[0056] Obtaining polyphones in the Chinese sentence, and determining position index values ​​of the polyphones in the Chinese sentence and the total length of the Chinese sentence;

[0057] Based on the position index value of the polyphone in the Chinese sentence and the total length of the Chinese sentence, a first position feature of the polyphone in the Chinese sentence is calculated.

[0058] Optionally, the device further includes:

[0059] The first number filtering module is configured to filter out numbers contained in the Chinese sentence.

[0060] Optionally, the part-of-speech feature determination module is further configured to:

[0061] The Chinese sentences after filtering the numbers are segmented through the preset segmentation tool, and the parts of speech are tagged for the segmented words.

[0062] Optionally, the part-of-speech feature determination module is further configured to:

[0063] Obtaining words after word segmentation of the Chinese sentence, and determining the part of speech of each word;

[0064] The word containing the polyphone, the part of speech of the word containing the polyphone, the part of speech of the previous word adjacent to the word containing the polyphone, and the part of speech of the next word adjacent to the word containing the polyphone are determined as part-of-speech features of the polyphone.

[0065] Optionally, the second position feature determination module is further configured to:

[0066] Determine the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character;

[0067] Based on the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character, a second position feature of the polyphonetic character in the word containing the polyphonetic character is calculated.

[0068] Optionally, the polyphone disambiguation model includes a word embedding layer, a BLSTM layer, and a fully connected layer;

[0069] Correspondingly, the pronunciation acquisition module is further configured as follows:

[0070] Inputting the first position feature, the part-of-speech feature, and the second position feature into the word embedding layer for encoding to obtain a first vector;

[0071] Input the first vector into the BLSTM layer to obtain context information to obtain a second vector;

[0072] Inputting the second vector into the fully connected layer to obtain candidate pronunciations of the polyphonetic character and a probability value of each candidate pronunciation;

[0073] The candidate pronunciation with the highest probability is output as the pronunciation corresponding to the polyphonetic character.

[0074] According to a fourth aspect of an embodiment of the present application, a model training device is provided, comprising:

[0075] A sample acquisition module, configured to acquire Chinese sentence samples containing polyphones and labels corresponding to the Chinese sentence samples;

[0076] A sample first position feature determination module, configured to determine a first position feature of the polyphone in the Chinese sentence sample;

[0077] A sample part-of-speech feature determination module is configured to segment the Chinese sentence sample, and determine the part-of-speech feature of the polyphone based on the words obtained by the segmentation and the part-of-speech of the words;

[0078] A sample second position feature determination module is configured to obtain a word containing a polyphonetic character and determine a second position feature of the polyphonetic character in the word containing the polyphonetic character;

[0079] The model training module is configured to train the polyphone disambiguation model based on the first position feature, the part-of-speech feature, the second position feature and the label corresponding to the Chinese sentence sample to obtain the polyphone disambiguation model.

[0080] Optionally, the sample first position feature determination module is further configured to:

[0081] Acquire polyphones in the Chinese sentence sample, and determine the position index value of the polyphones in the Chinese sentence sample and the total length of the Chinese sentence sample;

[0082] Based on the position index value of the polyphone in the Chinese sentence sample and the total length of the Chinese sentence sample, a first position feature of the polyphone in the Chinese sentence sample is calculated.

[0083] Optionally, the device further includes:

[0084] The second filtering module is configured to filter out numbers contained in the Chinese sentence sample.

[0085] Optionally, the sample part-of-speech feature determination module is further configured to:

[0086] The preset word segmentation tool is used to segment the Chinese sentence samples after filtering the numbers, and the part-of-speech tags are performed on the segmented words.

[0087] Optionally, the sample part-of-speech feature determination module is further configured to:

[0088] Obtaining words after word segmentation of the Chinese sentence sample, and determining the part of speech of each word;

[0089] The word containing the polyphone, the part of speech of the word containing the polyphone, the part of speech of the previous word adjacent to the word containing the polyphone, and the part of speech of the next word adjacent to the word containing the polyphone are determined as part-of-speech features of the polyphone.

[0090] Optionally, the sample second position feature determination module is further configured to:

[0091] Determine the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character;

[0092] Based on the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character, a second position feature of the polyphonetic character in the word containing the polyphonetic character is calculated.

[0093] Optionally, the polyphone disambiguation model includes a word embedding layer, a BLSTM layer and a fully connected layer; and the label corresponding to the Chinese sentence sample is the pronunciation corresponding to the polyphone in the Chinese sentence sample.

[0094] According to a fifth aspect of an embodiment of the present application, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the polyphonetic character processing method or the model training method when executing the instructions.

[0095] According to a sixth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer instructions, and when the instructions are executed by a processor, the steps of the polyphonetic character processing method or the model training method are implemented.

[0096] The embodiments of the present application provide a method and device for processing polyphones, and a method and device for model training, wherein the method for processing polyphones includes receiving a Chinese sentence containing polyphones, and determining a first position feature of the polyphones in the Chinese sentence; segmenting the Chinese sentence, and determining the part-of-speech feature of the polyphones based on the words obtained by the word segmentation and the part-of-speech of the words; obtaining a word containing the polyphone, and determining a second position feature of the polyphone in the word containing the polyphone; and inputting the first position feature, the part-of-speech feature, and the second position feature into a polyphone disambiguation model to obtain the pronunciation corresponding to the polyphone.

[0097] The polyphone processing method forms a new part-of-speech information feature by combining the relative position features of the polyphone in Chinese sentences and words after word segmentation, and the part-of-speech features of the polyphone, and inputs the new part-of-speech information feature into the polyphone disambiguation model to predict the pronunciation of the polyphone, thereby replacing the rule-based prediction of the correct pronunciation of the polyphone, and well solving the problem of rule conflict when the correct pronunciation of the polyphone is predicted based on rules in the prior art; in addition, the polyphone processing method combines the position features and part-of-speech features of the polyphone to predict the pronunciation of the polyphone, which can greatly reduce the vocabulary size required by the polyphone disambiguation model and solve the problem of the neural network model requiring too large a vocabulary; and by encoding the relative position features of the polyphone in Chinese sentences and words after word segmentation into feature vectors, the diversity of feature combinations in the polyphone ambiguity elimination task is enriched, so that the polyphone disambiguation model has a more comprehensive understanding of the context information in the Chinese sentence, effectively reducing the problem of missing encoding information in the actual application process, thereby improving the accuracy of the predicted pronunciation corresponding to the polyphone. BRIEF DESCRIPTION OF THE DRAWINGS

[0098] Figure 1 is a structural block diagram of a computing device provided in an embodiment of the present application;

[0099] Figure 2 is a flow chart of a model training method provided in an embodiment of the present application;

[0100] Figure 3 is a flow chart of a polyphonetic character processing method provided in an embodiment of the present application;

[0101] Figure 4 It is a flow chart of processing "in the ancient capital of Xi'an" as a Chinese sentence containing polyphones in a polyphone processing method provided in an embodiment of the present application;

[0102] Figure 5 It is a schematic structural diagram of a polyphonic character processing device provided by an embodiment of the present application;

[0103] Figure 6 It is a schematic structural diagram of a model training device provided by an embodiment of the present application. Detailed implementation manners

[0104] Many specific details are set forth in the following description in order to provide a thorough understanding of the present application. However, the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the connotation of the present application. Therefore, the present application is not limited by the specific implementations disclosed below.

[0105] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more of the associated listed items.

[0106] It should be understood that although the terms first, second, etc. may be used in one or more embodiments of the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".

[0107] First, the noun terms involved in one or more embodiments of the present invention are explained.

[0108] Speech synthesis system: A software model system that converts text into corresponding pronunciations.

[0109] Chinese character pronunciation conversion: The process of converting a corresponding Chinese character into its corresponding pronunciation (for example, "ancient capital" is converted through Chinese character pronunciation conversion to obtain the corresponding pronunciation "gu3 du1").

[0110] Elimination of polyphonic character ambiguity: In a speech synthesis system, Chinese character pronunciation conversion is an essential module, and elimination of polyphonic character ambiguity is the core of the Chinese character pronunciation conversion module. In Chinese, some characters correspond to two or more pronunciations. Elimination of polyphonic character ambiguity refers to how to enable the model in the computer to accurately distinguish the correct pronunciation of polyphonic characters through the context information in Chinese, so that the Chinese character pronunciation conversion module can obtain the correct pronunciation of polyphonic characters.

[0111] POS: The full English name is part of speech, and the full Chinese name is part-of-speech tagging.

[0112] Word embedding: The word embedding layer converts the input character sequence into a vector form in a high-dimensional space.

[0113] BLSTM: Bidirectional LSTM layer, a basic structural unit of a neural network, designed to extract the context information of the input sequence.

[0114] Full-connect layer: The fully connected layer, a basic structural unit of a neural network.

[0115] LSTM: The full English name is Long Short-Term Memory, and the full Chinese name is Long Short-Term Memory Network.

[0116] Jieba: A Chinese word segmentation tool with the Chinese name "Jieba". For example, for the sentence "In ancient capital Xi'an", based on this Jieba analysis tool, it will be segmented into "In / Ancient capital / Xi'an".

[0117] Hanlp: A toolkit composed of a series of model algorithms, combining distributed natural language processing of deep neural networks, with the characteristics of complete functions, high performance, clear architecture, up-to-date corpus, and customizable. It provides functions such as lexical analysis, Chinese word segmentation, syntactic analysis, text analysis, and sentiment analysis.

[0118] In the prior art, in the rule-based polyphone ambiguity elimination system, there is a problem that a polyphone may match multiple rules, or one rule may match multiple correct pronunciations of a certain polyphone, resulting in rule conflicts. For example, for the word "朝阳" (zhaoyang or chaoyang), the defined rule is that when "朝阳" appears as an adjective, the pronunciation is "chao1yang2". However, in sentence 1 "The direction of the rising sun is full of sunlight", the adjective "朝阳" should be pronounced as "chao1yang2"; in sentence 2 "The computer industry is a rising industry", the same adjective "朝阳" should be pronounced as "zhao1yang2". Therefore, through the rule-based polyphone ambiguity elimination system, the problem of the correct pronunciation of polyphones in Chinese sentences has not been well solved.

[0119] And the neural network polyphone ambiguity elimination system based on statistical models is mainly divided into two types according to different forms of feature extraction:

[0120] The first method uses a neural network as a feature extraction module. However, this feature extraction module has the problem of complex feature forms. The extracted feature dimension (i.e., feature vector length) is usually 256 or 512. The dimension is too high, which greatly increases the cost of model training and reasoning and reduces prediction efficiency.

[0121] The second method is to use the traditional semantic analysis process as the feature extraction module. However, this feature extraction module requires a large feature vocabulary and the encoding is not accurate enough. In addition, the traditional semantic analysis process only considers the text context semantic information, the feature combination is single, and the feature information is too little, which greatly increases the technical difficulty of the polyphone ambiguity elimination task.

[0122] Therefore, in order to solve the above technical problems, in the present application, a polyphone processing method and device, a model training method and device, a computing device and a computer-readable storage medium are provided, which are described in detail one by one in the following embodiments.

[0123] Figure 1 The structure block diagram of a computing device 100 according to an embodiment of the present application is shown. The components of the computing device 100 include but are not limited to a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and the database 150 is used to store data.

[0124] The computing device 100 also includes an access device 140 that enables the computing device 100 to communicate via one or more networks 160. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 140 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0125] In one embodiment of the present application, the above components of the computing device 100 and Figure 1 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 1 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.

[0126] The computing device 100 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 100 can also be a mobile or stationary server.

[0127] Wherein, the processor 120 can execute Figure 2 the steps in the model training method shown. Figure 2 The flowchart of a model training method provided according to an embodiment of the present application is shown, specifically including the following steps.

[0128] Step 202: Obtain a Chinese sentence sample containing polyphonic characters and the label corresponding to the Chinese sentence sample.

[0129] Wherein, a polyphonic character is a Chinese character corresponding to two or more pronunciations. For example, the pronunciations corresponding to the polyphonic character "dou" include: "du", "dou", and the pronunciations corresponding to the polyphonic character "dan" include: "dan", "chan", "shan", etc.

[0130] Then the Chinese sentence sample containing polyphonic characters can be understood as: a Chinese sentence sample containing at least one polyphonic character; in this model training method, the Chinese sentence containing at least one polyphonic character is used as a training sample to implement polyphonic character disambiguation model training.

[0131] Specifically, the label corresponding to the Chinese sentence sample is the pronunciation corresponding to the polyphonic character in the Chinese sentence sample; taking the Chinese sentence sample "In the ancient capital Xi'an" as an example, the polyphonic character in this Chinese sentence sample is "dou", and the label corresponding to this Chinese sentence sample is the pronunciation "du" corresponding to the polyphonic character "dou".

[0132] In specific implementation, when performing polyphonic character disambiguation model training, multiple Chinese sentence samples containing polyphonic characters and the label corresponding to each Chinese sentence sample are obtained as training samples to implement polyphonic character disambiguation model training; in practical applications, the trained polyphonic character disambiguation model is applied to a speech synthesis system, and when implementing phonetic conversion in the speech synthesis system, the polyphonic characters in the text are disambiguated to ensure the accuracy of phonetic conversion.

[0133] Step 204: Determine the first position feature of the polyphonic character in the Chinese sentence sample.

[0134] For ease of understanding, in the embodiments of this specification, a Chinese sentence sample containing a polyphonic character is used as an example to introduce the model training method. For the specific processing methods of other Chinese sentence samples containing polyphonic characters, reference can be made to this embodiment.

[0135] Specifically, determining the first position feature of the polyphonic character in the Chinese sentence sample includes:

[0136] Obtaining the polyphonic character in the Chinese sentence sample, and determining the position index value of the polyphonic character in the Chinese sentence sample and the total length of the Chinese sentence sample;

[0137] Based on the position index value of the polyphonic character in the Chinese sentence sample and the total length of the Chinese sentence sample, calculate to obtain the first position feature of the polyphonic character in the Chinese sentence sample.

[0138] Among them, the first position feature represents the relative position feature of the polyphonic character in the Chinese sentence sample, that is, the sentence relative position vector.

[0139] In specific implementation, after obtaining the Chinese sentence sample containing the polyphonic character and the label corresponding to the Chinese sentence sample, first obtain the polyphonic character in the Chinese sentence sample, and then based on the position index value of the polyphonic character in the Chinese sentence sample and the total length of the Chinese sentence sample, calculate to obtain the first position feature of the polyphonic character in the Chinese sentence sample.

[0140] Still taking the Chinese sentence sample containing the polyphonic character "dou" (both) as an example, such as "In the ancient capital Xi'an", first obtain the polyphonic character "dou" in the Chinese sentence sample, and then determine the position index value of the polyphonic character "dou" in "In the ancient capital Xi'an" and the total length of the sentence "In the ancient capital Xi'an". For details, see Table 1.

[0141] Table 1

[0142] Chinese sentence samples with polyphonetic characters exist antiquity All West install Index value (i) 0 1 2 3 4

[0143] The index value subscript of the first character in the Chinese sentence starts from 0. Therefore, referring to Table 1, the position index value of the polyphonic character "dou" in "In the ancient capital Xi'an" is 2, and the total length of the sentence "In the ancient capital Xi'an" is 5.

[0144] Assume that the position index value of the polyphonic character "dou" in the sentence "In the ancient capital Xi'an" is represented by i, the total length of the sentence "In the ancient capital Xi'an" is represented by a, and the first position feature is represented by f. Then the first position feature of the polyphonic character "dou" in "In the ancient capital Xi'an" can be calculated by Formula 1:[[]]

[0145] f = i / (a - 1) Formula 1

[0146] From formula 1, we can know that the first position feature f=2 / (5-1)=0.5, where the value range of the first position feature value is [0, 1]. The closer the value is to 0, the closer the position of the polyphone is to the beginning of the sentence. Conversely, the closer the value is to 1, the closer the position of the polyphone is to the end of the sentence.

[0147] In the embodiments of the present specification, the first position feature of the polyphone in the Chinese sentence sample is calculated by using the position index value of the polyphone in the Chinese sentence sample and the total length of the Chinese sentence sample. When the polyphone disambiguation model is subsequently trained, the first position feature can be introduced to enrich the diversity of feature combinations in the disambiguation task, so that the polyphone disambiguation model has a more comprehensive understanding of the contextual information in the Chinese sentence sample, thereby improving the prediction accuracy of the polyphone disambiguation model.

[0148] Step 206: Segment the Chinese sentence sample, and determine the part-of-speech features of the polyphone based on the words obtained by segmentation and the part-of-speech of the words.

[0149] In practical applications, the part-of-speech feature of a polyphonetic character represents the part-of-speech vector of the polyphonetic character.

[0150] In a specific implementation, before the Chinese sentence sample is segmented, the method further includes:

[0151] The numbers contained in the Chinese sentence sample are filtered out.

[0152] Taking the Chinese sentence sample "I spent 80,000 yuan to buy a car", and "In 1994, I spent 20,000 yuan to buy a car" as an example, after filtering out the numbers contained in the Chinese sentence sample, the obtained Chinese sentence sample is "I spent 10,000 yuan to buy a car".

[0153] In actual applications, numbers do not have polyphones. Therefore, in order to reduce unnecessary features in Chinese sentence samples and improve the training efficiency of the polyphone disambiguation model, before the Chinese sentence samples are segmented, the Chinese sentence samples will be traversed and the numbers contained in the Chinese sentence samples will be filtered out to improve the word segmentation efficiency of the Chinese sentence samples and the subsequent training efficiency of the polyphone disambiguation model.

[0154] After filtering the numbers in the Chinese sentence samples, the filtered Chinese sentence samples can be segmented. The specific implementation method is as follows:

[0155] The word segmentation of the Chinese sentence sample includes:

[0156] The Chinese sentence samples after filtering the numbers are segmented through the preset word segmentation tool, and the part-of-speech tags are performed on the segmented words.

[0157] Among them, the preset word segmentation tool includes, but is not limited to, word segmentation tools such as Jieba or Hanlp, and any other word segmentation tool that can implement word segmentation and part-of-speech tagging for Chinese sentences can be used. This specification does not make any limitation in this regard.

[0158] Still taking the Chinese sentence sample "in the ancient capital Xi'an" as an example, the results of word segmentation of this Chinese sentence sample based on word segmentation tools such as Jieba or Hanlp are shown in Table 2.

[0159] Table 2

[0160]

[0161] Referring to Table 2, the Chinese sentence sample "in the ancient capital Xi'an" is segmented into three words: "in", "ancient capital", and "Xi'an". Among them, each word corresponds to a part of speech and an index value j.

[0162] In the embodiments of this specification, the Chinese sentence sample after digital filtering can be segmented based on word segmentation tools such as Jieba or Hanlp, and part-of-speech tagging can be performed on the words formed by the segmented Chinese sentence. Subsequently, based on the words after segmentation of the Chinese sentence sample and the part of speech of each word, the part-of-speech characteristics of polyphonic characters in the Chinese sentence sample can be determined to enrich the diversity of the characteristics for training the polyphonic character disambiguation model.

[0163] Then, the specific implementation method for determining the part-of-speech characteristics of polyphonic characters in the Chinese sentence sample based on the words after segmentation of the Chinese sentence sample and the part of speech of each word is as follows:

[0164] Determining the part-of-speech characteristics of the polyphonic character based on the words obtained by word segmentation and the part of speech of the words includes:

[0165] Obtain the words after segmentation of the Chinese sentence sample, and determine the part of speech of each word;

[0166] Determine the part-of-speech characteristics of the polyphonic character as the part of speech of the word containing the polyphonic character, the part of speech of the word adjacent to the word containing the polyphonic character before it, and the part of speech of the word adjacent to the word containing the polyphonic character after it.

[0167] Still taking the above as an example, referring to Table 2, the words obtained after segmentation of the Chinese sentence sample "in the ancient capital Xi'an" are: "in", "ancient capital", and "Xi'an". Determine the part of speech of each word as: the part of speech of the word "in" is p, the part of speech of the word "ancient capital" is n, and the part of speech of the word "Xi'an" is ns;

[0168] Then, the word "ancient capital" containing the polyphonic character, the part of speech of the word "ancient capital", the part of speech p of the previous word "in" adjacent to the word "ancient capital", and the part of speech ns of the next word "Xi'an" adjacent to the word "ancient capital" are used as the part of speech features of the polyphonic character "dou", that is, the part of speech features of the polyphonic character "dou" are: p ancient capital_n ns.

[0169] In the embodiments of this specification, based on the words after segmenting the Chinese sentence sample and the part of speech of each word, the part of speech features of the polyphonic characters in the Chinese sentence sample are determined, and the context information of the polyphonic characters is introduced into the training of the polyphonic character disambiguation model through these part of speech features, greatly improving the prediction accuracy of the subsequent polyphonic character disambiguation model.

[0170] Step 208: Obtain the word containing the polyphonic character, and determine the second position feature of the polyphonic character in the word containing the polyphonic character.

[0171] Among them, the second position feature represents the relative position feature of the polyphonic character in the words of the segmented Chinese sentence sample, that is, the word relative position vector.

[0172] Specifically, when segmenting the Chinese sentence sample and determining the part of speech features of the polyphonic character based on the segmented words and the part of speech of the words, the second position feature of the polyphonic character in the words will also be obtained. The specific implementation method is as follows:

[0173] The determination of the second position feature of the polyphonic character in the word containing the polyphonic character includes:

[0174] Determine the position index value of the polyphonic character in the word containing the polyphonic character and the total length of the word containing the polyphonic character;

[0175] Based on the position index value of the polyphonic character in the word containing the polyphonic character and the total length of the word containing the polyphonic character, calculate to obtain the second position feature of the polyphonic character in the word containing the polyphonic character.

[0176] Continuing with the above example, it can be seen from Table 2 that the position index of the polyphonic character "dou" in the word "ancient capital" containing the polyphonic character is 1, and the total length of the word "ancient capital" containing the polyphonic character "dou" is 2.

[0177] Assume that the position index value of the polyphonic character "dou" in the word "ancient capital" is represented by j, the total length of the word "ancient capital" is represented by b, and the second position feature is represented by g. Then, the second position feature of the polyphonic character "dou" in "ancient capital" can be calculated by Formula 2:

[0178] g = j / (b - 1) Formula 2

[0179] From formula 2, we can know that the second position feature g=1 / (2-1)=1, where the value range of the second position feature value is also [0, 1]. The closer the value is to 0, the closer the position of the polyphone is to the beginning of the word. Conversely, the closer the value is to 1, the closer the position of the polyphone is to the end of the word.

[0180] In the embodiments of the present specification, the second position feature of the polyphone in the word after word segmentation of the Chinese sentence sample is calculated by using the position index value of the polyphone in the word after word segmentation of the Chinese sentence sample and the total length of the word. When the polyphone disambiguation model is subsequently trained, the second position feature can be introduced to enrich the diversity of feature combinations in the disambiguation task, so that the polyphone disambiguation model has a more comprehensive understanding of the contextual information in the Chinese sentence sample, thereby improving the prediction accuracy of the polyphone disambiguation model.

[0181] Step 210: Train a polyphone disambiguation model based on the first position feature, the part-of-speech feature, the second position feature, and the label corresponding to the Chinese sentence sample to obtain the polyphone disambiguation model.

[0182] In specific implementation, after obtaining the first position features, part-of-speech features and second position features of polyphones in Chinese sentence samples, these features and the corresponding labels of the Chinese sentence samples are combined into training samples, and the polyphone disambiguation model is trained to obtain the polyphone disambiguation model.

[0183] The polyphone disambiguation model includes a word embedding layer, a BLSTM layer and a fully connected layer.

[0184] During specific training, the training samples are input into the polyphone disambiguation model. The final polyphone disambiguation model can be obtained through the training of each layer and the adjustment of the loss function. In practical applications, in order to achieve better prediction results of the polyphone disambiguation model, two or more BLSTM layers are set to improve the prediction accuracy of the polyphone disambiguation model.

[0185] In the embodiments of the present specification, the model training method solves the problem of too large a vocabulary required for the neural network model by adopting word relative position features, sentence relative position features, and part of speech of polyphones to form new part-of-speech information features, thereby greatly improving the training efficiency of the polyphone disambiguation model. In addition, the introduction of word relative position features and sentence relative position features of polyphones enriches the diversity of feature combinations in the disambiguation task, making the neural network model more fully understand the contextual information in Chinese sentences, thereby improving the prediction accuracy of the polyphone disambiguation model.

[0186] See also Figure 3 , Figure 3The flowchart of a method for processing polyphonic characters provided by an embodiment of the present application is shown, which specifically includes the following steps.

[0187] Step 302: Receive a Chinese sentence containing polyphonic characters, and determine the first position feature of the polyphonic character in the Chinese sentence.

[0188] Wherein, a polyphonic character is a Chinese character corresponding to two or more pronunciations. For example, the pronunciations corresponding to the polyphonic character "dou" include: "du", "dou", and the pronunciations corresponding to the polyphonic character "dan" include: "dan", "chan", "shan", etc.

[0189] Then the Chinese sentence containing polyphonic characters can be understood as: a Chinese sentence containing at least one polyphonic character; in practical applications, the structure of the Chinese sentence containing polyphonic characters is the same as that of the Chinese sentence sample in the model training method, both being Chinese sentences containing one or more polyphonic characters.

[0190] Specifically, determining the first position feature of the polyphonic character in the Chinese sentence includes:

[0191] Obtain the polyphonic characters in the Chinese sentence, and determine the position index value of the polyphonic character in the Chinese sentence and the total length of the characters in the Chinese sentence;

[0192] Based on the position index value of the polyphonic character in the Chinese sentence and the total length of the characters in the Chinese sentence, calculate and obtain the first position feature of the polyphonic character in the Chinese sentence.

[0193] Step 304: Segment the Chinese sentence, and determine the part-of-speech feature of the polyphonic character based on the words obtained by segmentation and the part-of-speech of the words.

[0194] In another embodiment of this specification, before segmenting the Chinese sentence, it further includes:

[0195] Filter out the numbers contained in the Chinese sentence.

[0196] In another embodiment of this specification, segmenting the Chinese sentence includes:

[0197] Segment the Chinese sentence after filtering the numbers through a preset segmentation tool and perform part-of-speech tagging on the segmented words.

[0198] In another embodiment of this specification, determining the part-of-speech feature of the polyphonic character based on the words obtained by segmentation and the part-of-speech of the words includes:

[0199] Obtain the words after segmenting the Chinese sentence, and determine the part-of-speech of each word;

[0200] The word containing the polyphone, the part of speech of the word containing the polyphone, the part of speech of the previous word adjacent to the word containing the polyphone, and the part of speech of the next word adjacent to the word containing the polyphone are determined as part-of-speech features of the polyphone.

[0201] Step 306: Acquire a word containing a polyphonetic character, and determine a second position feature of the polyphonetic character in the word containing the polyphonetic character.

[0202] In another embodiment of the present specification, the determining of the second position feature of the polyphonetic character in the word containing the polyphonetic character includes:

[0203] Determine the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character;

[0204] Based on the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character, a second position feature of the polyphonetic character in the word containing the polyphonetic character is calculated.

[0205] During specific implementation, in the polyphone processing method of the embodiments of this specification, the implementation details such as the calculation of the first position features of the polyphone in the Chinese sentence, the calculation of the second position features in the words containing the polyphone, the filtering of numbers in the Chinese sentence, the word segmentation and part-of-speech tagging of the Chinese sentence can all be found in the specific processing process of the Chinese sentence samples and the polyphone of the Chinese sentence samples in the above-mentioned model training method embodiment, and will not be repeated here.

[0206] Step 308: Input the first position feature, the part-of-speech feature, and the second position feature into a polyphone disambiguation model to obtain the pronunciation corresponding to the polyphone.

[0207] The polyphone disambiguation model is the polyphone disambiguation model obtained by training in the above-mentioned model training method. For specific model training details, please refer to the embodiment of the above-mentioned model training method.

[0208] Specifically, the polyphone disambiguation model includes a word embedding layer, a BLSTM layer, and a fully connected layer;

[0209] Correspondingly, inputting the first position feature, the part-of-speech feature, and the second position feature into a polyphone disambiguation model to obtain the pronunciation corresponding to the polyphone includes:

[0210] Inputting the first position feature, the part-of-speech feature, and the second position feature into the word embedding layer for encoding to obtain a first vector;

[0211] Input the first vector into the BLSTM layer to obtain context information to obtain a second vector;

[0212] Inputting the second vector into the fully connected layer to obtain candidate pronunciations of the polyphonetic character and a probability value of each candidate pronunciation;

[0213] The candidate pronunciation with the highest probability value is output as the pronunciation corresponding to the polyphonetic character.

[0214] Specifically, after obtaining the first position feature, part-of-speech feature and second position feature of the polyphone, all of the above contents are input into the trained polyphone disambiguation model, and first encoded in the word embedding layer of the polyphone disambiguation model to be encoded as a first vector; then the first vector is passed through the BLSTM layer to obtain context information to obtain a second vector; the second vector is then passed through the fully connected layer to obtain the probability distribution of all potential pronunciation options for the polyphone, and all potential pronunciations corresponding to the polyphone and the probability value of each potential pronunciation are displayed in the probability distribution; finally, the pronunciation with the highest probability value in the probability distribution is selected as the output of the polyphone disambiguation model, that is, the pronunciation corresponding to the polyphone is obtained.

[0215] In the embodiments of the present specification, the polyphone processing method forms new part-of-speech information features based on the relative position features of the polyphone in Chinese sentences and words after word segmentation, as well as the part-of-speech features of the polyphone, and inputs them into a polyphone disambiguation model to predict the pronunciation of the polyphone, thereby replacing the rule-based prediction of the correct pronunciation of the polyphone, and effectively solving the problem of rule conflict that occurs when the correct pronunciation of the polyphone is predicted based on rules in the prior art.

[0216] In addition, the polyphone processing method can greatly reduce the size of the vocabulary required for the polyphone disambiguation model by combining the position features and part-of-speech features of the polyphones to predict the pronunciation of the polyphones, thereby solving the problem of too large a vocabulary required for the neural network model; and by encoding the relative position features of the polyphones in the Chinese sentences and the words after word segmentation into feature vectors, the diversity of feature combinations in the polyphone disambiguation task is enriched, so that the polyphone disambiguation model has a more comprehensive understanding of the contextual information in the Chinese sentence, effectively reducing the problem of missing encoding information in the actual application process, thereby improving the accuracy of the predicted pronunciation corresponding to the polyphones.

[0217] See also Figure 4 , Figure 4 A flowchart is shown of a method for processing polyphones provided in an embodiment of the present application for processing "in the ancient capital of Xi'an" as a Chinese sentence containing polyphones, which specifically includes the following steps.

[0218] Step 402: Receive the Chinese sentence “in the ancient capital of Xi’an”.

[0219] In specific implementation, "in ancient capital Xi'an" is used as the input of the polyphone disambiguation model, and the corresponding pronunciation of the polyphone "dou" is output based on this polyphone disambiguation model.

[0220] Step 404: Calculate the sentence relative position feature.

[0221] In practical applications, before inputting into the polyphone disambiguation model, the position feature and part-of-speech feature of "in ancient capital Xi'an" will be extracted, and the extracted features will be used as the input of the polyphone disambiguation model.

[0222] Specifically, as can be seen from Table 1, the position index value of the polyphone "dou" in the Chinese sentence "in ancient capital Xi'an" is 2, and the total length of this Chinese sentence is 5. Then, based on the above calculation method, the sentence relative position feature value of this polyphone "dou" can be obtained as 0.5.

[0223] Step 406: Filter the numbers in the sentence.

[0224] Specifically, traverse the input Chinese sentence and filter out the numbers in the Chinese sentence to improve the subsequent processing speed.

[0225] Step 408: Segment the sentence and perform part-of-speech tagging.

[0226] Specifically, use the word segmentation tool to segment the Chinese sentence "in ancient capital Xi'an" into individual words, and perform part-of-speech tagging on each word formed after segmentation. For example, after segmenting and performing part-of-speech tagging on "in ancient capital Xi'an", "in p / ancient capital n / Xi'an ns" can be obtained.

[0227] Step 410: Extract the words containing polyphones after segmentation, the part-of-speech of this word, the part-of-speech of the previous word of this word, and the part-of-speech of the next word of this word to form the part-of-speech feature.

[0228] Specifically, extract the word "ancient capital" containing the polyphone after segmentation, and the part-of-speech n of "ancient capital". Then extract the part-of-speech p of the previous word "in" of "ancient capital", and the part-of-speech ns of the next word "Xi'an". Form the part-of-speech feature of the polyphone "dou" as "p ancient capital_n ns".

[0229] Step 412: Calculate the word relative position feature.

[0230] Specifically, as can be seen from Table 2, the position index value of the polyphone "dou" in the word "ancient capital" after segmentation is 1, and the total length of this word is 2. Then, based on the above calculation method, the word relative position feature value of this polyphone "dou" can be obtained as 1.

[0231] Among them, the execution order between step 404 and step 406, and the execution order between step 410 and step 412 do not have an inevitable front-back relationship and can be executed according to actual applications. This specification does not make any restrictions on this.

[0232] Step 414: Form the final input of the polyphonic character disambiguation model with the sentence relative position feature, part-of-speech feature, and word relative position feature.

[0233] Specifically, input "p ancient capital_n ns 1 0.5" into the polyphonic character disambiguation model.

[0234] Step 416: Input "p ancient capital_n ns 1 0.5" into the polyphonic character disambiguation model for prediction.

[0235] Specifically, encode the feature [p ancient capital_n ns 1 0.5] into a corresponding digital index value vector through a word table, such as [0, 1, 2, 3, 4, 5], and then encode it into a word vector A through a word embedding layer. The word vector A obtains context information through two layers of bidirectional LSTM layers (BLSTM) to obtain a vector B. The vector B passes through a full-connect layer to obtain the probability distribution of the potential pronunciation options of the polyphonic character "dou", and then select the result with the highest probability value in the probability distribution as the output of the polyphonic character disambiguation model, that is, obtain the pronunciation corresponding to the polyphonic character "dou".

[0236] Step 418: Obtain the pronunciation "du1" corresponding to the polyphonic character "dou" output by the polyphonic character disambiguation model.

[0237] In the embodiments of this specification, the polyphonic character processing method takes the sentence relative position feature, word relative position feature, and part-of-speech feature of the polyphonic character "dou" as the input of the polyphonic character disambiguation model, and inputs them into the polyphonic character disambiguation model to obtain the pronunciation of the polyphonic character "dou". Through the above features, the problem of the large word table required by the neural network model is solved; and through the sentence relative position feature and word relative position feature of the polyphonic character, the diversity of feature combinations in the polyphonic character disambiguation task is enriched, so that the polyphonic character disambiguation model can understand the context information in the Chinese sentence more fully, thereby improving the accuracy of the pronunciation corresponding to the predicted polyphonic character.

[0238] Still taking the Chinese sentence containing the polyphonic character "in the ancient capital Xi'an" as an example, when training the model or processing the polyphonic character using the feature form of the model training method and the text processing method provided in the embodiments of this specification, it can effectively reduce the word table size for explanation.

[0239] First, the word list is explained. The word list records the correspondence between the characters themselves and numbers. Since neural network models cannot process Chinese characters, the common practice is to encode Chinese characters into numbers and then process the encoded numbers of Chinese characters to achieve the processing of Chinese sentences containing polyphonic characters.

[0240] Referring to Table 2, the feature forms extracted in the model training method and the text processing method are both [p ancient capital_n ns 1 0.5], and the feature dimension (i.e., the number of elements) is 6; among them, "p ancient capital_n ns" is the part-of-speech vector of the polyphonic character "dou", that is, the part-of-speech feature; "1" is the relative position feature of the word of the polyphonic character "dou", that is, the second position feature; "0.5" is the relative position feature of the sentence of the polyphonic character "dou", that is, the first position feature; and in "p ancient capital_n ns", p is the part of speech of the previous word "zai" adjacent to the word "ancient capital" where the polyphonic character "dou" is located, "ancient capital" is the word "ancient capital" where the polyphonic character "dou" is located, "n" is the part of speech of the word "ancient capital" where the polyphonic character "dou" is located, and "ns" is the part of speech of the next word "Xi'an" adjacent to the word "ancient capital" where the polyphonic character "dou" is located.

[0241] Then, the word list corresponding to the input sentence "in the ancient capital Xi'an" can be expressed as {"p": 0, "gu": 1, "dou_n": 2, "ns": 3, "1": 4, "0.5": 5}. This word list contains 6 elements, so the size of the word list is 6; in practical applications, the word list encoding of the input sentence "in the ancient capital Xi'an" can be determined according to actual applications, and this specification does not make any restrictions on this.

[0242] When specifically predicting the pronunciation of the polyphonic character "dou" in "in the ancient capital Xi'an" based on the polyphonic character disambiguation model, the feature [p ancient capital_n ns 1 0.5] is encoded into a vector of [0, 1, 2, 3, 4, 5] through the word list defined above, and this vector is input into the polyphonic character disambiguation model for Wordembedding and subsequent prediction processing.

[0243] The meaning of the word list is to make each input sentence can be encoded into a corresponding digital vector for convenient use. Therefore, the word list needs to cover every situation of the input sentence (that is, the input feature), so it also needs to be large enough. The following details the theoretically size of the word list.

[0244] Still taking the Chinese sentence "in the ancient capital Xi'an" as an example, the feature form [p ancient capital_n ns 1 0.5] determined by the above method mainly includes three parts:

[0245] "p, n, ns" are part-of-speech information. There are about 40 kinds of Chinese part-of-speech information. Therefore, the word list needs to encode these 40 symbols.

[0246] "Gu" is a common Chinese character. There are approximately 10,000 common Chinese characters, so the vocabulary needs to encode 10,000 Chinese characters;

[0247] "1, 0.5" are position encoding values, and there are only 11 cases: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1].

[0248] Therefore, the key factor affecting the size of the vocabulary lies in the special characters combining polyphonic characters and parts of speech, that is, "dou_n".

[0249] Next, compare the size of the vocabulary in a classic feature form with the size of the vocabulary in the feature form of the embodiments of this specification:

[0250] Input: In the ancient capital Xi'an

[0251] A classic feature form: [p / gu_n / dou_n / ns]

[0252] The feature form of the embodiments of this specification: [p / gu / dou_n / ns / 1 0.5]

[0253] Then, the size of the vocabulary in a classic feature form:

[0254] Part-of-speech information: 40;

[0255] Polyphonic characters and part-of-speech combination information: There are approximately 1,000 common polyphonic characters, and the part-of-speech information is 40, 1,000 * 40 = 40,000;

[0256] Common Chinese characters and part-of-speech combination information: There are approximately 10,000 common Chinese characters (excluding polyphonic characters), and the part-of-speech information is 40, 10,000 * 40 = 400,000;

[0257] The size of this classic feature form vocabulary is: 40 + 40,000 + 400,000, approximately 440,000.

[0258] The size of the vocabulary in the feature form of the embodiments of this specification:

[0259] Part-of-speech information: 40;

[0260] Polyphonic characters and part-of-speech combination information: There are approximately 1,000 common polyphonic characters, and the part-of-speech information is 40, 1,000 * 40 = 40,000;

[0261] Common Chinese characters: 10,000 common Chinese characters (excluding polyphonic characters);

[0262] Position encoding values: There are only 11 cases: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1];

[0263] The size of the feature form word list in the embodiment of this specification is: 40+40000+10000+11, which is about 50,000.

[0264] It can be seen that the feature form proposed in the embodiment of this specification can reduce the vocabulary size from 440,000 to 50,000 compared to the classic feature form. In the process of polyphone disambiguation, which requires a vocabulary to encode and decode Chinese, the retrieval speed of the vocabulary content can be greatly improved by reducing the vocabulary rules, thereby improving the system operation speed in practical applications and improving the prediction efficiency of polyphones. The construction of the vocabulary is usually summarized and counted by training data. Another advantage of reducing the vocabulary is that it reduces the amount of training data used and the cost of manually constructing the vocabulary, thereby improving the training speed of the polyphone disambiguation model and ensuring the accuracy of Chinese encoding and decoding.

[0265] Corresponding to the above method embodiment, the present application also provides a polyphonetic character processing device embodiment, Figure 5 FIG. 1 is a schematic diagram showing the structure of a polyphonetic character processing device provided by an embodiment of the present application. Figure 5 As shown, the device comprises:

[0266] A first position feature determination module 502 is configured to receive a Chinese sentence containing a polyphonetic character and determine a first position feature of the polyphonetic character in the Chinese sentence;

[0267] A part-of-speech feature determination module 504 is configured to segment the Chinese sentence and determine the part-of-speech feature of the polyphone based on the words obtained by segmentation and the part-of-speech of the words;

[0268] The second position feature determination module 506 is configured to obtain a word containing a polyphonetic character and determine a second position feature of the polyphonetic character in the word containing the polyphonetic character;

[0269] The pronunciation obtaining module 508 is configured to input the first position feature, the part-of-speech feature and the second position feature into a polyphone disambiguation model to obtain the pronunciation corresponding to the polyphone.

[0270] Optionally, the first location feature determination module 502 is further configured to:

[0271] Obtaining polyphones in the Chinese sentence, and determining position index values ​​of the polyphones in the Chinese sentence and the total length of the Chinese sentence;

[0272] Based on the position index value of the polyphone in the Chinese sentence and the total length of the Chinese sentence, a first position feature of the polyphone in the Chinese sentence is calculated.

[0273] Optionally, the device further includes:

[0274] The first number filtering module is configured to filter out numbers contained in the Chinese sentence.

[0275] Optionally, the part-of-speech feature determination module is further configured to:

[0276] The Chinese sentences after filtering the numbers are segmented through the preset segmentation tool, and the parts of speech are tagged for the segmented words.

[0277] Optionally, the part-of-speech feature determination module 504 is further configured to:

[0278] Obtaining words after word segmentation of the Chinese sentence, and determining the part of speech of each word;

[0279] The word containing the polyphone, the part of speech of the word containing the polyphone, the part of speech of the previous word adjacent to the word containing the polyphone, and the part of speech of the next word adjacent to the word containing the polyphone are determined as part-of-speech features of the polyphone.

[0280] Optionally, the second location feature determination module 506 is further configured to:

[0281] Determine the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character;

[0282] Based on the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character, a second position feature of the polyphonetic character in the word containing the polyphonetic character is calculated.

[0283] Optionally, the polyphone disambiguation model includes a word embedding layer, a BLSTM layer, and a fully connected layer;

[0284] Accordingly, the pronunciation obtaining module 508 is further configured to:

[0285] Inputting the first position feature, the part-of-speech feature, and the second position feature into the word embedding layer for encoding to obtain a first vector;

[0286] Input the first vector into the BLSTM layer to obtain context information to obtain a second vector;

[0287] Inputting the second vector into the fully connected layer to obtain candidate pronunciations of the polyphonetic character and a probability value of each candidate pronunciation;

[0288] The candidate pronunciation with the highest probability value is output as the pronunciation corresponding to the polyphonetic character.

[0289] In the embodiments of the present specification, the polyphone processing device forms a new part-of-speech information feature by combining the relative position features of the polyphone in Chinese sentences and words after word segmentation, and the part-of-speech features of the polyphone, and inputs the new part-of-speech information feature into the polyphone disambiguation model to predict the pronunciation of the polyphone, thereby replacing the rule-based prediction of the correct pronunciation of the polyphone, and well solving the problem of rule conflict when the correct pronunciation of the polyphone is predicted based on rules in the prior art; in addition, the polyphone processing method combines the position features and part-of-speech features of the polyphone to predict the pronunciation of the polyphone, which can greatly reduce the scale of the vocabulary required by the polyphone disambiguation model and solve the problem of the neural network model requiring too large a vocabulary; and by encoding the relative position features of the polyphone in Chinese sentences and words after word segmentation into feature vectors, the diversity of feature combinations in the polyphone ambiguity elimination task is enriched, so that the polyphone disambiguation model has a more comprehensive understanding of the context information in the Chinese sentence, effectively reducing the problem of missing encoding information in the actual application process, thereby improving the accuracy of the predicted pronunciation corresponding to the polyphone.

[0290] Corresponding to the above method embodiment, the present application also provides a model training device embodiment, Figure 6 FIG. 1 is a schematic diagram showing the structure of a model training device provided by an embodiment of the present application. Figure 6 As shown, the device comprises:

[0291] A sample acquisition module 602 is configured to acquire Chinese sentence samples containing polyphones and labels corresponding to the Chinese sentence samples;

[0292] A sample first position feature determination module 604 is configured to determine a first position feature of the polyphonetic character in the Chinese sentence sample;

[0293] The sample part-of-speech feature determination module 606 is configured to segment the Chinese sentence sample, and determine the part-of-speech feature of the polyphone based on the words obtained by the segmentation and the part-of-speech of the words;

[0294] The sample second position feature determination module 608 is configured to obtain a word containing a polyphonetic character and determine a second position feature of the polyphonetic character in the word containing the polyphonetic character;

[0295] The model training module 610 is configured to train a polyphone disambiguation model based on the first position feature, the part-of-speech feature, the second position feature and the label corresponding to the Chinese sentence sample to obtain the polyphone disambiguation model.

[0296] Optionally, the sample first position feature determination module 604 is further configured to:

[0297] Acquire polyphones in the Chinese sentence sample, and determine the position index value of the polyphones in the Chinese sentence sample and the total length of the Chinese sentence sample;

[0298] Based on the position index value of the polyphone in the Chinese sentence sample and the total length of the Chinese sentence sample, a first position feature of the polyphone in the Chinese sentence sample is calculated.

[0299] Optionally, the device further includes:

[0300] The second filtering module is configured to filter out numbers contained in the Chinese sentence sample.

[0301] Optionally, the sample part-of-speech feature determination module is further configured to:

[0302] The Chinese sentence samples after filtering the numbers are segmented through the preset word segmentation tool, and the part-of-speech tags are performed on the segmented words.

[0303] Optionally, the sample part-of-speech feature determination module 606 is further configured to:

[0304] Obtaining words after word segmentation of the Chinese sentence sample, and determining the part of speech of each word;

[0305] The word containing the polyphone, the part of speech of the word containing the polyphone, the part of speech of the previous word adjacent to the word containing the polyphone, and the part of speech of the next word adjacent to the word containing the polyphone are determined as part-of-speech features of the polyphone.

[0306] Optionally, the sample second position feature determination module 608 is further configured to:

[0307] Determine the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character;

[0308] Based on the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character, a second position feature of the polyphonetic character in the word containing the polyphonetic character is calculated.

[0309] Optionally, the polyphone disambiguation model includes a word embedding layer, a BLSTM layer and a fully connected layer; and the label corresponding to the Chinese sentence sample is the pronunciation corresponding to the polyphone in the Chinese sentence sample.

[0310] In the embodiments of the present specification, the model training device solves the problem of too large a vocabulary required for the neural network model by using word relative position features, sentence relative position features, and part of speech of polyphones to form new part-of-speech information features, thereby greatly improving the training efficiency of the polyphone disambiguation model. In addition, the introduction of word relative position features and sentence relative position features of polyphones enriches the diversity of feature combinations in the disambiguation task, allowing the neural network model to have a more comprehensive understanding of the contextual information in the Chinese sentence, thereby improving the prediction accuracy of the polyphone disambiguation model.

[0311] In one embodiment of the present application, a computing device is also provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein when the processor executes the instructions, the steps of the polyphone processing method or the model training method are implemented.

[0312] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the polyphonetic character processing method or model training method described above are of the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the polyphonetic character processing method or model training method described above.

[0313] An embodiment of the present application also provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the polyphonetic character processing method or the model training method as described above.

[0314] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the polyphonetic character processing method or model training method described above belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the polyphonetic character processing method or model training method described above.

[0315] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0316] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0317] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0318] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0319] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.

Claims

1. A method for processing polyphones, characterized in that: include: Receiving a Chinese sentence containing a polyphonetic character, and determining a first position feature of the polyphonetic character in the Chinese sentence; Filter out the numbers contained in the Chinese sentence, segment the Chinese sentence, and determine the part-of-speech features of the polyphonetic character based on the words obtained by the segmentation and the part-of-speech of the words; Acquire a word containing a polyphonetic character, and determine a second position feature of the polyphonetic character in the word containing the polyphonetic character; Inputting the first position feature, the part-of-speech feature, and the second position feature into a polyphone disambiguation model to obtain a pronunciation corresponding to the polyphone, wherein the polyphone disambiguation model includes a word embedding layer, a BLSTM layer, and a fully connected layer; Correspondingly, inputting the first position feature, the part-of-speech feature, and the second position feature into a polyphone disambiguation model to obtain the pronunciation corresponding to the polyphone includes: Inputting the first position feature, the part-of-speech feature, and the second position feature into the word embedding layer for encoding to obtain a first vector; Input the first vector into the BLSTM layer to obtain context information to obtain a second vector; Inputting the second vector into the fully connected layer to obtain candidate pronunciations corresponding to the polyphonetic character and a probability value of each candidate pronunciation; The candidate pronunciation with the highest probability value is output as the pronunciation corresponding to the polyphonetic character.

2. The polyphonetic character processing method according to claim 1, characterized in that: Determining the first position feature of the polyphone in the Chinese sentence includes: Obtaining polyphones in the Chinese sentence, and determining position index values ​​of the polyphones in the Chinese sentence and the total length of the Chinese sentence; Based on the position index value of the polyphone in the Chinese sentence and the total length of the Chinese sentence, a first position feature of the polyphone in the Chinese sentence is calculated.

3. The polyphonetic character processing method according to claim 1, characterized in that: The word segmentation of the Chinese sentence includes: The Chinese sentences after filtering the numbers are segmented through the preset segmentation tool, and the parts of speech are tagged for the segmented words.

4. The polyphone processing method according to claim 3, characterized in that: The determining of the part-of-speech feature of the polyphonetic character based on the words obtained by word segmentation and the part-of-speech of the words includes: Obtaining words after word segmentation of the Chinese sentence, and determining the part of speech of each word; The word containing the polyphone, the part of speech of the word containing the polyphone, the part of speech of the previous word adjacent to the word containing the polyphone, and the part of speech of the next word adjacent to the word containing the polyphone are determined as part-of-speech features of the polyphone.

5. The polyphonetic character processing method according to claim 1 or 4, characterized in that: The determining of the second position feature of the polyphonetic character in the word containing the polyphonetic character comprises: Determine the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character; Based on the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character, a second position feature of the polyphonetic character in the word containing the polyphonetic character is calculated.

6. A model training method, characterized in that: include: Obtaining Chinese sentence samples containing polyphones and labels corresponding to the Chinese sentence samples; Determining a first position feature of the polyphone in the Chinese sentence sample; Filter out the numbers contained in the Chinese sentence, perform word segmentation on the Chinese sentence sample, and determine the part-of-speech features of the polyphonetic character based on the words obtained by word segmentation and the part-of-speech of the words; Acquire a word containing a polyphonetic character, and determine a second position feature of the polyphonetic character in the word containing the polyphonetic character; The polyphone disambiguation model is trained based on the first position feature, the part-of-speech feature, the second position feature, and the label corresponding to the Chinese sentence sample to obtain the polyphone disambiguation model, wherein the polyphone disambiguation model includes a word embedding layer, a BLSTM layer, and a fully connected layer, Correspondingly, the polyphone disambiguation model is trained based on the first position feature, the part-of-speech feature, the second position feature, and the label corresponding to the Chinese sentence sample to obtain the polyphone disambiguation model, including: Inputting the first position feature, the part-of-speech feature, and the second position feature into the word embedding layer for encoding to obtain a first vector; Input the first vector into the BLSTM layer to obtain context information to obtain a second vector; Inputting the second vector into the fully connected layer to obtain candidate pronunciations corresponding to the polyphonetic character and a probability value of each candidate pronunciation; The polyphone disambiguation model is trained based on the candidate pronunciations corresponding to the polyphone, the probability value of each candidate pronunciation, and the label corresponding to the Chinese sentence sample to obtain the polyphone disambiguation model.

7. The model training method according to claim 6, characterized in that: The determining of the first position feature of the polyphonetic character in the Chinese sentence sample comprises: Acquire polyphones in the Chinese sentence sample, and determine the position index value of the polyphones in the Chinese sentence sample and the total length of the Chinese sentence sample; Based on the position index value of the polyphone in the Chinese sentence sample and the total length of the Chinese sentence sample, a first position feature of the polyphone in the Chinese sentence sample is calculated.

8. The model training method according to claim 6, characterized in that: The word segmentation of the Chinese sentence sample includes: The Chinese sentence samples after filtering the numbers are segmented through the preset word segmentation tool, and the part-of-speech tags are performed on the segmented words.

9. The model training method according to claim 8, characterized in that: The determining of the part-of-speech feature of the polyphonetic character based on the words obtained by word segmentation and the part-of-speech of the words includes: Obtaining words after word segmentation of the Chinese sentence sample, and determining the part of speech of each word; The word containing the polyphone, the part of speech of the word containing the polyphone, the part of speech of the previous word adjacent to the word containing the polyphone, and the part of speech of the next word adjacent to the word containing the polyphone are determined as part-of-speech features of the polyphone.

10. The model training method according to claim 6 or 9, characterized in that: The determining of the second position feature of the polyphonetic character in the word containing the polyphonetic character comprises: Determine the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character; Based on the position index value of the polyphonetic character in the word containing the polyphonetic character and the total length of the word containing the polyphonetic character, a second position feature of the polyphonetic character in the word containing the polyphonetic character is calculated.

11. The model training method according to claim 6, characterized in that: The label corresponding to the Chinese sentence sample is the pronunciation corresponding to the polyphonetic character in the Chinese sentence sample.

12. A polyphonetic character processing device, characterized in that: include: A first position feature determination module is configured to receive a Chinese sentence containing a polyphonetic character and determine a first position feature of the polyphonetic character in the Chinese sentence; a part-of-speech feature determination module configured to filter out numbers contained in the Chinese sentence, segment the Chinese sentence, and determine the part-of-speech feature of the polyphone based on the words obtained by the segmentation and the part-of-speech of the words; A second position feature determination module is configured to obtain a word containing a polyphonetic character and determine a second position feature of the polyphonetic character in the word containing the polyphonetic character; A pronunciation acquisition module is configured to input the first position feature, the part-of-speech feature, and the second position feature into a polyphone disambiguation model to obtain a pronunciation corresponding to the polyphone, wherein the polyphone disambiguation model includes a word embedding layer, a BLSTM layer, and a fully connected layer; Correspondingly, the pronunciation acquisition module is further configured as follows: Inputting the first position feature, the part-of-speech feature, and the second position feature into the word embedding layer for encoding to obtain a first vector; Input the first vector into the BLSTM layer to obtain context information to obtain a second vector; Inputting the second vector into the fully connected layer to obtain candidate pronunciations corresponding to the polyphonetic character and a probability value of each candidate pronunciation; The candidate pronunciation with the highest probability value is output as the pronunciation corresponding to the polyphonetic character.

13. A model training device, characterized in that: include: A sample acquisition module, configured to acquire Chinese sentence samples containing polyphones and labels corresponding to the Chinese sentence samples; A sample first position feature determination module, configured to determine a first position feature of the polyphone in the Chinese sentence sample; a sample part-of-speech feature determination module, configured to filter out numbers contained in the Chinese sentence, segment the Chinese sentence sample, and determine the part-of-speech feature of the polyphonetic character based on the words obtained by the segmentation and the part-of-speech of the words; A sample second position feature determination module is configured to obtain a word containing a polyphonetic character and determine a second position feature of the polyphonetic character in the word containing the polyphonetic character; The model training module is configured to train a polyphone disambiguation model based on the first position feature, the part-of-speech feature, the second position feature, and the label corresponding to the Chinese sentence sample to obtain the polyphone disambiguation model, wherein the polyphone disambiguation model includes a word embedding layer, a BLSTM layer, and a fully connected layer. Accordingly, the model training module is further configured as follows: Inputting the first position feature, the part-of-speech feature, and the second position feature into the word embedding layer for encoding to obtain a first vector; Input the first vector into the BLSTM layer to obtain context information to obtain a second vector; Inputting the second vector into the fully connected layer to obtain candidate pronunciations corresponding to the polyphonetic character and a probability value of each candidate pronunciation; The polyphone disambiguation model is trained based on the candidate pronunciations corresponding to the polyphone, the probability value of each candidate pronunciation, and the label corresponding to the Chinese sentence sample to obtain the polyphone disambiguation model.

14. A computing device comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the instructions, it implements the steps of the polyphone processing method described in any one of claims 1-5 or the model training method described in any one of claims 6-11.

15. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by the processor, the steps of the polyphone processing method described in any one of claims 1-5 or the model training method described in any one of claims 6-11 are implemented.

Citation Information

Patent Citations

  • Method and device for determining pronunciation of polyphonic characters

    CN110277085A

  • Polyphone pronunciation disambiguation device and polyphone pronunciation disambiguation method

    CN111611810A