Regularization method and device, and regularization model training method and device

By using special characters as units, setting multiple pronunciation categories in different contexts separately, and using Bert encoder and Softmax module to determine pronunciation categories, the problem of large workload of training sample annotation for special characters regularization models is solved, and the reduction is achieved Mark the workload and improve the detection accuracy.

CN115394286BActive Publication Date: 2024-12-10IFLYTEK (SUZHOU) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211117568.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-14
Publication Date
2024-12-10
Estimated Expiration
2042-09-14

AI Technical Summary

Technical Problem

In the prior art, the training sample annotation workload of regularized models of special characters is relatively large, mainly due to the wide variety of pronunciation categories, which leads to the huge amount of annotation workload.

Method used

By using special characters as units, setting multiple pronunciation categories in different contexts separately, and using the Bert encoder and Softmax module, the target pronunciation category of each special character is determined based on the semantic representation matrix, reducing the number of pronunciation categories, thereby Reduced the sample annotation workload.

Benefits of technology

It effectively reduces the number of pronunciation categories, reduces the annotation workload of training samples, improves the detection accuracy of the model, and simplifies the complexity of the regularized model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115394286B_ABST
    Figure CN115394286B_ABST
Patent Text Reader

Abstract

The present application provides a regularization method and device for special characters, a training method and device for a regularization model of special characters, a computer device, and a computer-readable storage medium. The regularization method includes: replacing the numbers in the initial text with corresponding number categories to obtain a target text, the initial text includes a combination of special characters, the special characters include numbers, the number categories include the length information of the numbers and / or the position information of the ambiguous numbers contained in the numbers, and the ambiguous numbers refer to numbers with different pronunciations; encoding the target text to obtain a semantic representation matrix; determining the target pronunciation category corresponding to each special character based on the semantic representation matrix, the target pronunciation category is selected from a plurality of preset pronunciation categories, and each special character corresponds to at least one preset pronunciation category. The regularization method solves the problem of a large amount of annotation workload of the training samples of the regularization model of special characters in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and specifically to a regularization method and device for special characters, a training method and device for a regularization model of special characters, a computer device, and a computer-readable storage medium. Background Art

[0002] Text to Speech (TTS) is a technology that enables machines to simulate the way people speak and convert text into natural and fluent speech. In order to convert text into natural and fluent speech, it is very important to accurately determine the pronunciation of each text symbol. This technology for determining the pronunciation of text symbols is called regularization of text symbols.

[0003] There are a large number of symbols and numbers in Chinese texts. These text symbols are collectively called special characters. Special characters are pronounced differently in different semantic scenarios. In order to take into account the contextual information of the text in which the special characters are located when predicting the pronunciation category, various regularization models based on neural networks have been proposed. However, the regularization models in related technologies contain a wide variety of pronunciation categories, resulting in a huge workload for labeling the training samples of the regularization models. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a regularization method and device for special characters, a training method and device for a regularization model of special characters, a computer device, and a computer-readable storage medium to solve the problem of large workload in labeling training samples of the regularization model of special characters in the prior art.

[0005] In a first aspect, the present application provides a regularization method for special characters, comprising: replacing numbers in an initial text with corresponding number categories to obtain a target text, wherein the initial text includes a combination of special characters, the special characters include numbers, the number categories include length information of the numbers and / or position information of ambiguous numbers contained in the numbers, and ambiguous numbers refer to numbers with different pronunciations; encoding the target text to obtain a semantic representation matrix; determining a target pronunciation category corresponding to each special character based on the semantic representation matrix, wherein the target pronunciation category is selected from a plurality of preset pronunciation categories, and each special character corresponds to at least one preset pronunciation category.

[0006] In one embodiment, encoding a target text to obtain a semantic representation matrix of the target text includes: encoding the entire target text to obtain a first semantic representation matrix; encoding a combination of special characters in the target text to obtain a second semantic representation matrix; determining at least one predetermined feature vector based on the second semantic representation matrix, the at least one predetermined feature vector including at least one of a starting position feature vector, an ending position feature vector, an attention feature vector, and a length feature vector; and determining an integrated feature matrix of the first semantic representation matrix and the at least one predetermined feature vector as a semantic representation matrix.

[0007] In one embodiment, determining the target pronunciation category corresponding to each special character based on the semantic representation matrix includes: for each special character, determining the probability that the special character belongs to each preset pronunciation category in a plurality of preset pronunciation categories based on the semantic representation matrix; determining at least one preset pronunciation category corresponding to the special character in a correspondence table between special characters and preset pronunciation categories; and determining the preset pronunciation category with the highest probability in at least one preset pronunciation category as the target pronunciation category.

[0008] In one embodiment, it also includes: matching the initial text with a correspondence table of special characters-preset pronunciation categories to determine the special characters contained in the initial text and at least one preset pronunciation category corresponding to the special characters; and determining multiple consecutive special characters as a combination of special characters.

[0009] In one embodiment, it also includes: replacing numbers in multiple initial text samples with corresponding number categories to obtain multiple target text samples, each initial text sample includes a combination of special characters, and at least one initial text sample includes numbers; the multiple initial text samples include positive samples and negative samples, the special characters in the positive samples are marked with pronunciation category labels, and the special characters in the negative samples are not marked with pronunciation category labels, and the pronunciation category labels are selected from multiple preset pronunciation categories; encoding the multiple target text samples respectively to obtain multiple semantic representation matrices; using a mask method to filter out the semantic representation matrix of the negative samples; and training a regularization model based on the semantic representation matrix of the positive samples.

[0010] The second aspect of the present application provides a training method for a regularization model of special characters, comprising: replacing numbers in multiple initial text samples with corresponding number categories to obtain multiple target text samples, each initial text sample includes a combination of special characters, and at least one initial text sample includes a number; the number category includes the length information of the number and / or the position information of the ambiguous number contained in the number, and the ambiguous number refers to a number with different pronunciations; the special characters in at least one initial text sample are marked with a pronunciation category label, and the pronunciation category label is selected from multiple preset pronunciation categories, and each special character corresponds to at least one preset pronunciation category; the multiple target text samples are encoded respectively to obtain multiple semantic representation matrices; and the regularization model is trained based on the multiple semantic representation matrices.

[0011] The third aspect of the present application provides a regularization device for special characters, including: a preprocessing module, used to replace numbers in an initial text with corresponding number categories to obtain a target text, wherein the initial text includes a combination of special characters, the special characters include numbers, the number categories include length information of the numbers and / or position information of ambiguous numbers contained in the numbers, and ambiguous numbers refer to numbers with different pronunciations; an encoding module, used to encode the target text to obtain a semantic representation matrix; a determination module, used to determine a target pronunciation category corresponding to each special character based on the semantic representation matrix, the target pronunciation category being selected from a plurality of preset pronunciation categories, and each special character corresponds to at least one preset pronunciation category.

[0012] The fourth aspect of the present application provides a training device for a regularization model of special characters, including: a preprocessing module, used to replace numbers in multiple initial text samples with corresponding number categories to obtain multiple target text samples, the initial text samples include a combination of special characters, and at least one initial text sample includes a number; the number category includes the length information of the number and / or the position information of the ambiguous number contained in the number, and the ambiguous number refers to a number with different pronunciations; the special characters in at least one initial text sample are marked with a pronunciation category label, and the pronunciation category label is selected from multiple preset pronunciation categories, and each special character corresponds to at least one preset pronunciation category; an encoding module, used to encode the multiple target text samples respectively to obtain multiple semantic representation matrices; a training module, used to train the regularization model based on the multiple semantic representation matrices.

[0013] In a fifth aspect, the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executed by the processor. When the processor executes the computer program, the steps of the regularization method for special characters provided in any of the above embodiments and / or the steps of the training method for the regularization model of special characters provided in any of the above embodiments are implemented.

[0014] In a sixth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the regularization method for special characters provided in any of the above embodiments and / or the steps of the training method for the regularization model for special characters provided in any of the above embodiments are implemented.

[0015] According to the regularization method and device of special characters provided by the embodiments of the present application, the training method and device of the regularization model of special characters, the computer device, and the computer-readable storage medium, a plurality of pronunciation categories in different contexts are set separately for each special character, taking the special characters as units. The initial text containing the special characters is input into the regularization model, and the regularization model extracts the semantic information of the initial text, and then determines the target pronunciation category of the special characters in the current text according to the semantic information. Since the pronunciation category corresponds to the special characters, it is not necessary to set the corresponding pronunciation category for the combination of special characters, thereby reducing the number of pronunciation categories, and then reducing the workload of sample annotation. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic diagram of the architecture of a regularization model for special characters provided in one embodiment of the present application.

[0017] Figure 2 A flowchart of a method for training a regularized model of special characters provided in the first embodiment of the present application.

[0018] Figure 3 A flowchart of a method for training a regularized model of special characters provided in the second embodiment of the present application.

[0019] Figure 4 A flowchart of a method for training a regularized model of special characters provided in the third embodiment of the present application.

[0020] Figure 5 A flowchart of a method for training a regularized model of special characters provided in the fourth embodiment of the present application.

[0021] Figure 6 A flowchart of a method for training a regularized model of special characters provided in the fifth embodiment of the present application.

[0022] Figure 7 A flowchart of a method for training a regularized model of special characters provided in the sixth embodiment of the present application.

[0023] Figure 8 A flowchart of a method for regularizing special characters provided in the first embodiment of the present application.

[0024] Fig. 9 A flowchart of a method for regularizing special characters provided in the second embodiment of the present application.

[0025] Fig.10 This is a flowchart of a method for regularizing special characters provided in the third embodiment of the present application.

[0026] Fig.11 This is a flowchart of a method for regularizing special characters provided in the fourth embodiment of the present application.

[0027] Fig.12 A flowchart of a special character regularization method provided in the fifth embodiment of the present application.

[0028] Fig.13 A structural block diagram of a training device for a regularized model provided in the first embodiment of the present application.

[0029] Fig.14 A structural block diagram of a training device for a regularized model provided in the second embodiment of the present application.

[0030] Fig.15 This is a structural block diagram of the regularization device provided in the first embodiment of the present application.

[0031] Fig.16 This is a structural block diagram of the regularization device provided in the second embodiment of the present application.

[0032] Fig.17 This is a structural block diagram of the regularization device provided in the third embodiment of the present application.

[0033] Fig.18 A structural block diagram of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION

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

[0035] With the development of artificial intelligence technology, human-computer interaction is increasingly appearing in people's lives. Among them, speech synthesis technology has also kept pace with the times and permeated all aspects of life. For example, in-car navigation provides customers with accurate navigation services by converting data into speech, and the voice can be customized; audiobooks change the way people read by converting text in books into speech; intelligent customer service directly communicates with customers by converting answers into human voices, thereby improving user experience, etc.

[0036] Speech synthesis technology is a complex process, which mainly includes language parsing and acoustic system. The language parsing part is also called the front-end technology of synthesis, which is mainly responsible for parsing text information. For example, regularization of text symbols, text conversion to phonemes, prediction of rhythm, etc.

[0037] Regularization of text symbols is the foundation of speech synthesis technology. Mispronouncing text symbols will directly affect the user experience. Special characters are pronounced differently in different semantic scenarios. For example, the number "119" is a numerical category in the context of expressing an amount of money and is pronounced as "one hundred and nineteen", while it is pronounced as the number string "one hundred and nineteen" when representing a telephone number. At the same time, the "1" in the number string is divided into "one" and "one". Therefore, how to effectively distinguish the pronunciation of various special characters in text plays a key role in speech synthesis technology.

[0038] Deep neural network models have been proven to be effective in learning contextual semantic information of text. Therefore, in recent years, various pronunciation category prediction models for text symbols, namely regularization models, have been proposed one after another. Conventional regularization models usually use serialization annotation methods to predict each special character, such as the Conditional Random Field (CRF) model. Conventional regularization models have a wide variety of pronunciation categories. Specifically, (1) Regularization models are usually accompanied by the prediction of labels such as the beginning, middle, and end of the pronunciation category, that is, label systems such as "BIEO" and "BIESO". In the regularization task of special characters, as the number of special character categories increases, the predicted pronunciation categories will also increase exponentially with the label system. (2) When defining the pronunciation category of special characters, some special characters are combined together and defined as a coarse-grained large category. For example, the date category "2022-03-12" and the time category "12:23". In this way, due to the variety of special character combinations, the number of pronunciation categories will increase exponentially compared to the number of special characters. The diversity of pronunciation categories leads to a huge workload for labeling training samples. At the same time, in general text, the text format of date categories varies, which can only contain the year and month, or only contain the month and day, which also brings certain difficulties to the labeling work.

[0039] In view of this, in order to solve the problem of large workload of labeling training samples of conventional regularization models, an embodiment of the present application provides a regularization method for special characters. By taking special characters as units, pronunciation categories and special characters correspond to each other, and there is no need to set corresponding pronunciation categories for combinations of special characters, thereby reducing the number of pronunciation categories and further reducing the workload of labeling training samples.

[0040] Figure 1The following is a schematic diagram of the architecture of a regularization model for special characters provided in one embodiment of the present application. The regularization model is used to determine the pronunciation category of special characters in an input text. Figure 1 As shown, the regularized model includes a Bert encoder A and a Softmax module B. Figure 2 A flowchart of a method for training a regularized model of special characters provided in the first embodiment of the present application. Figure 1 and Figure 2 As shown, the training method 200 includes:

[0041] Step S210, encoding multiple text samples to obtain a semantic representation matrix of each text sample, each text sample includes a combination of special characters, and the special characters in at least one text sample are marked with a pronunciation category label.

[0042] Step S220, training a regularized model based on multiple semantic representation matrices of multiple text samples.

[0043] In step S210, the special characters can be numbers or symbols. Before the training process begins, the correspondence between special characters and pronunciation categories has been artificially established. Table 1 lists the correspondence between some common special characters and pronunciation categories. As shown in Table 1, the pronunciation category corresponds to the special character in units of special characters, rather than to the combination of special characters. Depending on the context, each special character corresponds to at least one pronunciation category. For example, the pronunciation category corresponding to the symbol "-" in the context of "-5 degrees Celsius" is "minus", the pronunciation category corresponding to the context of "100-50=50" is "minus", and the pronunciation category corresponding to the context of "Building 4, Room 3-1" is "bar", etc.

[0044] The text sample includes a combination of special characters, and the combination of special characters refers to multiple consecutive special characters. The pronunciation category of each special character in the text sample is annotated based on the pre-defined correspondence between special characters and pronunciation categories. Since there may be omissions in the annotation process, only the special characters in a part of the multiple text samples may be annotated with pronunciation categories.

[0045] Table 1 Correspondence between some common special characters and pronunciation categories

[0046]

[0047] The process of encoding the text sample can be implemented using a conventional encoder. In this embodiment, the text sample is encoded using the Bert pre-trained language model. The Bert pre-trained language model can effectively extract the deep semantic information of the text, thereby ensuring the detection accuracy of the regularized model.

[0048] In step S220, the Focal loss function is used to train the regularization model. In this task, the number of special characters for each pronunciation is very uneven, and the proportion of special characters in numerical categories is far greater than that of other categories. Using the Focalloss function to calculate the loss of the model can reduce the weight of samples that are easy to classify and increase the weight of samples that are difficult to classify, thereby solving the problem of data imbalance.

[0049] According to the training method of the regularized model provided in this embodiment, a plurality of pronunciation categories in different contexts are set for each special character in units of special characters. Since the pronunciation categories correspond to the special characters, there is no need to set corresponding pronunciation categories for the combination of special characters, thereby reducing the number of pronunciation categories and further reducing the workload of sample annotation.

[0050] Figure 3 A flowchart of a method for training a regularized model of special characters provided in the second embodiment of the present application. Figure 3 The training method 300 and Figure 2 The difference between the training method 200 shown is that, see Figure 1 and Figure 3 , step S210 is specifically performed as follows:

[0051] Step S310: for each text sample, encode the entire text sample to obtain a first semantic representation matrix. The first semantic representation matrix contains the overall contextual semantic information of the text sample.

[0052] Step S320: Encode the combination of special characters in the text sample to obtain a second semantic representation matrix. The second semantic representation matrix contains the overall semantic information of the special characters.

[0053] Step S330: determining a semantic representation matrix of the text sample based on the first semantic representation matrix and the second semantic representation matrix.

[0054] Considering that when using fine-grained classification, it is equivalent to treating each special character as an independent individual. In this case, encoding the entire text sample may lose the overall semantic information of the combination of special characters. This defect can be remedied by adding the encoding of the combination of special characters. The network model for encoding the text sample and the combination of special characters can be the same or different. In the present embodiment, the same encoding model is adopted, such as the Bert pre-coding language model. In this way, the complexity of the regularization model can be simplified.

[0055] Figure 4 A flowchart of a method for training a regularized model of special characters provided in the third embodiment of the present application. Figure 4 The training method 400 and Figure 3 The difference between the training method 300 shown is that, see Figure 1 and Figure 4 , step S330 is specifically performed as follows:

[0056] Step S410: determining at least one predetermined feature vector based on the second semantic representation matrix.

[0057] At least one predetermined feature vector roughly reflects the overall semantic information of the combination of special characters, such as at least one of a start feature vector, an end feature vector, an attention feature vector, and a length feature vector. The start feature vector and the end feature vector can be directly obtained from the second semantic representation matrix, the attention feature vector can be obtained by applying an attention mechanism to the second semantic representation matrix, and the length feature vector can be determined based on the length of the combination of special characters.

[0058] Step S420: determining a semantic representation matrix of the text sample based on an integrated feature matrix of the first semantic representation matrix and at least one predetermined feature vector.

[0059] Taking the dimension of the first semantic representation matrix as m*n as an example, firstly, at least one predetermined feature vector is concatenated to obtain a 1*p dimensional vector. Then, the 1*p dimensional vector is reduced in dimension to obtain a 1*n dimensional vector. Next, the m*n dimensional first semantic representation matrix and the 1*n dimensional vector are concatenated into a (m+1)*n dimensional matrix as the semantic representation matrix of the text sample.

[0060] According to the training method of the regularization model provided in this embodiment, at least one predetermined feature vector is determined based on the second semantic representation matrix, and the at least one predetermined feature vector roughly reflects the overall semantic information of the combination of special characters. By adding the at least one predetermined feature vector to the semantic representation matrix of the text sample, more overall semantic information of the special characters is incorporated compared to directly adding the second semantic representation matrix to the semantic representation matrix of the text sample, and at the same time, the same part of the feature information of the second semantic representation matrix and the first semantic representation matrix can be removed, thereby reducing algorithm redundancy.

[0061] Figure 5 This is a flow chart of a method for training a regularized model of special characters provided in the fourth embodiment of the present application. Figure 5 The training method 500 shown is based on the training method provided in any of the above embodiments. Figure 2 Taking the training method 200 as an example, the training method 500 also includes the step of preprocessing the initial text. Specifically, the training method 500 includes:

[0062] Step S510, replace the numbers in the multiple text samples with corresponding number categories to obtain multiple target texts, the number categories include the length information of the number and / or the position information of the ambiguous numbers contained in the number, and the ambiguous numbers refer to numbers with different pronunciations.

[0063] In this case, step S210 is specifically performed as follows:

[0064] Step S520, encoding the multiple target texts to obtain semantic representation matrices of the multiple text samples.

[0065] Subsequently, step S220 is performed to implement the training process of the regularized model.

[0066] In step S510, the number category can be determined according to the length of the number. In this case, numbers of the same length correspond to the same number category. For example, the numbers "123" and "567" correspond to the same number category. Replacing the number itself with its length can reduce the storage space occupied by the text sample. For example, the number "123" is replaced with "3", and it is obvious that the memory space occupied by "3" is less than "123".

[0067] In this embodiment, the number category reflects the pronunciation feature information of the number. By counting the length of the number, some number sets with special meanings are separately classified as the first category, and the number sets of other lengths are unified as the second category. For example, the number categories include: {L_1, L_2, ..., L_7, L_12, L_

[0068] 18,…,L_Other}. Wherein, L_1 represents a digital category with a length of 1, and L_Other represents a digital category with a length other than the specified length. The digital category with a special length may be, for example, at least one of the length of minutes, the length of hours, the length of years, the length of telephone numbers, the length of identity cards, the length of bank card numbers, and the length of passwords. In this case, the number of digital categories is reduced, thereby further reducing the storage space occupied by the text sample.

[0069] It is not enough to just consider the length of a number. Some properties of numbers are very recognizable. For example, the number categories of "2012" and "3456" are both L_4, but the former largely represents the year. Therefore, when considering the length, we also need to consider whether the number contains ambiguous numbers and the position of ambiguous numbers. For example, whether it contains 0, 1, 2, whether it is the beginning of a number set, etc. Based on this, the number categories are expanded to {L_1_0S, L_1_1S, L_1_2S, L_2_OS, L_2_1S, L_2_1I,

[0070] …,}, where "L_2_OS" represents a set of numbers with a length of 2 and starting with "0", and "L_2_1I" represents a set of numbers with a length of 2 and containing "1", but "1" is not the first number. By adding the position information of ambiguous numbers to the number category, the pronunciation feature information contained in the number category can be increased, thereby improving the detection accuracy of the model.

[0071] Figure 6 This is a flowchart of a method for training a regularized model of special characters provided in the fifth embodiment of the present application. Figure 6 The difference between the training method 600 shown in the figure and the training method provided in any of the above embodiments is that Figure 2 Taking the training method 200 as an example, the multiple text samples include positive samples and negative samples. The special characters in the positive samples are marked with pronunciation category labels, and the special characters in the negative samples are not marked with pronunciation category labels, that is, the regular positive samples with missing labels are used as negative samples.

[0072] In this case, before step S210, step S610 is further included to determine negative samples in multiple text samples. In one embodiment, negative samples in text samples are determined based on a correspondence table between special characters and pronunciation categories. Specifically, special characters in the correspondence table are matched with text samples to determine special characters; then it is determined whether the special characters are marked with pronunciation category labels; if not, it is determined as a negative sample; otherwise, it is determined as a positive sample.

[0073] After step S210, the method further includes step S620 of filtering out the semantic representation matrix of negative samples.

[0074] In one embodiment, a mask is used to set the index position of the semantic representation matrix of the negative sample to 0 and the index position of the semantic representation matrix of the positive sample to 1, so that the semantic representation matrix of the negative sample does not participate in the calculation, so as to filter the semantic representation matrix of the negative sample.

[0075] Step S220 is executed as step S630, training a regularized model based on the semantic representation matrix of the positive sample.

[0076] It should be understood that step S610 only needs to be executed before step S620. In specific implementation, the execution order of step S610 is not limited to before step S210, and can also be after step S210.

[0077] According to the training method provided in this embodiment, the text samples with missing labels, that is, negative samples, are filtered, which effectively avoids the problem of decreased prediction performance caused by missing positive samples and improves the prediction accuracy of the model.

[0078] Figure 7Flowchart of the training method for the regularization model of special characters provided in the sixth embodiment of this application. Figure 7 The training method 700 shown integrates the training methods provided in the above embodiments. Specifically, as Figure 7 shown, the training method 700 includes:

[0079] Step S710, based on the correspondence table of special characters - pronunciation categories, extract the combinations of special characters in multiple text samples and determine negative samples.

[0080] Each text sample includes a combination of special characters. The multiple text samples include positive samples and negative samples. The special characters in the positive samples are labeled with pronunciation category labels, and the special characters in the negative samples are not labeled with pronunciation category labels. In one embodiment, step S710 can be executed as follows: for each text sample, each special character in the correspondence table of special characters - pronunciation categories is matched with the text sample to determine the special characters in the text sample; the consecutive multiple special characters are determined as the combination of special characters; the text sample corresponding to the unlabeled special characters is determined as the negative sample. Since both the process of determining the combination of special characters and the process of determining the negative sample need to be matched with the correspondence table of special characters - pronunciation categories, synchronously executing these two processes can save one matching process, thereby reducing algorithm redundancy.

[0081] For example, the positive sample is "The current time is 12:23.", and the extracted combination of special characters is "12:23". Referring to Table 1, the possible pronunciation categories corresponding to the special character "12" include: numerical value, two, and the possible pronunciation categories corresponding to the special character "23" include: numerical value, two.

[0082] Step S720, replace the numbers in the multiple text samples with the corresponding number categories respectively to obtain multiple target texts.

[0083] After replacing the numbers in the positive sample "The current time is 12:23." with the corresponding number categories, we get "The current time is L2_1S:L2_2S.", where L2_1S represents a length of 2 and the number "1" is in the first place; L2_2S represents a length of 2 and the number "2" is in the first place.

[0084] Step S730, for each target text, encode the whole of the target text to obtain the first semantic representation matrix. For example, use the Bert pre - trained language model to encode each character and symbol in the target text to obtain the context semantic representation matrix of the whole target text, that is, the first semantic representation matrix Context embedding = Bert (W i )(0 < i ≤ N). Where W i represents the i - th character or symbol in the target text.

[0085] Step S740: Encode the combination of special characters in the text sample to obtain a second semantic representation matrix. Extract the combination of special characters as a regular span, encode the regular span, and obtain the second semantic representation matrix Character embedding = Bert (W i )(m <i≤p)。

[0086] Step S750: determining at least one predetermined feature vector based on the second semantic representation matrix.

[0087] From the second semantic representation matrix Character embedding Get the starting position feature vector W of the rule span start and the end position feature vector W end The length of the regular span (pm) is represented by a vector to obtain the length feature vector L span = Emd (pm). In order to make the regularized model pay more attention to the meaning of key symbols in special combinations, the second semantic representation matrix Character embedding Apply the attention mechanism to obtain the regular span attention feature vector A span =Wa i w i , . Attention feature vector A span , starting position feature vector W start , end position feature vector W end , length feature vector L span The overall structure basically reflects the overall semantic information of the combination of special symbols.

[0088] Step S760: Using an integrated feature matrix of the first semantic representation matrix and at least one predetermined feature vector as a semantic representation matrix of the text sample.

[0089] Specifically, take the dimension of the first semantic representation matrix as m*n as an example. Concatenate the four predetermined feature vectors into a 1*p dimensional vector. Then, reduce the dimension of the 1*p dimensional vector through a pooling layer to obtain a 1*n dimensional vector Rule embedding =Pooling([W start , W end , A span , L span ]). Then, a Transformer encoding layer is used to fuse the m*n-dimensional first semantic representation matrix Context embedding and 1*n dimensional vector Rule embedding , and obtain a (m+1)*n dimensional semantic representation matrix.

[0090] Step S770, filtering out the semantic representation matrix of negative samples.

[0091] For negative samples, through the mask In this way, it is not involved in the final loss calculation. That is, when a special character is labeled with a pronunciation category label, its index position is 1, otherwise it is 0. embedding and Rule embedding Finally, the semantic representation matrix of the encoded positive sample is Sym embedding =Encofer(Context embedding Rule embedding )* if (1).

[0092] Step S780: training a regularized model based on the semantic representation matrix of the positive sample.

[0093] Sym embedding The target pronunciation category corresponding to the special character is obtained by inputting it into the softmax layer. The Focalloss function is used to calculate the loss between the target pronunciation category and the pronunciation category label, and the parameters of the regularization model are updated based on the loss value.

[0094] The present application also provides a regularization method for special characters, which is used to detect the pronunciation category of special characters in an input text. At least some steps of the regularization method can be performed by a regularization model trained by the training method provided in any of the above embodiments. Figure 8 This is a flow chart of the regularization method for special characters provided in the first embodiment of the present application. Figure 8 As shown, the regularization method 800 includes:

[0095] Step S810, encoding the initial text to obtain a semantic representation matrix of the initial text, where the initial text includes a combination of special characters.

[0096] The special characters in the initial text are selected from a pre-defined correspondence table of special characters and pronunciation categories. For example, the initial text is "The current time is 12:23."

[0097] Step S820: determining the pronunciation category of each special character in the initial text based on the semantic representation matrix.

[0098] Continuing with the above example, the output of the regularized model is:

[12] {value} [:] {point (time)}

[23] {value}. The content in [] represents special characters, and the content in {} represents the pronunciation category.

[0099] According to the regularization method provided in this embodiment, the initial text containing the combination of special characters is input into the regularization model, and the regularization model extracts the semantic information of the initial text, and then determines the target pronunciation category of each special character in the initial text according to the semantic information. Since the pronunciation category corresponds to the special character, it is not necessary to set the corresponding pronunciation category for the combination of special characters, that is, a fine-grained classification method is adopted, thereby reducing the number of pronunciation categories, and thus reducing the workload of labeling training samples.

[0100] Fig. 9 This is a flow chart of a regularization method for special characters provided in the second embodiment of the present application. Fig. 9 The regularization method 900 and Figure 8 The difference of the regularization method 800 shown is that step S810 includes:

[0101] Step S910: Encode the entire initial text to obtain a first semantic representation matrix.

[0102] Step S920: Encode the combination of special characters in the initial text to obtain a second semantic representation matrix.

[0103] Step S930: determining a semantic representation matrix of the initial text based on the first semantic representation matrix and the second semantic representation matrix.

[0104] Then, step S820 is executed to determine the pronunciation category of the special character.

[0105] Considering that the fine-grained classification method is equivalent to treating each special character as an independent individual, encoding the entire text sample may lose the overall semantic information of the combination of special characters. This defect can be compensated by adding the encoding of the combination of special characters.

[0106] The specific details involved in step S910 to step S930 can be found in the description of step S310 to step S330, which will not be repeated here.

[0107] In one embodiment, step S930 is specifically performed as follows: determining at least one predetermined feature vector based on the second semantic representation matrix; determining the semantic representation matrix of the text sample based on the integrated feature matrix of the first semantic representation matrix and at least one predetermined feature vector. According to the training method of the regularized model provided in this embodiment, at least one predetermined feature vector is determined based on the second semantic representation matrix, and the at least one predetermined feature vector roughly reflects the overall semantic information of the combination of special characters. By adding at least one predetermined feature vector to the semantic representation matrix of the text sample, more overall semantic information of special characters is incorporated compared to directly adding the second semantic representation matrix to the semantic representation matrix of the text sample, and at the same time, part of the feature information that is the same as the second semantic representation matrix and the first semantic representation matrix can be removed to reduce algorithm redundancy. The specific details involved in step S930 can be found in the description of step S410 and step S420, which will not be repeated here.

[0108] Fig.10 Flow chart of the regularization method of special characters provided in the third embodiment of the present application. In this embodiment, the special characters in the initial text include numbers. In this case, Fig.10 The difference between the regularization method 1000 shown and the regularization method provided in any of the above embodiments is that, before step S810, it further includes:

[0109] Step S1010, replace the numbers in the initial text with corresponding number categories to obtain multiple target texts, the number categories include the length information of the number and / or the position information of the ambiguous numbers contained in the number, and the ambiguous numbers refer to numbers with different pronunciations.

[0110] In one embodiment, the digital category includes a first category and a second category other than the first category, and the length information contained in the first category includes at least one of minute length, hour length, year length, telephone number length, ID number length, bank card number length, and password length.

[0111] Step S810 is specifically performed as follows:

[0112] Step S1020, encoding the target text to obtain a semantic representation matrix of the initial text.

[0113] Subsequently, step S820 is performed to determine the pronunciation category of each special character in the initial text.

[0114] The execution process of step S1010 can refer to the description of step S610, which will not be repeated here.

[0115] According to the regularization method provided in this embodiment, in the process of preprocessing the initial text, the numbers are replaced by the number categories, that is, the input of the regularization model is the number category, rather than the number itself. When the number category is the length of the number, since the memory space occupied by the length of the number is less than or equal to the memory space occupied by the number itself, the memory space occupied by the training sample during the model training process can be reduced. When the number category includes the number length information and the position information of the ambiguous number, since the position information of the ambiguous number is added, the pronunciation feature information contained in the number category can be increased, thereby improving the detection accuracy of the model.

[0116] Fig.11 This is a flow chart of a regularization method for special characters provided in the fourth embodiment of the present application. Fig.11 The regularization method 1100 shown and Figure 8 The difference of the regularization method 800 shown is that step S820 includes:

[0117] Step S1110, determining the probability that the special character belongs to each of the multiple pronunciation categories based on the semantic representation matrix. The multiple pronunciation categories refer to all the pronunciation categories in the correspondence table between the special character and the pronunciation category.

[0118] Step S1120: Based on the correspondence between the special character and the pronunciation category, determine at least one pronunciation category that the special character may correspond to.

[0119] The at least one pronunciation category that a special character may correspond to refers to the pronunciation category in all contexts corresponding to the current character recorded in the correspondence table between special characters and pronunciation categories. Taking the special character "-" in Table 1 as an example, the at least one pronunciation category that it may correspond to includes: below zero, minus, bar, and negative. Specifically, the special characters in the correspondence between special characters and pronunciation categories can be matched with text samples respectively to determine at least one pronunciation category that the special characters in the text sample may correspond to.

[0120] Step S1130 , determining a pronunciation category with the highest probability among at least one pronunciation category that the special character may correspond to as a target pronunciation category.

[0121] It should be understood that step S1120 only needs to be executed before step S1130 and is not limited to being executed after step S1110. It can also be executed before step S1110.

[0122] According to the training method provided by the present embodiment, by constraining the pronunciation categories by rules, that is, determining the target pronunciation category from at least one pronunciation category that the special character may correspond to, rather than from all pronunciation categories, the special character is predicted only in the pronunciation category label where it will appear. For example, " / " will only appear in the cases of "slash", "divided by", "each", "or", "divided by", "year", "month", "ratio", "silent", etc., but will not appear in the cases of "above zero", "below zero", etc. In this case, the target pronunciation category is determined only from "slash", "divided by", "each", "or", "divided by", "year", "month", "ratio", "silent", etc., thereby improving the prediction accuracy.

[0123] Fig.12 This is a flow chart of a method for regularizing special characters provided in the fifth embodiment of the present application. Fig.12 The regularization method 1200 shown in FIG. 1 incorporates the training methods provided in the above-mentioned embodiments. Specifically, Fig.12 As shown, the regularization method 1200 includes:

[0124] Step S1210 , based on the special character-pronunciation category correspondence table, extract the combination of special characters in the initial text, and determine at least one pronunciation category that each special character may correspond to.

[0125] Specifically, the text sample can be matched with the special characters in the special character-pronunciation category correspondence table to determine at least one pronunciation category that each special character contained in the initial text may correspond to; and multiple consecutive special characters are determined as a combination of special characters. Since the process of extracting the combination of special characters and the process of determining at least one pronunciation category that the special characters may correspond to require the same matching process, executing these two processes simultaneously can save one matching process, thereby reducing algorithm redundancy.

[0126] Step S1220, replace the numbers in the initial text with corresponding number categories to obtain the target text, the number categories include the length information of the numbers and / or the position information of the ambiguous numbers contained in the numbers, and the ambiguous numbers refer to numbers with different pronunciations.

[0127] Step S1230: Encode the entire target text to obtain a first semantic representation matrix.

[0128] Step S1240: Encode the combination of special characters in the target text to obtain a second semantic representation matrix.

[0129] Step S1250: determining a semantic representation matrix of the initial text based on the first semantic representation matrix and the second semantic representation matrix.

[0130] Step S1260, based on the semantic representation matrix, determines the probability that the special character belongs to each of the multiple pronunciation categories. The multiple pronunciation categories mentioned here refer to all pronunciation categories in the correspondence table between the special character and the pronunciation category, and each pronunciation category corresponds to a probability value, which represents the probability that the current special character belongs to the pronunciation category.

[0131] Step S1270: Determine the pronunciation category with the highest probability among at least one pronunciation category that the special character may correspond to as the target pronunciation category.

[0132] According to the regularization method provided by the present embodiment, the target pronunciation category is determined from at least one pronunciation category that the special character may correspond to, rather than from all pronunciation categories. For example, for the special character "12" in the initial text, the pronunciation categories that it may correspond to include: numerical value, two. In this case, the target pronunciation category of the special character "12" is determined to be the one with the highest probability among the two possible pronunciation categories. In this way, the detection accuracy of the pronunciation category can be improved.

[0133] The present application also provides a training device for a regularized model of special characters. Fig.13 This is a structural block diagram of the training device for the regularized model provided in the first embodiment of the present application. Fig.13 As shown, the training device 10 includes an encoding module 11 and a training module 12. The encoding module 11 is used to encode multiple text samples to obtain a semantic representation matrix of each text sample, each text sample includes a combination of special characters, and the special characters in at least one text sample are marked with a pronunciation category label. The training module 12 is used to train a regularization model based on multiple semantic representation matrices of multiple text samples.

[0134] According to the training device of the regularized model provided in this embodiment, a plurality of pronunciation categories in different contexts are set for each special character in units of special characters. Since the pronunciation categories correspond to the special characters, there is no need to set corresponding pronunciation categories for the combination of special characters, thereby reducing the number of pronunciation categories and further reducing the workload of sample annotation.

[0135] In one embodiment, the encoding module 11 is specifically used to: for each text sample, encode the entire text sample to obtain a first semantic representation matrix. Encode the combination of special characters in the text sample to obtain a second semantic representation matrix. Determine the semantic representation matrix of the text sample based on the first semantic representation matrix and the second semantic representation matrix.

[0136] The process of determining the semantic representation matrix of the text sample based on the first semantic representation matrix and the second semantic representation matrix specifically includes: determining at least one predetermined feature vector based on the second semantic representation matrix. Determining the semantic representation matrix of the text sample based on an integrated feature matrix of the first semantic representation matrix and the at least one predetermined feature vector.

[0137] According to the training device of the regularized model provided in this embodiment, the encoding of the combination of special characters is added to the semantic representation matrix of the text sample, which can increase the overall feature information of the combination of special characters, thereby improving the prediction accuracy of the model.

[0138] Fig.14 This is a structural block diagram of a training device for a regularized model provided in the second embodiment of the present application. Fig.14 As shown, the training device 20 is Fig.13 On the basis of the training device 10 shown, it further includes a preprocessing module 21 and a filtering module 22. Among them, the preprocessing module 21 is used to determine the negative samples among the multiple text samples, and the negative samples refer to the text samples that do not mark the pronunciation category of the special characters. After the encoding module 11 outputs the semantic representation matrix of each text sample, the filtering module 22 is used to filter out the semantic representation matrix of the negative samples. In this case, the training module 12 is used to train the regularization model based on the semantic representation matrix of the positive sample.

[0139] According to the training device of the regularization model provided in this embodiment, by setting the preprocessing module 21 and the filtering module 22, the text samples with missing labels, that is, negative samples, can be filtered, which effectively avoids the problem of decreased prediction performance caused by missing positive samples and improves the prediction accuracy.

[0140] In one embodiment, the preprocessing module 21 is further used to replace the numbers in the multiple text samples with corresponding number categories to obtain multiple target texts. Subsequently, the encoding module 11 encodes the multiple target texts and uses them in the subsequent training process.

[0141] According to the training device of the regularization model provided in the present embodiment, the preprocessing module 21 can also replace the numbers in the text sample with the number category, that is, the input of the regularization model is the number category, rather than the number itself. When the number category is the length of the number, since the memory space occupied by the length of the number is less than or equal to the memory space occupied by the number itself, the memory space occupied by the training sample during the model training process can be reduced. When the number category includes the number length information and the position information of the ambiguous number, since the position information of the ambiguous number is added, the pronunciation feature information contained in the number category can be increased, thereby improving the detection accuracy of the model.

[0142] The present application also provides a regularization device for special characters. Fig.15 This is a structural block diagram of the regularization device provided in the first embodiment of the present application. Fig.15 As shown, the regularization device 30 includes an encoding module 31 and a classification module 32. The encoding module 31 is used to encode the initial text to obtain a semantic representation matrix of the initial text, and the initial text includes a combination of special characters. The classification module 32 is used to determine the pronunciation category of each special character in the initial text based on the semantic representation matrix.

[0143] According to the regularization device provided by this embodiment, the initial text containing the combination of special characters is input into the regularization model, and the regularization model extracts the semantic information of the initial text, and then determines the target pronunciation category of each special character in the initial text according to the semantic information. Since the pronunciation category corresponds to the special character, it is not necessary to set the corresponding pronunciation category for the combination of special characters, that is, a fine-grained classification method is adopted, thereby reducing the number of pronunciation categories, and thus reducing the workload of labeling training samples.

[0144] In one embodiment, the encoding module 31 is used to encode the entirety of the initial text to obtain a first semantic representation matrix. The combination of special characters in the initial text is encoded to obtain a second semantic representation matrix. The semantic representation matrix of the initial text is determined based on the first semantic representation matrix and the second semantic representation matrix.

[0145] According to the regularization device provided in this embodiment, the encoding of the combination of special characters is added to the semantic representation matrix of the text sample, which can increase the overall feature information of the combination of special characters, thereby improving the prediction accuracy of the model.

[0146] Fig.16 This is a structural block diagram of the regularization device provided in the second embodiment of the present application. Fig.16 As shown, the difference between the regularization device 40 and the regularization device 30 is that it also includes a preprocessing module 41, which is used to replace the numbers in the initial text with corresponding digital categories to obtain multiple target texts. In this case, the encoding module 31 is used to encode the target text to obtain the semantic representation matrix of the initial text.

[0147] According to the regularization device provided in this embodiment, in the process of preprocessing the initial text, the numbers are replaced with number categories, that is, the input of the regularization model is the number category, not the number itself. When the number category is the length of the number, since the memory space occupied by the length of the number is less than or equal to the memory space occupied by the number itself, the memory space occupied by the training sample during the model training process can be reduced. When the number category includes the number length information and the position information of the ambiguous number, the pronunciation feature information contained in the number category can be increased due to the addition of the position information of the ambiguous number, thereby improving the detection accuracy of the model.

[0148] Fig.17 This is a structural block diagram of the regularization device provided in the third embodiment of the present application. Fig.17 As shown, the difference between the regularization device 50 and the regularization device 40 is that it also includes a rule constraint module 51, which is used to determine the pronunciation category with the highest probability in at least one pronunciation category that the special character may correspond to as the target pronunciation category. In this case, the preprocessing module 41 is also used to determine at least one pronunciation category that the special character in the initial text may correspond to.

[0149] According to the regularization device provided by the present embodiment, by constraining the pronunciation categories by rules, that is, determining the target pronunciation category from at least one pronunciation category that the special character may correspond to, rather than from all pronunciation categories, the special character is predicted only in the pronunciation category label in which it will appear. For example, " / " will only appear in the cases of "slash", "divided by", "each", "or", "divided by", "year", "month", "ratio", "silent", etc., but will not appear in the cases of "above zero", "below zero", etc. In this case, the target pronunciation category is determined only from "slash", "divided by", "each", "or", "divided by", "year", "month", "ratio", "silent", etc., thereby improving the prediction accuracy.

[0150] The training device and training method of the regularized model provided in any embodiment of the present application correspond to each other, and the regularization device and the regularization method correspond to each other. For specific details not described in the device embodiment, please refer to the corresponding method embodiment.

[0151] The present application also provides a computer device. Fig.18 This is a block diagram of a computer device provided in one embodiment of the present application. Fig.18 As shown, the computer device 60 includes: a memory 61, a processor 62, and a computer program stored in the memory 61 and executed by the processor 62. When the processor 62 executes the computer program, the steps of the regularization method for special characters provided in any of the above embodiments and / or the steps of the training method for the regularization model provided in any of the above embodiments are implemented.

[0152] The memory 61 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory includes random access memory (RAM) and / or cache memory, etc. Non-volatile memory includes read-only memory (ROM), hard disk, flash memory, etc. The memory 61 may also store a correspondence table between special characters and pronunciation categories.

[0153] The processor 62 may be a processing unit having data processing capability and / or instruction execution capability, such as a central processing unit (CPU).

[0154] The computer program may be written in one or more programming languages. Programming languages ​​include object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C". The computer program may be executed entirely on the computer device 60, partially on the computer device 60 and partially on a server, or as a stand-alone software package.

[0155] In one embodiment, the computer device 60 further includes: an input device 63 and an output device 64, which are respectively connected to the processor 62. The input device 63 can be a microphone or a microphone array for capturing sound signals. The input device 63 can also be a keyboard, a mouse, etc. The output device 64 can output various information to the outside, including the determined voice category. The output device 64 can be a display, a speaker, a printer, etc.

[0156] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements the steps of the regularization method for special characters provided in any of the above embodiments and / or the steps of the training method for the regularization model for special characters provided in any of the above embodiments.

[0157] Computer readable storage media may be any combination of one or more readable media. The readable storage medium may be in any form of electrical, magnetic, optical, electromagnetic, infrared, semiconductor, or a combination of the above forms. For example, readable storage media include: hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, etc.

[0158] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims

1. A regularization method for special characters, characterized in that: include: Replacing numbers in an initial text with corresponding number categories to obtain a target text, wherein the initial text includes a combination of special characters, the special characters include the numbers, the number categories include length information of the numbers and / or position information of ambiguous numbers contained in the numbers, and the ambiguous numbers refer to numbers with different pronunciations; Encoding the target text to obtain a semantic representation matrix; Determine a target pronunciation category corresponding to each special character based on the semantic representation matrix, wherein the target pronunciation category is selected from a plurality of preset pronunciation categories, and each of the special characters corresponds to at least one of the preset pronunciation categories; The step of encoding the target text to obtain a semantic representation matrix of the target text includes: Encoding the entire target text to obtain a first semantic representation matrix; Encoding the combination of the special characters in the target text to obtain a second semantic representation matrix; Determine at least one predetermined feature vector based on the second semantic representation matrix, wherein the at least one predetermined feature vector includes at least one of a starting position feature vector, an ending position feature vector, an attention feature vector, and a length feature vector; An integrated feature matrix of the first semantic representation matrix and the at least one predetermined feature vector is determined as the semantic representation matrix.

2. The regularization method according to claim 1, characterized in that Determining the target pronunciation category corresponding to each special character based on the semantic representation matrix includes: For each special character, determining a probability that the special character belongs to each of the plurality of preset pronunciation categories based on the semantic representation matrix; Determine at least one preset pronunciation category corresponding to the special character in a correspondence table between special characters and preset pronunciation categories; The preset pronunciation category with the highest probability among the at least one preset pronunciation category is determined as the target pronunciation category.

3. The regularization method according to claim 1, characterized in that: Also includes: Matching the initial text with a correspondence table of special characters and preset pronunciation categories to determine the special characters included in the initial text and at least one preset pronunciation category corresponding to the special characters; A plurality of continuous special characters are determined as a combination of the special characters.

4. The regularization method according to claim 1, characterized in that Also includes: Replacing numbers in a plurality of initial text samples with corresponding number categories to obtain a plurality of target text samples, each of the initial text samples comprising a combination of special characters, and at least one of the initial text samples comprising the number; the plurality of initial text samples comprising positive samples and negative samples, the special characters in the positive samples being marked with pronunciation category labels, the special characters in the negative samples being not marked with pronunciation category labels, and the pronunciation category labels being selected from the plurality of preset pronunciation categories; Encoding the multiple target text samples respectively to obtain multiple semantic representation matrices; Filtering out the semantic representation matrix of the negative sample by masking; The regularization model is trained based on the semantic representation matrix of the positive samples.

5. A training method for a regularized model of special characters, characterized in that: include: Replacing the numbers in a plurality of initial text samples with corresponding number categories to obtain a plurality of target text samples, wherein each of the initial text samples includes a combination of special characters, and at least one of the initial text samples includes the number; the number category includes the length information of the number and / or the position information of the ambiguous number contained in the number, and the ambiguous number refers to a number with different pronunciations; the special characters in at least one of the initial text samples are marked with a pronunciation category label, and the pronunciation category label is selected from a plurality of preset pronunciation categories, and each of the special characters corresponds to at least one of the preset pronunciation categories; Encoding the multiple target text samples respectively to obtain multiple semantic representation matrices; Training the regularization model based on the multiple semantic representation matrices; The step of encoding the target text to obtain a semantic representation matrix of the target text includes: Encoding the entire target text to obtain a first semantic representation matrix; Encoding the combination of the special characters in the target text to obtain a second semantic representation matrix; Determine at least one predetermined feature vector based on the second semantic representation matrix, wherein the at least one predetermined feature vector includes at least one of a starting position feature vector, an ending position feature vector, an attention feature vector, and a length feature vector; An integrated feature matrix of the first semantic representation matrix and the at least one predetermined feature vector is determined as the semantic representation matrix.

6. A regularization device for special characters, characterized in that: include: a preprocessing module, configured to replace numbers in an initial text with corresponding number categories to obtain a target text, wherein the initial text includes a combination of special characters, the special characters include the numbers, the number categories include length information of the numbers and / or position information of ambiguous numbers contained in the numbers, and the ambiguous numbers refer to numbers with different pronunciations; An encoding module, used for encoding the target text to obtain a semantic representation matrix; A determination module, configured to determine a target pronunciation category corresponding to each special character based on the semantic representation matrix, wherein the target pronunciation category is selected from a plurality of preset pronunciation categories, and each of the special characters corresponds to at least one of the preset pronunciation categories; The encoding module is also used to encode the entire target text to obtain a first semantic representation matrix; encode the combination of the special characters in the target text to obtain a second semantic representation matrix; determine at least one predetermined feature vector based on the second semantic representation matrix, the at least one predetermined feature vector including at least one of a starting position feature vector, an ending position feature vector, an attention feature vector, and a length feature vector; and determine an integrated feature matrix of the first semantic representation matrix and the at least one predetermined feature vector as the semantic representation matrix.

7. A training device for a regularized model of special characters, characterized in that: include: A preprocessing module is used to replace numbers in a plurality of initial text samples with corresponding number categories to obtain a plurality of target text samples, wherein the initial text samples include a combination of special characters, and at least one of the initial text samples includes the number; the number category includes length information of the number and / or position information of ambiguous numbers contained in the number, and the ambiguous number refers to a number with different pronunciations; the special characters in at least one of the initial text samples are marked with a pronunciation category label, and the pronunciation category label is selected from a plurality of preset pronunciation categories, and each of the special characters corresponds to at least one of the preset pronunciation categories; An encoding module, used for encoding the plurality of target text samples respectively to obtain a plurality of semantic representation matrices; A training module, used for training the regularization model based on the multiple semantic representation matrices; The encoding module is also used to encode the entire target text to obtain a first semantic representation matrix; encode the combination of the special characters in the target text to obtain a second semantic representation matrix; determine at least one predetermined feature vector based on the second semantic representation matrix, the at least one predetermined feature vector including at least one of a starting position feature vector, an ending position feature vector, an attention feature vector, and a length feature vector; and determine an integrated feature matrix of the first semantic representation matrix and the at least one predetermined feature vector as the semantic representation matrix.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executed by the processor, characterized in that: When the processor executes the computer program, it implements the steps of the regularization method for special characters as described in any one of claims 1 to 4 and / or the steps of the training method for the regularization model of special characters as described in claim 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the steps of the regularization method for special characters as described in any one of claims 1 to 4 and / or the steps of the training method for the regularization model of special characters as described in claim 5.