A method, device, equipment and storage medium for predicting accent

By splicing word segmentation and affixes on text data, introducing contextual information, and using the accent prediction module to predict the stress position, the problem of low accuracy in prediction of homophones and different pronunciations is solved, and the quality and intelligibility of speech synthesis are improved.

CN114722807BActive Publication Date: 2025-01-03IFLYTEK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111628589.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2025-01-03
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

The existing stress prediction scheme has low accuracy in predicting homophobic words, which affects the intelligibility and expressiveness of speech synthesis.

Method used

By segmenting word segmentation and stem affixes for predicted text data, each word segmentation unit is spliced ​​with the affixes of the adjacent word segmentation units before and after, context information is introduced, and a pre-constructed stress prediction module is used for single-hot encoding and stress position prediction. , distinguish homophobic words.

Benefits of technology

Improves the accuracy of stress position prediction and ensures the quality and intelligibility of speech synthesis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114722807B_ABST
    Figure CN114722807B_ABST
Patent Text Reader

Abstract

The present application provides a stress prediction method, device, equipment and storage medium, wherein the method includes: obtaining text data for which stress is to be predicted; segmenting the text data to obtain segmentation units; segmenting each segmentation unit into stems and affixes, and splicing each segmentation unit with the affixes of the adjacent segmentation units before and after to obtain a splicing result corresponding to the text data; predicting the stress position of each segmentation unit in the text data according to the splicing result corresponding to the text data. The stress prediction method provided by the present application splices each segmentation unit of the text data with the affixes of the adjacent segmentation units before and after, which is equivalent to introducing contextual information for each segmentation unit in the text data. When predicting stress for each segmentation unit, the introduction of contextual information can better distinguish homophones, and thus accurately predict the stress position.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of speech synthesis technology, and in particular to an accent prediction method, device, equipment and storage medium. Background Art

[0002] Predicting the stress position in text data is a crucial step in speech synthesis. Existing stress prediction schemes mainly predict the stress position of each word based on the text features of each word in the text data for which the stress is to be predicted (e.g., the word itself, the length of the word, the part of speech of the word, etc.).

[0003] Although the existing stress prediction scheme can predict the stress position of text data, its prediction accuracy for homophones is not high. It is understandable that the accuracy of stress position prediction directly affects the intelligibility and expressiveness of synthesized speech. If the stress position prediction is wrong, it will directly affect the quality of subsequent synthesized speech. Summary of the invention

[0004] In view of this, the present application provides a stress prediction method, device, equipment and storage medium to solve the problem that the existing stress prediction scheme has low prediction accuracy for homophones. The technical solution is as follows:

[0005] A method for predicting an accent, comprising:

[0006] Obtain text data for which stress is to be predicted;

[0007] Segmenting the text data to obtain segmentation units;

[0008] Perform stem and affix segmentation on each word segmentation unit, and concatenate each word segmentation unit with the affixes of the preceding and following word segmentation units to obtain a concatenation result corresponding to the text data;

[0009] According to the concatenation result corresponding to the text data, the stress position of each word segmentation unit in the text data is predicted.

[0010] Optionally, predicting the stress position of each word segmentation unit in the text data according to the concatenation result corresponding to the text data includes:

[0011] The stress position of each word segmentation unit in the text data is predicted by using a pre-built stress prediction module and a concatenation result corresponding to the text data.

[0012] Optionally, the using a pre-built stress prediction module and a concatenation result corresponding to the text data to predict the stress position of each word segmentation unit in the text data includes:

[0013] Performing one-hot encoding on each concatenation unit in the concatenation result corresponding to the text data;

[0014] Inputting the encoding result of each splicing unit into a pre-built stress prediction module to obtain the stress prediction result corresponding to each splicing unit, wherein the stress prediction result is used to indicate whether each character contained in the corresponding splicing unit is a stress position;

[0015] The stress position of each word segmentation unit in the text data is determined according to the stress prediction result corresponding to each splicing unit.

[0016] Optionally, performing one-hot encoding on each splicing unit in the splicing result corresponding to the text data includes:

[0017] According to the constructed state set, each splicing unit in the splicing result corresponding to the text data is one-hot encoded;

[0018] The state set is a character set consisting of designated characters and characters included in the language to which the text data belongs, and the designated characters include word separators, stem and affix separators, and no-affix prompts.

[0019] Optionally, the step of concatenating each word segmentation unit with affixes of adjacent word segmentation units includes:

[0020] For each word segmentation unit in the text data:

[0021] If there is no spliceable affix before the word segmentation unit, and there is a spliceable affix after the word segmentation unit, then the spliceable affix after the word segmentation unit is spliced ​​after the word segmentation unit;

[0022] If there is a spliceable affix before the word segmentation unit and there is no spliceable affix after the word segmentation unit, the spliceable affix before the word segmentation unit is spliced ​​to the front of the word segmentation unit;

[0023] If there is a spliceable affix before the word segmentation unit and there is a spliceable affix after the word segmentation unit, the spliceable affix before the word segmentation unit is spliced ​​in front of the word segmentation unit, and the spliceable affix after the word segmentation unit is spliced ​​behind the word segmentation unit.

[0024] Optionally, the stress prediction method further includes:

[0025] According to the stress position of each word segmentation unit in the text data, an stress identifier is added to the text data to obtain text data containing the stress identifier.

[0026] A stress prediction device comprises: a text data acquisition module, a text data processing module, and a stress position prediction module;

[0027] The text data acquisition module is used to acquire text data for which the stress is to be predicted;

[0028] The text data processing module is used to segment the text data to obtain segmentation units, segment each segmentation unit into stems and affixes, and concatenate each segmentation unit with the affixes of the adjacent segmentation units to obtain a concatenation result corresponding to the text data;

[0029] The stress position prediction module is used to predict the stress position of each word segmentation unit in the text data according to the splicing result corresponding to the text data.

[0030] Optionally, when the information prediction module predicts the stress position of each word segmentation unit in the text data according to the splicing result corresponding to the text data, it is specifically used to:

[0031] The stress position of each word segmentation unit in the text data is predicted by using a pre-built stress prediction module and a concatenation result corresponding to the text data.

[0032] An accent prediction device, comprising: a memory and a processor;

[0033] The memory is used to store programs;

[0034] The processor is used to execute the program to implement each step of any one of the above-mentioned methods for predicting accents.

[0035] A readable storage medium stores a computer program, and when the computer program is executed by a processor, each step of any one of the above-mentioned methods for predicting accents is implemented.

[0036] Through the above scheme, it can be known that the stress prediction method, device, equipment and storage medium provided by the present application, after obtaining the text data for which the stress is to be predicted, first segment the text data to obtain segmentation units, then segment each segmentation unit obtained by the segmentation into stems and affixes, then splice each segmentation unit with the affixes of the adjacent segmentation units before and after to obtain the splicing result corresponding to the text data, and finally predict the stress position of each segmentation unit in the text data according to the splicing result corresponding to the text data. The stress prediction method provided by the present application splices each segmentation unit of the text data with the affixes of the adjacent segmentation units before and after, which is equivalent to introducing contextual information for each segmentation unit in the text data. When performing stress prediction on each segmentation unit, the introduction of contextual information can better distinguish homophones, and thus accurately predict the stress position. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0038] Figure 1 A schematic diagram of a flow chart of an accent prediction method provided in an embodiment of the present application;

[0039] Figure 2 A schematic diagram of a process for constructing an accent prediction model provided in an embodiment of the present application;

[0040] Figure 3 A schematic diagram of a process for predicting the stress position of each word segmentation unit in text data using a pre-established stress prediction model and a splicing result corresponding to text data provided in an embodiment of the present application;

[0041] Figure 4 A schematic diagram of the structure of the stress prediction device provided in an embodiment of the present application;

[0042] Figure 5 A schematic diagram of the structure of an accent prediction device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0044] The prediction of stress position is very important in speech synthesis system. The correctness of stress position directly affects the intelligibility of synthesized speech. The current scheme for stress position prediction is as follows: first, a dictionary with stress information is obtained, and then a stress prediction model is constructed using the dictionary with stress information. When establishing the stress prediction model, the stress prediction model is trained using the text features of the entries in the dictionary (including the word itself, word length, and part-of-speech features) and the stress position information corresponding to the entries. After the stress prediction model is established, the stress position of the word to be predicted is predicted using the stress prediction model. When the stress prediction model is used to predict the stress position of the word to be predicted, the text features of the word to be predicted (including the word itself, word length, and part-of-speech features) are first obtained, and then the text features of the word to be predicted are input into the stress prediction model. The stress prediction model predicts the stress position based on the input text features.

[0045] The applicant has studied the current stress position prediction scheme and found that the current stress position prediction scheme has many defects: the stress prediction model constructed using a dictionary with stress information cannot distinguish homophones, and thus cannot predict the accurate stress position; the above-mentioned stress prediction model is a shallow learning model, and its prediction accuracy is not ideal when faced with a language with no obvious regularity in stress position, because the shallow learning model has limited ability to describe data.

[0046] In view of the many defects of the current stress position prediction scheme, the applicant attempted to propose a stress prediction method that can predict the accurate stress position. To this end, in-depth research was conducted. Through continuous research, a stress prediction method was finally proposed. The basic idea of ​​this method is to introduce the preceding and following contextual information for the word to be predicted, and predict the stress position of the word to be predicted in combination with the preceding and following contextual information.

[0047] The method for predicting the position of an accent provided in the present application can be applied to an electronic device with data processing capability, which can be a terminal used by a user, such as a smart phone, a PC, a notebook, a PAD, etc. The electronic device can also be a server on the network side (which can be a single server, or multiple servers or a server cluster). Next, the method for predicting the position of an accent provided in the present application is introduced through the following embodiments.

[0048] First embodiment

[0049] See also Figure 1 , shows a schematic flow chart of the stress prediction method provided by the present application, which may include:

[0050] Step S101: obtaining text data for which stress is to be predicted.

[0051] The text data for which the stress is to be predicted may be text data in any language, that is, the stress prediction method provided in the present application is a stress prediction method common to all languages.

[0052] Step S102: Segment the text data into words to obtain word segmentation units.

[0053] Existing word segmentation methods can be used to segment text data.

[0054] For example, the text data for which the stress is to be predicted is “Я проснулся утром (I wake up in the morning)”, and after the text data is segmented, “Я (I), проснулся (wake up), утром (morning)” is obtained.

[0055] Step S103: segment each word segmentation unit into stems and affixes, and concatenate each word segmentation unit with the affixes of the preceding and following adjacent word segmentation units to obtain a concatenation result corresponding to the text data.

[0056] According to the characteristics of grammatical structure, universal languages ​​are divided into three categories: isolating languages, agglutinative languages, and inflectional languages. Isolating languages ​​are characterized by no changes in word form, and grammatical meanings are expressed through independent function words and fixed word order. Agglutinative languages ​​have rich word form changes, and grammatical functions are achieved by attaching different affixes to the front, middle, and back of the stem. Inflectional languages ​​also use word form changes as the main means of expressing grammatical relations. The difference between inflectional languages ​​and agglutinative languages ​​is that the morphemes of inflectional languages ​​tend to be connected together, and an affix often expresses multiple meanings at the same time, while an affix of an agglutinative language generally tends to express only a single meaning. Regardless of the language, many components that express functions have no boundary marks with nouns, verbs, adjectives, adverbs, numerals, quantifiers, and other content words, and have a common phonetic performance, that is, weak reading. Specifically, syllables that should be stressed in morphology are not stressed, and the main vowels that should be long are not long. In tonal languages, this is manifested as losing the original tone or reading in a light tone.

[0057] It should be noted that, for agglutinative languages ​​and inflectional languages, the "affix" in this application refers to the affixes used to achieve grammatical functions in agglutinative languages ​​and inflectional languages, and for isolating languages, the "affix" in this application refers to the functional components used to achieve grammatical functions.

[0058] The existing stem and affix segmentation method can be used to segment each word segmentation unit into stem and affix. After segmenting each word segmentation unit into stem and affix, each word segmentation unit can be spliced ​​with the affixes of the preceding and following adjacent word segmentation units to obtain a splicing result corresponding to the text data.

[0059] Among them, when each word segmentation unit is concatenated with the affixes of the adjacent word segmentation units before and after, for each word segmentation unit:

[0060] (a) If there is no spliceable affix before the word segmentation unit and there is a spliceable affix after the word segmentation unit, the spliceable affix after the word segmentation unit is spliced ​​after the word segmentation unit.

[0061] It should be noted that there may be two situations in which there is no concatenable affix before the word segmentation unit. First, the word segmentation unit is the first word segmentation unit, that is, there is no word segmentation unit before the word segmentation unit. Second, the word segmentation unit has a forward adjacent word segmentation unit (the forward adjacent word segmentation unit refers to the word segmentation unit that is located before the word segmentation unit and adjacent to the word segmentation unit), but the forward adjacent word segmentation unit of the word segmentation unit has no affix.

[0062] (b) If there is a spliceable affix before the word segmentation unit and there is no spliceable affix after the word segmentation unit, then the spliceable affix before the word segmentation unit is spliced ​​in front of the word segmentation unit.

[0063] It should be noted that there may be two situations in which there is no splicable affix after the segmentation unit. First, the segmentation unit is the last segmentation unit, that is, there is no segmentation unit after the segmentation unit. Second, the segmentation unit has a backward adjacent segmentation unit (the backward adjacent segmentation unit refers to the segmentation unit that is located after the segmentation unit and adjacent to the segmentation unit), but the backward adjacent segmentation unit of the segmentation unit has no affix.

[0064] (c) If there is a spliceable affix before the word segmentation unit and there is a spliceable affix after the word segmentation unit, the spliceable affix before the word segmentation unit is spliced ​​in front of the word segmentation unit, and the spliceable affix after the word segmentation unit is spliced ​​behind the word segmentation unit.

[0065] Exemplarily, the text data for which the stress is to be predicted is "Я проснулся утром (I woke up in the morning)". After word segmentation of this text data, we get "Я (I), проснулся (woke up), утром (in the morning)". After stem and affix segmentation of each segmented word unit, we get "Я (I), просну|лся (woke up), утр|ом (in the morning)" ("|" is the stem and affix separator). Among them, "просну" is the stem of "проснулся (woke up)", "лся" is the affix of "проснулся (woke up)", "утр" is the stem of "утром (in the morning)", and "ом" is the affix of "утром (in the morning)". After stem and affix segmentation of each segmented word unit, the affixes of each segmented word unit can be concatenated with the affixes of the adjacent segmented word units before and after. Specifically, for the segmented word unit "_Я_ (_I_)" ("_" is the word segment separator), since there is no segmented word unit before "_Я_ (_I_)", there is no need to concatenate an affix before "_Я_ (_I_). Since the backward adjacent segmented word unit "просну|лся (woke up)" of the segmented word unit "Я (I)" has the affix "лся", the affix "лся" is concatenated after the segmented word unit "_Я_ (_I_)", and after concatenation, we get "_Я_лся". For the segmented word unit "_просну|лся_ (_woke up_)", since the forward adjacent segmented word unit "Я (I)" of "_просну|лся_ (_woke up_)" has no affix, there is no need to concatenate an affix before the segmented word unit "_просну|лся_ (_woke up_)", and the non-affix prompt symbol "*" can be concatenated before "_просну|лся_ (_woke up_). Since the backward adjacent segmented word unit "утр|ом (in the morning)" of "_просну|лся_ (_woke up_)" has the affix "ом", the affix "ом" is concatenated after "_просну|лся_", and after concatenation, we get "*_просну|лся_ом". For the segmented word unit "_утр|ом_", since the forward adjacent segmented word unit "просну|лся (woke up)" of "_утр|ом_ (_in the morning_)" has the affix "лся", the affix "лся" is concatenated before "_утр|ом_ (_in the morning_). Since "утром (in the morning)" is the last segmented word unit, there is no need to concatenate an affix after "проснулся (woke up)", and the concatenation result of "_утр|ом_ (_in the morning_)" is "лся_утр|ом_".

[0066] Step S104: Predict the stress position of each segmented word unit in the text data according to the concatenation result corresponding to the text data.

[0067] Specifically, the stress position of each word segmentation unit in the text data can be predicted by using the pre-built stress prediction module and the concatenation result corresponding to the text data.

[0068] Optionally, the stress prediction module may be a stress prediction model, and the stress prediction model is trained using training texts annotated with stress identifiers.

[0069] It should be noted that this embodiment does not limit the stress prediction module to a stress prediction model. It can also be a module of other forms, such as a module that implements stress prediction based on set prediction rules. This application does not limit the specific implementation form of the stress prediction module, that is, the stress prediction module in this application can be any form of module that can realize stress position prediction.

[0070] Optionally, after predicting the stress position of each word segmentation unit in the text data according to the concatenation result corresponding to the text data, a stress identifier can be added to the text data according to the stress position of each word segmentation unit in the text data to obtain text data containing the stress identifier.

[0071] The stress prediction method provided in the embodiment of the present application, after obtaining the text data of the stress to be predicted, first performs word segmentation on the text data to obtain word segmentation units, then performs stem and affix segmentation on each word segmentation unit obtained by the word segmentation, and then splices each word segmentation unit with the affixes of the adjacent word segmentation units before and after to obtain the splicing result corresponding to the text data, and finally predicts the stress position of each word segmentation unit in the text data according to the splicing result corresponding to the text data. The stress prediction method provided in the embodiment of the present application splices each word segmentation unit of the text data with the affixes of the adjacent word segmentation units before and after, which is equivalent to introducing contextual information for each word segmentation unit in the text data. When performing stress prediction on each word segmentation unit, the introduction of contextual information can better distinguish homophones, and then accurately predict the stress position.

[0072] Second embodiment

[0073] The above embodiment mentioned that "the stress position of each word segmentation unit in the text data can be predicted by utilizing the splicing result corresponding to the pre-built stress prediction module and the text data." The above embodiment also mentioned that the stress prediction module can be a stress prediction model. This embodiment focuses on introducing the process of constructing the stress prediction model.

[0074] See also Figure 2 , showing a schematic diagram of the process of building an accent prediction model, which may include:

[0075] Step S201: obtaining training text marked with accent identifiers from a training data set.

[0076] The training data set includes a plurality of training texts marked with accent identifiers.

[0077] Step S202: Segment the training text to obtain segmentation units.

[0078] Step S203: segment each word segmentation unit of the training text into stems and affixes, and concatenate each word segmentation unit of the training text with the affixes of the preceding and following adjacent word segmentation units to obtain a concatenation result corresponding to the training text.

[0079] The implementation process of splicing each word segmentation unit of the training text with the affixes of the preceding and following adjacent word segmentation units to obtain the splicing result corresponding to the training text is similar to the implementation process of splicing each word segmentation unit of the text data with the affixes of the preceding and following adjacent word segmentation units to obtain the splicing result corresponding to the text data in the above embodiment. For details, please refer to the relevant parts in the above embodiment, which will not be elaborated in this embodiment.

[0080] It should be noted that in order to enable the stress prediction model to distinguish homophones and thus predict more accurate stress positions, the applicant thought of introducing information about adjacent word segmentation units for each word segmentation unit in the training text. When introducing information about adjacent word segmentation units for each word segmentation unit, the applicant proposed that only the affix information of the adjacent word segmentation units should be introduced instead of the entire word segmentation unit. This is because, from a linguistic perspective, the affix part already contains all grammatical information, and the stem part has no grammatical meaning and cannot be exhausted. From an engineering perspective, introducing the affix information of adjacent word segmentation units instead of the entire word segmentation unit can effectively control the number of parameters and complexity of the model.

[0081] Step S204: using the concatenation results corresponding to the training text as training samples and the stress identifiers marked in the training text as sample labels to train the stress prediction model.

[0082] Specifically, the concatenation result corresponding to the training text is used as a training sample, and the stress identifier annotated in the training text is used as a sample label. The process of training the stress prediction model may include:

[0083] Step S2041: One-hot encode each concatenation unit in the concatenation result corresponding to the training text.

[0084] For example, the splicing result corresponding to the training text "Я проснулсяутром (I wake up in the morning)" is "_Я_лся*_просну|лся_ом лся_утр|ом_", and the splicing units in the splicing result corresponding to the training text are "_Я_лся", "*_просну|лся_ом" and "лся_утр|ом_".

[0085] Specifically, each concatenation unit in the concatenation result corresponding to the training text is one-hot encoded, that is, each concatenation unit in the concatenation result corresponding to the training text is encoded as a feature vector including only "0" and "1".

[0086] When one-hot encoding is performed on each splicing unit in the splicing result corresponding to the training text, each splicing unit in the splicing result corresponding to the training text can be one-hot encoded according to the constructed state set. The state set is a character set consisting of specified characters and characters contained in the language to which the training text belongs. The specified characters include the word separator "_", the stem affix separator "|", and the no affix prompt "*" mentioned in the above embodiment. For each splicing unit in the splicing result corresponding to the training text, after one-hot encoding is performed according to the constructed state set, a dimension of<T,N+3> The feature vector of , where T is the number of characters contained in the concatenation unit, and N is the number of characters contained in the language to which the training text belongs.

[0087] For example, the training text is a Russian text, and Russian has 33 lowercase letters. Therefore, the state set includes 33 lowercase Russian letters, as well as the word separator "_", the stem and affix separator "|", and the no affix prompt "*", that is, the state set contains a total of 36 characters. For each concatenation unit in the concatenation result corresponding to the training text, after one-hot encoding according to the state set containing 36 characters, the dimension is obtained.<T,36> Assuming the concatenation unit is "_Я_лся", after one-hot encoding, we will get a feature vector with a dimension of <6,36>. Assuming the concatenation unit is "*_просну|лся_ом", after one-hot encoding, we will get a feature vector with a dimension of <15,36>.

[0088] Step S2042: Input the encoding result of each splicing unit into the stress prediction model to obtain the probability that each character in each splicing unit is a stress position.

[0089] Step S2043: Determine the prediction loss of the stress prediction model according to the probability that each character in each concatenated unit is a stress position and the stress identifier annotated in the training text.

[0090] Specifically, the cross entropy loss can be calculated according to the probability that each character in each concatenation unit is the stress position and the stress identifier annotated in the training text, as the prediction loss of the stress prediction model.

[0091] Step S2044: update the parameters of the accent prediction model according to the prediction loss.

[0092] The stress prediction model is iteratively trained multiple times in the above manner until the training end condition is met, and the model obtained after the training is completed is the established stress prediction model.

[0093] Through the above process, a stress prediction model capable of predicting stress positions can be established. When establishing the stress prediction model, since the preceding and following contextual information is introduced for each word segmentation unit of the training text (i.e., the affix information of the adjacent word segmentation units is introduced for each word segmentation unit of the training text), the established stress prediction model has the ability to distinguish homophones to a certain extent. In addition, making the input of the stress prediction model include the affix information of the adjacent word segmentation units of the word segmentation unit can reduce the learning difficulty of the model and improve the accuracy of the model for stress prediction. In addition, introducing the affix information of the adjacent word segmentation units of the word segmentation unit instead of introducing the entire adjacent word segmentation unit can reduce the number of parameters and complexity of the model.

[0094] Third embodiment

[0095] The above embodiment provides an implementation process of building a stress prediction model. On this basis, this embodiment introduces the implementation process of "predicting the stress position of each word segmentation unit in the text data by using the pre-built stress prediction model and the splicing result corresponding to the text data".

[0096] See also Figure 3 , shows a flow chart of predicting the stress position of each word segmentation unit in text data by using a pre-built stress prediction model and a concatenation result corresponding to text data, which may include:

[0097] Step S301: performing one-hot encoding on each concatenation unit in the concatenation result corresponding to the text data.

[0098] Specifically, each concatenation unit in the concatenation result corresponding to the text data is uniquely encoded according to the constructed state set, wherein the state set is a character set consisting of specified characters and characters contained in the language to which the text data belongs, and the specified characters include word separators, stem affix separators, and no affix prompts.

[0099] Step S302: inputting the encoding result of each splicing unit in the splicing result corresponding to the text data into a pre-established stress prediction model to obtain the stress prediction result corresponding to each splicing unit in the splicing result corresponding to the text data.

[0100] Among them, the stress prediction result is used to indicate whether each character in the corresponding splicing unit is a stress position. Optionally, the stress prediction result can be a sequence composed of 0s and 1s, and the length of the sequence is the length of the corresponding splicing unit. Suppose the length of a splicing unit is 6, that is, it includes 6 characters, then the stress prediction result corresponding to this splicing unit is a 0-1 sequence with a length of 6. Among them, if the first character in the 0-1 sequence is 0, it means that the first character in the corresponding splicing unit is an unstressed character; if the first character in the 0-1 sequence is 1, it means that the first character in the corresponding splicing unit is a stressed character; if the second character in the 0-1 sequence is 0, it means that the second character in the corresponding splicing unit is an unstressed character; if the second character in the 0-1 sequence is 1, it means that the second character in the corresponding splicing unit is a stressed character, and so on.

[0101] Step S303: Determine the stress position of each word segmentation unit in the text data according to the stress prediction result corresponding to each splicing unit.

[0102] Exemplarily, the splicing result corresponding to the text data "Я проснулся утром (I woke up in the morning)" is "_Я_лся*_просну|лся_ом лся_утр|ом_". Among them, the stress prediction result corresponding to the splicing unit "_Я_лся" is "010000", the stress prediction result corresponding to the splicing unit "*_просну|лся_ом" is "000000010000000", the stress prediction result corresponding to the splicing unit "лся_утр|ом_" is "00001000000". The stress prediction result corresponding to the splicing unit "_Я_лся" being "010000" indicates that the second character "Я (I)" in "_Я_лся" is a stressed character. The stress prediction result corresponding to the splicing unit "*_просну|лся_ом" being "000000010000000" indicates that the eighth character "у" in "*_просну|лся_ом" is a stressed character. The stress prediction result corresponding to the splicing unit "лся_утр|ом_" being "00001000000" indicates that the fifth character "у" in "лся_утр|ом_" is a stressed character.

[0103] After predicting the stress position of each word segmentation unit in the text data according to the splicing result corresponding to the text data, the stress identifier can also be added to the text data according to the stress position of each word segmentation unit in the text data to obtain the text data containing the stress identifier.

[0104] For the text data "Я проснулся утром (I wake up in the morning)", since the character "Я (I)" is a stressed character, the "у" in "проснулся (wake up)" is a stressed character, and the "у" in "утром (morning)" is a stressed character, therefore, accent identifiers are added to these stressed characters, and finally the text data "Я'просну'лсяу'тром" containing accent identifiers is obtained.

[0105] When using the stress prediction model to predict stress positions for text data, due to the introduction of the affix information of the adjacent word segmentation units of each word segmentation unit of the text data (that is, the contextual information of each word segmentation unit of the text data), the stress prediction model can distinguish between homophones and thus predict the accurate stress position.

[0106] Fourth embodiment

[0107] The embodiment of the present application further provides an accent prediction device. The accent prediction device provided by the embodiment of the present application is described below. The accent prediction device described below and the accent prediction method described above can refer to each other.

[0108] See also Figure 4 , shows a schematic diagram of the structure of the stress prediction device provided in an embodiment of the present application, which may include: a text data acquisition module 401, a text data processing module 402 and an information prediction module 403.

[0109] The text data acquisition module 401 is used to acquire text data for which stress is to be predicted.

[0110] The text data processing module 402 is used to segment the text data to obtain segmentation units, segment each segmentation unit into stems and affixes, and concatenate each segmentation unit with the affixes of the preceding and following adjacent segmentation units to obtain a concatenation result corresponding to the text data.

[0111] The information prediction module 403 is used to predict the stress position of each word segmentation unit in the text data according to the splicing result corresponding to the text data.

[0112] Optionally, the information prediction module 403, when predicting the stress position of each word segmentation unit in the text data according to the splicing result corresponding to the text data, is specifically used to:

[0113] The stress position of each word segmentation unit in the text data is predicted by using a pre-established stress prediction module and a concatenation result corresponding to the text data.

[0114] Optionally, the stress prediction module is a stress prediction model, and the stress prediction model is trained using training texts marked with stress identifiers.

[0115] Optionally, the stress prediction device provided in the embodiment of the present application may further include: a model training module. The model training module is used to:

[0116] The training text is segmented to obtain segmented word units; each segmented word unit of the training text is segmented into stems and affixes, and each segmented word unit of the training text is spliced ​​with the affixes of the preceding and following adjacent segmented word units to obtain a splicing result corresponding to the training text; the splicing result corresponding to the training text is used as a training sample, and the stress identifier annotated on the training text is used as a sample label to train a stress prediction model.

[0117] Optionally, the information prediction module 403 includes: an encoding submodule, an accent position prediction submodule and an accent position determination submodule.

[0118] The encoding submodule is used to perform one-hot encoding on each splicing unit in the splicing result corresponding to the text data.

[0119] The stress position prediction submodule is used to input the encoding result of each splicing unit into a pre-built stress prediction module to obtain the stress prediction result corresponding to each splicing unit, wherein the stress prediction result is used to indicate whether each character contained in the corresponding splicing unit is a stress position.

[0120] The stress position determination submodule is used to determine the stress position of each word segmentation unit in the text data according to the stress prediction result corresponding to each splicing unit.

[0121] Optionally, when the encoding submodule performs one-hot encoding on each splicing unit in the splicing result corresponding to the text data, it is specifically used to:

[0122] According to the constructed state set, each splicing unit in the splicing result corresponding to the text data is uniquely encoded; wherein the state set is a character set consisting of specified characters and characters contained in the language to which the text data belongs, and the specified characters include word separators, stem and affix separators, and no affix prompts.

[0123] Optionally, the text data processing module 402, when concatenating each word segmentation unit with affixes of adjacent word segmentation units, is specifically configured to:

[0124] For each word segmentation unit in the text data: if there is no spliceable affix before the word segmentation unit and there is a spliceable affix after the word segmentation unit, then the spliceable affix after the word segmentation unit is spliced ​​after the word segmentation unit; if there is a spliceable affix before the word segmentation unit and there is no spliceable affix after the word segmentation unit, then the spliceable affix before the word segmentation unit is spliced ​​in front of the word segmentation unit; if there is a spliceable affix before the word segmentation unit and there is a spliceable affix after the word segmentation unit, then the spliceable affix before the word segmentation unit is spliced ​​in front of the word segmentation unit, and the spliceable affix after the word segmentation unit is spliced ​​behind the word segmentation unit.

[0125] Optionally, the accent prediction device provided in the embodiment of the present application may further include: an accent identifier adding module.

[0126] The stress identifier adding module is used to add stress identifiers to the text data according to the stress position of each word segmentation unit in the text data to obtain text data containing stress identifiers.

[0127] The stress prediction device provided by the embodiment of the present application, after obtaining the text data for which the stress is to be predicted, first performs word segmentation on the text data to obtain word segmentation units, then performs stem and affix segmentation on each word segmentation unit obtained by the word segmentation, then splices each word segmentation unit with the affixes of the adjacent word segmentation units before and after to obtain the splicing result corresponding to the text data, and finally predicts the stress position of each word segmentation unit in the text data according to the splicing result corresponding to the text data. The stress prediction device provided by the embodiment of the present application splices each word segmentation unit of the text data with the affixes of the adjacent word segmentation units before and after, which is equivalent to introducing contextual information for each word segmentation unit in the text data. When performing stress prediction on each word segmentation unit, the introduction of contextual information can better distinguish homophones, and thus accurately predict the stress position.

[0128] Fifth embodiment

[0129] The present application also provides a device for predicting accents. Figure 5 , shows a schematic diagram of the structure of the stress prediction device, the stress prediction device may include: at least one processor 501, at least one communication interface 502, at least one memory 503 and at least one communication bus 504;

[0130] In the embodiment of the present application, the number of the processor 501, the communication interface 502, the memory 503, and the communication bus 504 is at least one, and the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504;

[0131] The processor 501 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;

[0132] The memory 503 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0133] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:

[0134] Obtain text data for which stress is to be predicted;

[0135] Segmenting the text data to obtain segmentation units;

[0136] Perform stem and affix segmentation on each word segmentation unit, and concatenate each word segmentation unit with the affixes of the preceding and following word segmentation units to obtain a concatenation result corresponding to the text data;

[0137] According to the concatenation result corresponding to the text data, the stress position of each word segmentation unit in the text data is predicted.

[0138] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0139] Sixth embodiment

[0140] The embodiment of the present application further provides a readable storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:

[0141] Obtain text data for which stress is to be predicted;

[0142] Segmenting the text data to obtain segmentation units;

[0143] Perform stem and affix segmentation on each word segmentation unit, and concatenate each word segmentation unit with the affixes of the preceding and following word segmentation units to obtain a concatenation result corresponding to the text data;

[0144] According to the concatenation result corresponding to the text data, the stress position of each word segmentation unit in the text data is predicted.

[0145] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0146] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0147] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0148] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for predicting an accent, characterized in that: include: Obtain text data for which stress is to be predicted; Segmenting the text data to obtain segmentation units; Performing stem-affix segmentation on each word segmentation unit, and splicing each word segmentation unit with the affixes of the preceding and following adjacent word segmentation units to obtain a splicing result corresponding to the text data, wherein the affix is ​​a component used to realize a grammatical function; Predicting the stress position of each word segmentation unit in the text data according to the splicing result corresponding to the text data; The step of predicting the stress position of each word segmentation unit in the text data according to the splicing result corresponding to the text data includes: The stress position of each word segmentation unit in the text data is predicted by using a pre-constructed stress prediction module and the splicing result corresponding to the text data. The stress prediction module is a stress prediction model obtained by training a training text marked with a stress identifier, or the stress prediction module is a module that implements stress prediction based on set prediction rules.

2. The method for predicting accent according to claim 1, characterized in that: The method of using a pre-built stress prediction module and a splicing result corresponding to the text data to predict the stress position of each word segmentation unit in the text data includes: Performing one-hot encoding on each concatenation unit in the concatenation result corresponding to the text data; Inputting the encoding result of each splicing unit into a pre-built stress prediction module to obtain the stress prediction result corresponding to each splicing unit, wherein the stress prediction module is the stress prediction model, and the stress prediction result is used to indicate whether each character contained in the corresponding splicing unit is a stress position; The stress position of each word segmentation unit in the text data is determined according to the stress prediction result corresponding to each splicing unit.

3. The method for predicting accent according to claim 2, characterized in that: The performing one-hot encoding on each splicing unit in the splicing result corresponding to the text data includes: According to the constructed state set, each splicing unit in the splicing result corresponding to the text data is one-hot encoded; The state set is a character set consisting of designated characters and characters included in the language to which the text data belongs, and the designated characters include word separators, stem and affix separators, and no-affix prompts.

4. The method for predicting accent according to claim 1, characterized in that: The step of splicing each word segmentation unit with the affixes of the preceding and following adjacent word segmentation units includes: For each word segmentation unit in the text data: If there is no spliceable affix before the word segmentation unit, and there is a spliceable affix after the word segmentation unit, then the spliceable affix after the word segmentation unit is spliced ​​after the word segmentation unit; If there is a spliceable affix before the word segmentation unit and there is no spliceable affix after the word segmentation unit, the spliceable affix before the word segmentation unit is spliced ​​to the front of the word segmentation unit; If there is a spliceable affix before the word segmentation unit and there is a spliceable affix after the word segmentation unit, the spliceable affix before the word segmentation unit is spliced ​​in front of the word segmentation unit, and the spliceable affix after the word segmentation unit is spliced ​​behind the word segmentation unit.

5. The stress prediction method according to any one of claims 1 to 4, characterized in that: Also includes: According to the stress position of each word segmentation unit in the text data, an stress identifier is added to the text data to obtain text data containing the stress identifier.

6. A stress prediction device, characterized in that: include: Text data acquisition module, text data processing module and information prediction module; The text data acquisition module is used to acquire text data for which the stress is to be predicted; The text data processing module is used to segment the text data to obtain segmentation units, segment each segmentation unit into stems and affixes, and concatenate each segmentation unit with the affixes of the adjacent segmentation units to obtain a concatenation result corresponding to the text data, wherein the affix is ​​a component used to realize a grammatical function; The information prediction module is used to predict the stress position of each word segmentation unit in the text data according to the splicing result corresponding to the text data; Wherein, when the information prediction module predicts the stress position of each word segmentation unit in the text data according to the splicing result corresponding to the text data, it is specifically used to: The stress position of each word segmentation unit in the text data is predicted by using a pre-constructed stress prediction module and the splicing result corresponding to the text data. The stress prediction module is a stress prediction model obtained by training a training text marked with a stress identifier, or the stress prediction module is a module that implements stress prediction based on set prediction rules.

7. A stress prediction device, characterized in that: include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the stress prediction method according to any one of claims 1 to 5.

8. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the stress prediction method according to any one of claims 1 to 5 is implemented.