Method, device, electronic device and storage medium for recognizing homographs
Through neural network model and dual random inactivation technology, combined with homomorphic word pronunciation dictionary of various accent categories, the accuracy of homomorphic word pronunciation prediction and multi-accent support problems are solved, and efficient homomorphic word recognition is achieved .
Patent Information
- Application Number
- CN202210576039.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-24
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2042-05-24
AI Technical Summary
The prior art cannot accurately predict the pronunciation of homomorphic characters, especially the pronunciation prediction of homomorphic characters of multiple accent types, and the development cost of linguistic rules is high and difficult to maintain.
By obtaining the text to be recognized, input it into the neural network model obtained by training, the part-of-speech label of homomorphic characters is obtained, and it is determined based on the pronunciation phonemes of various accent categories in the preset homomorphic characters pronunciation dictionary, and the labeling label is set. And the model is trained using dual random inactivation technique.
Accurate pronunciation phoneme recognition of homomorphic characters is achieved, and the disambiguation of multiple accent types is supported, which reduces the development cost of linguistic rules and improves the recognition accuracy of the model.
Smart Images

Figure CN114999450B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of natural language processing, and in particular to a method, device, electronic device and storage medium for recognizing homographs. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the application that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.
[0003] With the development of artificial intelligence technology, text-to-speech (TTS) technology is widely used in educational products. Front-end text processing is an indispensable part of the TTS system, in which homograph disambiguation aims to predict the correct pronunciation of homographs based on the context of the sentence. Therefore, the homograph disambiguation task is a long-term issue that affects the speech correctness of English speech synthesis systems. The difference between homograph disambiguation and grapheme-to-phoneme (G2P) tasks is that G2P converts each word in a sentence to a phoneme, while homograph prediction only focuses on the pronunciation of homographs. G2P can also achieve the conversion of homographs to pronunciations, but the prediction error rate is high and cannot meet the needs of actual business. Summary of the invention
[0004] In view of the above technical problems, a method for accurately identifying homographs is urgently needed.
[0005] Based on the above purpose, the present application provides a method for identifying homographs, comprising:
[0006] Acquire a text to be recognized; wherein the text to be recognized includes homographs;
[0007] Inputting the text to be recognized into the trained neural network model to obtain the part-of-speech tag of the homograph;
[0008] Determining the pronunciation phonemes of the homograph in a preset homograph pronunciation dictionary based on the part-of-speech tag;
[0009] The homograph pronunciation dictionary includes pronunciation phonemes of homographs with multiple accent categories and pronunciation phonemes of homographs with a specific accent category.
[0010] In some exemplary embodiments, before determining the pronunciation phoneme of the homograph in a preset homograph pronunciation dictionary based on the part-of-speech tag, the method further includes:
[0011] Setting annotation labels for all homographs in the homograph pronunciation dictionary;
[0012] The process of setting the annotation label includes:
[0013] determining a target homograph from among all the homographs;
[0014] In response to determining that each part of speech of the target homograph corresponds to a pronunciation phoneme, setting each part of speech of the target homograph as a label of the pronunciation phoneme corresponding to it;
[0015] In response to determining that the target part of speech of the target homograph corresponds to multiple pronunciation phonemes, the pronunciation phoneme with the highest usage frequency is determined from the multiple pronunciation factors, the target part of speech is set as the annotation label corresponding to the pronunciation phoneme with the highest usage frequency, and annotation labels corresponding to the pronunciation phonemes other than the pronunciation phoneme with the highest usage frequency in the multiple pronunciation factors are set based on the meaning of the target homograph.
[0016] In some exemplary embodiments, setting the annotation labels corresponding to the other pronunciation phonemes in the plurality of pronunciation factors except the pronunciation phoneme with the highest usage frequency based on the meaning of the target homograph specifically includes:
[0017] determining a target pronunciation factor from among the other pronunciation phonemes;
[0018] Determining a target word meaning of the target homograph corresponding to the target pronunciation phoneme;
[0019] The annotation label corresponding to the target pronunciation phoneme is determined based on the target word meaning and the target part of speech.
[0020] In some exemplary embodiments, determining the annotation label corresponding to the target pronunciation phoneme based on the target word meaning and the target part of speech specifically includes:
[0021] Determining a preset word meaning category corresponding to the target word meaning; wherein the preset word meaning category includes a plurality of different word meanings;
[0022] The annotation label corresponding to the target pronunciation phoneme is determined based on the preset word meaning category and the target part of speech.
[0023] In some exemplary embodiments, the process of training the neural network model includes:
[0024] Annotate the sample text of the neural network model using the annotation label;
[0025] The neural network model is trained by using labeled sample text and double random dropout technology.
[0026] In some exemplary embodiments, before training the neural network model using the labeled sample text and the double random dropout technique, the process of training the neural network model includes:
[0027] A baseline network model for pre-training the neural network model based on unlabeled sample text.
[0028] In some exemplary embodiments, each accent category in the homograph pronunciation dictionary corresponds to a pronunciation phoneme; and determining the pronunciation phoneme of the homograph in the homograph pronunciation dictionary based on the part-of-speech tag comprises:
[0029] Obtaining the accent category of the text to be recognized;
[0030] The pronunciation phonemes of the homograph are determined in a homograph pronunciation dictionary based on the accent category and the part-of-speech tag.
[0031] In some exemplary embodiments, the accent categories include at least an American accent and a British accent.
[0032] In some exemplary embodiments, before inputting the text to be recognized into the trained neural network model, the method further includes:
[0033] Determining a target position of the homograph in the text to be recognized;
[0034] In response to determining that the target position is not at the preset position, a placeholder is filled at the beginning or end of the text to be recognized so that the target position is at the preset position.
[0035] Based on the same inventive concept, the exemplary embodiment of the present application further provides a homograph recognition device, comprising:
[0036] An acquisition module is used to acquire a text to be recognized; wherein the text to be recognized includes homographs;
[0037] A labeling module, inputting the text to be recognized into the trained neural network model to obtain the part-of-speech label of the homograph;
[0038] A determination module, which determines the pronunciation phonemes of the homograph in a homograph pronunciation dictionary based on the part-of-speech tag;
[0039] The homograph pronunciation dictionary includes pronunciation phonemes of homographs with multiple accent categories and pronunciation phonemes of homographs with a specific accent category.
[0040] In some exemplary embodiments, the apparatus further comprises a label module; the label module is configured to:
[0041] Setting annotation labels for all homographs in the homograph pronunciation dictionary;
[0042] The process of setting the annotation label includes:
[0043] determining a target homograph from among all the homographs;
[0044] In response to determining that each part of speech of the target homograph corresponds to a pronunciation phoneme, setting each part of speech of the target homograph as a label of the pronunciation phoneme corresponding to it;
[0045] In response to determining that the target part of speech of the target homograph corresponds to multiple pronunciation phonemes, the pronunciation phoneme with the highest usage frequency is determined from the multiple pronunciation factors, the target part of speech is set as the annotation label corresponding to the pronunciation phoneme with the highest usage frequency, and annotation labels corresponding to the pronunciation phonemes other than the pronunciation phoneme with the highest usage frequency in the multiple pronunciation factors are set based on the meaning of the target homograph.
[0046] In some exemplary embodiments, the tag module is specifically configured as follows:
[0047] determining a target pronunciation factor from among the other pronunciation phonemes;
[0048] Determining a target word meaning of the target homograph corresponding to the target pronunciation phoneme;
[0049] The annotation label corresponding to the target pronunciation phoneme is determined based on the target word meaning and the target part of speech.
[0050] In some exemplary embodiments, the tag module is specifically configured as follows:
[0051] Determining a preset word meaning category corresponding to the target word meaning; wherein the preset word meaning category includes a plurality of different word meanings;
[0052] The annotation label corresponding to the target pronunciation phoneme is determined based on the preset word meaning category and the target part of speech.
[0053] In some exemplary embodiments, the apparatus further comprises a training module, wherein the training module is configured to:
[0054] Annotate the sample text of the neural network model using the annotation label;
[0055] The neural network model is trained by using labeled sample text and double random dropout technology.
[0056] In some exemplary embodiments, the training module is further configured to:
[0057] A baseline network model for pre-training the neural network model based on unlabeled sample text.
[0058] In some exemplary embodiments, each accent category in the homograph pronunciation dictionary corresponds to a pronunciation phoneme; and the determination module is specifically configured to:
[0059] Obtaining the accent category of the text to be recognized;
[0060] The pronunciation phonemes of the homograph are determined in a homograph pronunciation dictionary based on the accent category and the part-of-speech tag.
[0061] In some exemplary embodiments, the accent categories include at least an American accent and a British accent.
[0062] In some exemplary embodiments, the apparatus further comprises a location module; the location module is configured to:
[0063] Determining a target position of the homograph in the text to be recognized;
[0064] In response to determining that the target position is not at the preset position, a placeholder is filled at the beginning or end of the text to be recognized so that the target position is at the preset position.
[0065] Based on the same inventive concept, an exemplary embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the above-mentioned method for recognizing homographs when executing the program.
[0066] Based on the same inventive concept, an exemplary embodiment of the present application further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for recognizing homographs as described above.
[0067] As can be seen from the above, the homograph recognition method, device, electronic device and storage medium provided by the present application first obtain a text to be recognized; wherein the text to be recognized includes homographs; then the text to be recognized is input into the trained neural network model to obtain the part-of-speech tag of the homograph; finally, the pronunciation phoneme of the homograph is determined in a preset homograph pronunciation dictionary according to the part-of-speech tag; wherein the homograph pronunciation dictionary includes the pronunciation phonemes of homographs with multiple accent categories and the pronunciation phonemes of homographs with exclusive accent categories, so that the pronunciation phonemes of homographs can be accurately obtained, and homographs of multiple accents can be disambiguated. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the technical solutions in the present application or related technologies, the following briefly introduces the drawings required for use in the exemplary embodiments or related technical descriptions. Obviously, the drawings described below are only exemplary embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0069] Figure 1 A schematic diagram of an application scenario of an exemplary embodiment of the present application;
[0070] Figure 2 A schematic flow chart of a method for identifying homographs of an exemplary embodiment of the present application;
[0071] Figure 3 A schematic diagram of a method for setting a label for a homograph according to an exemplary embodiment of the present application;
[0072] Figure 4 A schematic diagram of another method for setting a label for a homograph according to an exemplary embodiment of the present application;
[0073] Figure 5 A schematic flow chart of another method for identifying homographs according to an exemplary embodiment of the present application;
[0074] Figure 6 A schematic diagram of the structure of a homograph recognition device of an exemplary embodiment of the present application;
[0075] Figure 7 It is a schematic diagram of the structure of a specific electronic device according to an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0076] The principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present application, and are not intended to limit the scope of the present application in any way. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.
[0077] According to the implementation manner of the present application, a method, device, electronic device and storage medium for recognizing homographs are proposed.
[0078] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.
[0079] The principles and spirit of the present application are explained in detail below with reference to several representative implementations of the present application. SUMMARY OF THE INVENTION
[0081] In the prior art, it is impossible to accurately predict the pronunciation of homographs, and homographs can only be predicted for a single English accent, and it is impossible to predict the pronunciation of homographs in multiple accent types.
[0082] The inventor of the present application has found that in the related art, a joint solution using machine learning and linguistic rules is proposed for pronunciation prediction of homographs, but the disadvantage of this solution is that the development cost of linguistic rules is high and it is not easy to maintain and modify. In addition, the pronunciation prediction methods in the related art only focus on the pronunciation of one accent, so it is impossible to achieve pronunciation prediction of homographs of multiple accent types.
[0083] In order to solve the above problems, the present application provides a method for identifying homographs, which specifically includes:
[0084] Obtain a text to be recognized; wherein the text to be recognized includes homographs; then input the text to be recognized into a trained neural network model to obtain part-of-speech tags of the homographs; finally, determine the pronunciation phonemes of the homographs in a preset homograph pronunciation dictionary according to the part-of-speech tags; wherein the homograph pronunciation dictionary includes the pronunciation phonemes of homographs with multiple accent categories and the pronunciation phonemes of homographs with exclusive accent categories, so that the pronunciation phonemes of the homographs can be accurately obtained, and homograph disambiguation of multiple accents can be achieved.
[0085] After introducing the basic principles of the present application, various non-limiting implementation methods of the present application are described in detail below.
[0086] Application Scenario Overview
[0087] refer to Figure 1, which is a schematic diagram of an application scenario of a method for recognizing homographs provided by an exemplary embodiment of the present application. The application scenario includes a terminal device 101, a server 102, and a data storage system 103. Among them, the terminal device 101, the server 102 and the data storage system 103 can be connected through a wired or wireless communication network. The terminal device 101 includes but is not limited to a desktop computer, a mobile phone, a mobile computer, a tablet computer, a media player, a smart wearable device, a personal digital assistant (PDA) or other electronic devices capable of realizing the above functions. The server 102 and the data storage system 103 can both be independent physical servers, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0088] The server 102 is used to provide homograph recognition services to the users of the terminal device 101. The terminal device 101 is installed with a client that communicates with the server 102, and the user can obtain the pronunciation phonemes of the homographs through the client. In the process of homograph recognition, the client obtains the text to be recognized by calling the input component of the terminal device 101 (such as a touch screen, a keyboard, a camera, etc.); the client sends the text to be recognized to the server 102. The server 102 obtains the part-of-speech tags of the homographs in the text to be recognized through the neural network model obtained through training, and determines the pronunciation phonemes of the homographs in the preset homograph pronunciation dictionary according to the part-of-speech tags. After the pronunciation phonemes of the homographs are obtained, the acquisition results are sent to the terminal device 101, so as to accurately recognize the pronunciation phonemes of the homographs.
[0089] The data storage system 103 stores a homograph pronunciation dictionary and a large amount of training data, each of which includes a text to be recognized with homographs and a part-of-speech tag (marking tag) of the homographs. The server 102 can train the neural network model based on a large amount of training data, so that the neural network model can obtain the part-of-speech tag of the homographs according to the input text to be recognized with homographs. The source of the training data includes but is not limited to an existing database, data crawled from the Internet, or data uploaded by the user when using the client. When the output of the neural network model meets the predetermined requirements, the server 102 can provide the user with a prediction service of the pronunciation phonemes of the homographs based on the neural network model. At the same time, the server 102 can also continuously optimize the neural network model based on the newly added training data.
[0090] Combine the following Figure 1 The present invention describes the method for recognizing homographs according to the exemplary embodiment of the present application by using the application scenario. It should be noted that the above application scenario is only shown to facilitate understanding of the spirit and principle of the present application, and the implementation of the present application is not limited in this respect. On the contrary, the implementation of the present application can be applied to any applicable scenario.
[0091] Exemplary Methods
[0092] refer to Figure 2 The exemplary embodiment of the present application provides a method for identifying homographs, the method comprising the following steps:
[0093] S101, obtaining a text to be recognized; wherein the text to be recognized includes homographs.
[0094] In a specific implementation, the obtained text to be recognized may be a sentence, which contains homonyms. It should be noted that the homonyms are general terms, and optionally, the homonyms may also represent a word.
[0095] S102, inputting the text to be recognized into the trained neural network model to obtain the part-of-speech tags of the homographs.
[0096] In a specific implementation, after obtaining the text to be recognized, the text to be recognized can be input into the trained neural network model to obtain the part-of-speech tag of the homograph. The pronunciation phoneme corresponding to the tag can be determined from the homograph pronunciation dictionary, that is, the pronunciation phoneme of the homograph.
[0097] It should be noted that the neural network model obtained through training can select any publicly available model as a benchmark model as needed, and there is no limitation here.
[0098] S103: Determine the pronunciation phoneme of the homograph in a preset homograph pronunciation dictionary based on the part-of-speech tag.
[0099] In a specific implementation, after determining the part-of-speech tag of a homograph, the pronunciation phoneme of the homograph can be determined in a preset homograph pronunciation dictionary through the part-of-speech tag. Among them, the homograph pronunciation dictionary includes pronunciation phonemes of homographs with multiple accent categories and pronunciation phonemes of homographs with exclusive accent categories, and each part-of-speech tag corresponds to a pronunciation phoneme. Among them, homographs with exclusive accent categories mainly refer to homographs unique to certain specific accents. For example, dove in English is a homograph exclusive to the American accent. Optionally, the homograph pronunciation dictionary can be an English dictionary, and the corresponding text to be recognized is English. The multiple accents can include British accent, American accent, and accents from other regions.
[0100] In some exemplary embodiments, before determining the pronunciation phoneme of the homograph in a preset homograph pronunciation dictionary based on the part-of-speech tag, the method further includes:
[0101] Setting annotation labels for all homographs in the homograph pronunciation dictionary;
[0102] The process of setting the annotation label includes:
[0103] determining a target homograph from among all the homographs;
[0104] In response to determining that each part of speech of the target homograph corresponds to a pronunciation phoneme, setting each part of speech of the target homograph as a label of the pronunciation phoneme corresponding to it;
[0105] In response to determining that the target part of speech of the target homograph corresponds to multiple pronunciation phonemes, the pronunciation phoneme with the highest usage frequency is determined from the multiple pronunciation factors, the target part of speech is set as the annotation label corresponding to the pronunciation phoneme with the highest usage frequency, and annotation labels corresponding to the pronunciation phonemes other than the pronunciation phoneme with the highest usage frequency in the multiple pronunciation factors are set based on the meaning of the target homograph.
[0106] In specific implementation, when setting labels in the related art, generally a separate label is set for each pronunciation of homonymous characters, for example, Figure 3 In (a), since the homonym close in the two sentences "a is close to b" and "come to aclose" has the same pronunciation phoneme: Therefore, a uniform annotation label adj_nou will be given to the homograph close according to the pronunciation phoneme. However, the inventor of the present application found that more than 90% of homographs can be distinguished according to part of speech, that is, each part of speech of the homograph corresponds to a pronunciation phoneme, so this type of annotation label can be split, that is, each part of speech of the homograph is set as the annotation label of its corresponding pronunciation phoneme, for example Figure 3 As shown in (b), the homograph close is an adjective in "a is close to b", so the corresponding label is adj, and in "come to a close", close is a noun, so the corresponding label is nou. Through such an annotation label setting, each part of speech of close corresponds to an annotation label. Setting the annotation labels of homographs by part of speech can make more homographs use the same label, and then can share more linguistic knowledge, thereby improving the accuracy of neural network model recognition. For example, multiple different homographs have a noun part of speech, and each homograph corresponds to a proprietary or unique pronunciation phoneme when used as a noun. When the sentences with the above multiple homographs as nouns are respectively input into the neural network model, and the annotation labels output by the neural network model are constrained by the loss function to be noun labels, the neural network model can learn the linguistic knowledge of each homograph as a noun, so as to improve the accuracy of the neural network model in recognizing sentences with homographs as nouns. That is, through the design method of the annotation label in the embodiment of the present application, the prediction of the pronunciation phonemes of homographs by the neural network model can be converted into the prediction of their part of speech. In addition, since some low-frequency words share part of speech labels with high-frequency words, low-frequency words can benefit from them during the training process.
[0107] At the same time, there are some homographs that cannot be distinguished by part of speech alone. That is, a certain part of speech of a homograph will correspond to multiple phonemes at the same time. For example, when bass is a noun, it corresponds to [beis] and [beis]. Two phonemes, at this time, it is necessary to further set the annotation label of the homonymous word through the meaning of the word (word meaning). For example, when bass is a noun and means "bass", the corresponding phoneme is: [beis], and when it means "bass fish" (a kind of fish), the corresponding phoneme is: The inventor found that in general, when a certain part of speech of a homograph corresponds to multiple pronunciation phonemes at the same time, there will be a pronunciation phoneme with the highest frequency of use. For example, bass often means "bass" when used as a noun, but rarely means "bass fish". Therefore, in order to make the annotation label of bass share more linguistic knowledge, the target part of speech (nou) will be set to the annotation label corresponding to the pronunciation phoneme with the highest frequency of use. Optionally, when determining the pronunciation phoneme with the highest frequency of use from the multiple pronunciation factors, it can be determined according to the position of each pronunciation phoneme in the dictionary. Generally, dictionaries will put the pronunciation phoneme with the highest frequency of use in the front. Of course, other methods can also be used to determine the pronunciation phoneme with the highest frequency of use, which is not limited here. After setting the annotation label of the pronunciation phoneme with the highest frequency of use, the annotation labels corresponding to other pronunciation phonemes in the multiple pronunciation factors except the pronunciation phoneme with the highest frequency of use can be further set according to the meaning of the target homograph. For example, the annotation label of bass when used as a noun and representing "bass fish" can be set to "bass".
[0108] In some exemplary embodiments, setting the annotation labels corresponding to the other pronunciation phonemes in the plurality of pronunciation factors except the pronunciation phoneme with the highest usage frequency based on the meaning of the target homograph specifically includes:
[0109] determining a target pronunciation factor from among the other pronunciation phonemes;
[0110] Determining a target word meaning of the target homograph corresponding to the target pronunciation phoneme;
[0111] The annotation label corresponding to the target pronunciation phoneme is determined based on the target word meaning and the target part of speech.
[0112] In specific implementation, the corresponding annotation tags can be determined according to each part of speech and meaning of the homonymous characters. For example, the annotation tag of bass as a noun and representing "bass fish" can be set to "nou_bass" or "nou(bass)".
[0113] In some exemplary embodiments, determining the annotation label corresponding to the target pronunciation phoneme based on the target word meaning and the target part of speech specifically includes:
[0114] Determining a preset word meaning category corresponding to the target word meaning; wherein the preset word meaning category includes a plurality of different word meanings;
[0115] The annotation label corresponding to the target pronunciation phoneme is determined based on the preset word meaning category and the target part of speech.
[0116] In specific implementation, since homographs that need to be further labeled by word meaning are rarely used, the neural network model will have few samples to learn the labels of this type of homographs, which will lead to a decrease in the accuracy of their pronunciation phoneme recognition. In order to avoid this situation and improve the recognition accuracy of the labels of less frequently used homographs, refer to Figure 4 , you can Figure 4 The different annotation labels of bass and gill in (a) are merged into Figure 4 A label in (b). Since the pronunciation phonemes of gill when representing "fish gill" and bass when representing "bass fish" are used less frequently, if their respective labeling labels are set separately, their recognition accuracy will decrease. Therefore, when gill represents "fish gill" and bass represents "bass fish", the two have the same part of speech and their meanings are related to fish, that is, they belong to the preset meaning category. The pronunciation phonemes of the two can be uniformly set to "nou (fish)". In this way, when the neural network model recognizes the sentence when gill represents "fish gill", it can refer to the recognition result of the sentence when bass represents "bass fish", thereby improving the accuracy of recognizing the sentence when gill represents "fish gill". By classifying low-frequency words and setting the same labeling label as above, more homographs can use the same label, thereby being able to share more linguistic knowledge and improve the recognition accuracy of the labeling labels of homographs that are less frequently used.
[0117] It should be noted that the preset word meaning category can be set as needed and is not limited here. For example, it can be set according to the category to which the word meaning itself belongs.
[0118] In some exemplary embodiments, the process of training the neural network model includes:
[0119] Annotate the sample text of the neural network model using the annotation label;
[0120] The neural network model is trained by using labeled sample text and double random dropout technology.
[0121] During the specific implementation, the inventor of the present application found that the label setting method in the embodiment of the present application and the dual random dropout technology (R-Drop) can play a mutually supportive role. Please refer to Table 1 for the specific effects.
[0122] Table 1
[0123] BERT base BERT tiny Use normal tags 95.44% 89.67% Labels for this application 95.67% 90.75% R-Drop 95.39% 89.71% Labels for this application + R-Drop 96.05% 92.37%
[0124] Among them, BERT base and BERT tiny in Table 1 are two benchmark network models selected by this application. It can be seen from Table 1 that if the annotation tags and R-Drop (double random deactivation technology) of this application are used alone, the accuracy of model recognition can be slightly improved. When the annotation tags and R-Drop of this application are used at the same time, the accuracy of model recognition can be greatly improved, and the improvement is much greater than the superposition value of the improvement by using the two means alone. Therefore, the inventors found that when identifying homographs, the use of the annotation tag setting method and the double random deactivation technology (R-Drop) in the embodiment of this application at the same time can have an unexpected enhancement effect.
[0125] In some embodiments, the baseline network model of the neural network model is BERT base, and the process of training the neural network model specifically includes: labeling the sample text by the label labeling method in the above embodiment, and then inputting the labeled target sample text into BERT base, and randomly inactivating some neurons in BERT base, and adjusting the output result of BERT base by a loss function so that its output result is consistent with the labeled label of the target sample text, and then inputting the target sample text into BERT base again, and randomly inactivating some neurons in BERT base again, and adjusting the output result of BERT base by a loss function so that its output result is consistent with the output result of BERT base last time.
[0126] In order to further improve the efficiency of model training, in some exemplary embodiments, before training the neural network model using the labeled sample text and the double random dropout technology, the process of training the neural network model includes:
[0127] A baseline network model for pre-training the neural network model based on unlabeled sample text.
[0128] In some exemplary embodiments, each accent category in the homograph pronunciation dictionary corresponds to a pronunciation phoneme; and determining the pronunciation phoneme of the homograph in the homograph pronunciation dictionary based on the part-of-speech tag comprises:
[0129] Obtaining the accent category of the text to be recognized;
[0130] The pronunciation phonemes of the homograph are determined in a homograph pronunciation dictionary based on the accent category and the part-of-speech tag.
[0131] In some exemplary embodiments, the accent categories include at least American accent and British accent. For example, in the homograph pronunciation dictionary, the homograph process as a noun has corresponding pronunciation phonemes of British accent and American accent, wherein the pronunciation phoneme corresponding to the American accent is [′prɑ:ses], and the pronunciation phoneme corresponding to the British accent is [′prɑ:ses]. When determining the pronunciation phoneme of process in the sentence "The process of evolution", the neural network model is used to determine that the part-of-speech tag of process at this time is nou (noun), and the accent category of process at this time is obtained. Optionally, the accent category is generally input by the user according to needs. If the accent category of process at this time is American accent, the pronunciation phoneme of process at this time can be determined from the homograph pronunciation dictionary as [′prɑ:ses].
[0132] refer to Figure 5 , which is a flow chart of another method for recognizing homographs of an exemplary embodiment of the present application, wherein a text to be recognized having homographs is input into a neural network model, the neural network model outputs part-of-speech tags of the homographs, and then the accent category required by the user is determined from a homograph pronunciation dictionary according to the acquired accent category, and the pronunciation phonemes of the homographs that meet the user's accent category requirements are determined from the homograph pronunciation dictionary according to the part-of-speech tags of the homographs and the homographs, and the pronunciation phonemes of the homographs are output as results.
[0133] In order to facilitate the neural network model to accurately identify the position of homographs in the text to be recognized, in some exemplary embodiments, before inputting the text to be recognized into the trained neural network model, the method further includes:
[0134] Determining a target position of the homograph in the text to be recognized;
[0135] In response to determining that the target position is not at the preset position, a placeholder is filled at the beginning or end of the text to be recognized so that the target position is at the preset position.
[0136] In specific implementation, the preset position can be set as needed, which is not limited here. For example, the preset position can be set to the center position of the text to be recognized. Optionally, the placeholder can be "[PAD]".
[0137] The present application provides a method for identifying homographs, which first obtains a text to be identified; wherein the text to be identified includes homographs; then the text to be identified is input into a trained neural network model to obtain a part-of-speech tag of the homograph; finally, according to the part-of-speech tag, the pronunciation phoneme of the homograph is determined in a preset homograph pronunciation dictionary; wherein the homograph pronunciation dictionary includes the pronunciation phonemes of homographs with multiple accent categories and the pronunciation phonemes of homographs with exclusive accent categories, so that the pronunciation phonemes of the homographs can be accurately obtained, and homographs of multiple accents can be disambiguated.
[0138] Exemplary Devices
[0139] Based on the same inventive concept, corresponding to any of the above exemplary embodiments and methods, the present application also provides a homonymous character recognition device.
[0140] refer to Figure 6 , the homograph recognition device comprises:
[0141] The acquisition module 201 acquires a text to be recognized; wherein the text to be recognized includes homographs;
[0142] The labeling module 202 inputs the text to be recognized into the trained neural network model to obtain the part-of-speech label of the homonymous character;
[0143] A determination module 203 determines the pronunciation phonemes of the homograph in a homograph pronunciation dictionary based on the part-of-speech tag;
[0144] The homograph pronunciation dictionary includes pronunciation phonemes of homographs with multiple accent categories and pronunciation phonemes of homographs with a specific accent category.
[0145] In some exemplary embodiments, the apparatus further comprises a label module; the label module is configured to:
[0146] Setting annotation labels for all homographs in the homograph pronunciation dictionary;
[0147] The process of setting the annotation label includes:
[0148] determining a target homograph from among all the homographs;
[0149] In response to determining that each part of speech of the target homograph corresponds to a pronunciation phoneme, setting each part of speech of the target homograph as a label of the pronunciation phoneme corresponding to it;
[0150] In response to determining that the target part of speech of the target homograph corresponds to multiple pronunciation phonemes, the pronunciation phoneme with the highest usage frequency is determined from the multiple pronunciation factors, the target part of speech is set as the annotation label corresponding to the pronunciation phoneme with the highest usage frequency, and annotation labels corresponding to the pronunciation phonemes other than the pronunciation phoneme with the highest usage frequency in the multiple pronunciation factors are set based on the meaning of the target homograph.
[0151] In some exemplary embodiments, the tag module is specifically configured as follows:
[0152] determining a target pronunciation factor from among the other pronunciation phonemes;
[0153] Determining a target word meaning of the target homograph corresponding to the target pronunciation phoneme;
[0154] The annotation label corresponding to the target pronunciation phoneme is determined based on the target word meaning and the target part of speech.
[0155] In some exemplary embodiments, the tag module is specifically configured as follows:
[0156] Determining a preset word meaning category corresponding to the target word meaning; wherein the preset word meaning category includes a plurality of different word meanings;
[0157] The annotation label corresponding to the target pronunciation phoneme is determined based on the preset word meaning category and the target part of speech.
[0158] In some exemplary embodiments, the apparatus further comprises a training module, wherein the training module is configured to:
[0159] Annotate the sample text of the neural network model using the annotation label;
[0160] The neural network model is trained by using labeled sample text and double random dropout technology.
[0161] In some exemplary embodiments, the training module is further configured to:
[0162] A baseline network model for pre-training the neural network model based on unlabeled sample text.
[0163] In some exemplary embodiments, each accent category in the homograph pronunciation dictionary corresponds to a pronunciation phoneme; and the determination module is specifically configured to:
[0164] Obtaining the accent category of the text to be recognized;
[0165] The pronunciation phonemes of the homograph are determined in a homograph pronunciation dictionary based on the accent category and the part-of-speech tag.
[0166] In some exemplary embodiments, the accent categories include at least an American accent and a British accent.
[0167] In some exemplary embodiments, the apparatus further comprises a location module; the location module is configured to:
[0168] Determining a target position of the homograph in the text to be recognized;
[0169] In response to determining that the target position is not at the preset position, a placeholder is filled at the beginning or end of the text to be recognized so that the target position is at the preset position.
[0170] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0171] The apparatus of the above exemplary embodiments is used to implement the corresponding homograph recognition method in any of the above exemplary embodiments, and has the beneficial effects of the corresponding method exemplary embodiments, which will not be described in detail herein.
[0172] Based on the same inventive concept, corresponding to any of the above exemplary embodiments, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for recognizing homographs described in any of the above exemplary embodiments is implemented.
[0173] Figure 7 A more specific schematic diagram of the hardware structure of an electronic device provided by this exemplary embodiment is shown, and the device may include: a processor 301, a memory 302, an input / output interface 303, a communication interface 304, and a bus 305. The processor 301, the memory 302, the input / output interface 303, and the communication interface 304 are connected to each other in communication within the device through the bus 305.
[0174] The processor 301 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided by the exemplary embodiments of this specification.
[0175] The memory 302 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 302 can store an operating system and other application programs. When the technical solutions provided by the exemplary embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 302 and called and executed by the processor 301.
[0176] The input / output interface 303 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.
[0177] The communication interface 304 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0178] The bus 305 comprises a pathway for transmitting information between the various components of the device (eg, the processor 301 , the memory 302 , the input / output interface 303 , and the communication interface 304 ).
[0179] It should be noted that, although the above device only shows the processor 301, the memory 302, the input / output interface 303, the communication interface 304 and the bus 305, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the exemplary embodiment of this specification, and does not necessarily include all the components shown in the figure.
[0180] The electronic device of the above exemplary embodiment is used to implement the corresponding homograph recognition method in any of the above exemplary embodiments, and has the beneficial effects of the corresponding method exemplary embodiment, which will not be described in detail here.
[0181] Exemplary Program Products
[0182] Based on the same inventive concept, corresponding to any of the above exemplary embodiments, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method for recognizing homographs as described in any of the above exemplary embodiments.
[0183] The computer-readable medium of this exemplary embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0184] The computer instructions stored in the storage medium of the above exemplary embodiments are used to enable the computer to execute the method for recognizing homographs as described in any of the above exemplary embodiments, and have the beneficial effects of the corresponding method exemplary embodiments, which will not be described in detail herein.
[0185] Those skilled in the art should understand that the discussion of any of the above exemplary embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples; based on the concept of the present application, the above exemplary embodiments or technical features in different exemplary embodiments may also be combined, the steps may be implemented in any order, and there are many other variations of different aspects of the exemplary embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0186] In addition, to simplify the description and discussion, and in order not to make the exemplary embodiments of the present application difficult to understand, the known power / ground connections to the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the exemplary embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the exemplary embodiments of the present application will be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case where specific details (e.g., circuits) are set forth to describe the exemplary embodiments of the present application, it is obvious to those skilled in the art that the exemplary embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0187] Although the present application has been described in conjunction with specific exemplary embodiments of the present application, many replacements, modifications and variations of these exemplary embodiments will be apparent to those of ordinary skill in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the exemplary embodiments discussed.
[0188] The exemplary embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the exemplary embodiments of the present application should be included in the scope of protection of the present application.
Claims
1. A method for recognizing homographs, characterized in that: include: Acquire a text to be recognized; wherein the text to be recognized includes homographs; Inputting the text to be recognized into the trained neural network model to obtain the part-of-speech tag of the homograph; Determining the pronunciation phonemes of the homograph in a preset homograph pronunciation dictionary based on the part-of-speech tag; The homograph pronunciation dictionary includes pronunciation phonemes of homographs with multiple accent categories and pronunciation phonemes of homographs with exclusive accent categories; Before determining the pronunciation phoneme of the homograph in a preset homograph pronunciation dictionary based on the part-of-speech tag, the method further includes: setting a label for all homographs in the homograph pronunciation dictionary; the process of setting the label includes: determining a target homograph from all the homographs; in response to determining that a target part-of-speech of the target homograph corresponds to a plurality of pronunciation phonemes, determining the pronunciation phoneme with the highest usage frequency from the plurality of pronunciation factors, setting the target part-of-speech as the label corresponding to the pronunciation phoneme with the highest usage frequency, and setting label corresponding to other pronunciation phonemes in the plurality of pronunciation factors except the pronunciation phoneme with the highest usage frequency based on the meaning of the target homograph; The step of setting the annotation labels corresponding to the other pronunciation phonemes in the plurality of pronunciation factors except the pronunciation phoneme with the highest frequency of use based on the meaning of the target homograph specifically includes: determining the target pronunciation factor from the other pronunciation phonemes; determining the target meaning of the target homograph corresponding to the target pronunciation phoneme; determining the annotation label corresponding to the target pronunciation phoneme based on the target meaning and the target part of speech; The step of determining the annotation label corresponding to the target pronunciation phoneme based on the target word meaning and the target part of speech specifically includes: determining a preset word meaning category corresponding to the target word meaning; wherein the preset word meaning category includes a plurality of different word meanings; determining the annotation label corresponding to the target pronunciation phoneme based on the preset word meaning category and the target part of speech; The sample text of the neural network model is annotated using the annotated labels to train the neural network model.
2. The method according to claim 1, characterized in that Before determining the pronunciation phonemes of the homograph in a preset homograph pronunciation dictionary based on the part-of-speech tag, the method further comprises: include: The process of setting the annotation label further includes: determining a target homograph from among all the homographs; In response to determining that each part of speech of the target homograph corresponds to a pronunciation phoneme, each part of speech of the target homograph is set as a label of the pronunciation phoneme corresponding to it.
3. The method according to any one of claims 1 or 2, characterized in that: The process of training the neural network model also includes: The neural network model is trained by using labeled sample text and double random dropout technology.
4. The method according to claim 3, characterized in that: Before training the neural network model using the labeled sample text and the double random dropout technology, the process of training the neural network model includes: A baseline network model for pre-training the neural network model based on unlabeled sample text.
5. The method according to claim 1, characterized in that Each accent category in the homograph pronunciation dictionary corresponds to a pronunciation phoneme; and determining the pronunciation phoneme of the homograph in the homograph pronunciation dictionary based on the part-of-speech tag comprises: Obtaining the accent category of the text to be recognized; The pronunciation phonemes of the homograph are determined in a homograph pronunciation dictionary based on the accent category and the part-of-speech tag.
6. The method according to claim 5, characterized in that The accent categories include at least an American accent and a British accent.
7. The method according to claim 1, characterized in that Before inputting the text to be recognized into the trained neural network model, the method further includes: Determining a target position of the homograph in the text to be recognized; In response to determining that the target position is not at the preset position, a placeholder is filled at the beginning or end of the text to be recognized so that the target position is at the preset position.
8. A homograph recognition device, characterized in that: include: An acquisition module is used to acquire a text to be recognized; wherein the text to be recognized includes homographs; A labeling module, inputting the text to be recognized into the trained neural network model to obtain the part-of-speech label of the homograph; A determination module, which determines the pronunciation phonemes of the homograph in a homograph pronunciation dictionary based on the part-of-speech tag; The homograph pronunciation dictionary includes pronunciation phonemes of homographs with multiple accent categories and pronunciation phonemes of homographs with exclusive accent categories; a label module, the label module being configured to: set annotated labels for all homographs in the homograph pronunciation dictionary; the process of setting the annotated labels comprises: determining a target homograph from all the homographs; in response to determining that a target part of speech of the target homograph corresponds to a plurality of pronunciation phonemes, determining a pronunciation phoneme with the highest frequency of use from the plurality of pronunciation factors, setting the target part of speech as an annotated label corresponding to the pronunciation phoneme with the highest frequency of use, and setting annotated labels corresponding to other pronunciation phonemes in the plurality of pronunciation factors except the pronunciation phoneme with the highest frequency of use based on the meaning of the target homograph; The label module is specifically configured to: determine a target pronunciation factor from the other pronunciation phonemes; determine a target word meaning of the target homograph corresponding to the target pronunciation phoneme; determine a label corresponding to the target pronunciation phoneme based on the target word meaning and the target part of speech; The label module is further configured to: determine a preset word meaning category corresponding to the target word meaning; wherein the preset word meaning category includes a plurality of different word meanings; determine a label corresponding to the target pronunciation phoneme based on the preset word meaning category and the target part of speech; The training module is configured to use the annotation tags to annotate the sample text of the neural network model to train the neural network model.
9. The device according to claim 8, in, The process of setting the annotation label also includes: In response to determining that each part of speech of the target homograph corresponds to a pronunciation phoneme, each part of speech of the target homograph is set as a label of the pronunciation phoneme corresponding to it.
10. The apparatus according to any one of claims 8 or 9, wherein the training module is further configured to: The neural network model is trained by using labeled sample text and double random dropout technology.
11. The apparatus according to claim 10, wherein the training module is further configured to: A baseline network model for pre-training the neural network model based on unlabeled sample text.
12. The apparatus according to claim 8, wherein each accent category in the homograph pronunciation dictionary corresponds to a pronunciation phoneme; and the determination module is specifically configured to: Obtaining the accent category of the text to be recognized; The pronunciation phonemes of the homograph are determined in a homograph pronunciation dictionary based on the accent category and the part-of-speech tag.
13. The apparatus according to claim 12, wherein the accent categories include at least an American accent and a British accent.
14. The apparatus according to claim 8, further comprising a location module; the location module being configured to: Determining a target position of the homograph in the text to be recognized; In response to determining that the target position is not at the preset position, a placeholder is filled at the beginning or end of the text to be recognized so that the target position is at the preset position.
15. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the program.
16. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions for causing a computer to execute the method according to any one of claims 1 to 7.
