Text smoothing processing method and device, electronic equipment and storage medium

By pre-training a text smoothing model and combining an encoder and a classifier, the problem of semantic deviation in text smoothing processing is solved, achieving higher accuracy and semantic preservation.

CN116628191BActive Publication Date: 2026-01-23JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310217943.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-03
Publication Date
2026-01-23
Estimated Expiration
2043-03-03

AI Technical Summary

Technical Problem

Existing technologies fail to effectively combine text semantics and tag annotation in text smoothing, resulting in the smoothed text deviating from the original semantics and reducing accuracy.

Method used

A text smoothing model is adopted, which combines an encoder, a text label classifier, and a sentence fluency classifier. The pre-trained model comprehensively considers the text semantics and the accuracy of label annotation, deletes text with non-fluency labels, and ensures that the smoothed text does not deviate from the original semantics.

Benefits of technology

It improves the accuracy of text smoothing, ensures that the smoothed text maintains the original semantic consistency, and provides more accurate input for downstream natural language understanding modules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116628191B_ABST
    Figure CN116628191B_ABST
Patent Text Reader

Abstract

The present disclosure provides a text smoothing processing method and device, electronic equipment and storage medium. The text smoothing processing method comprises: obtaining a text to be smoothed; inputting the text to be smoothed into a text smoothing model to obtain the text to be smoothed with a text unsmooth label output by the text smoothing model; and performing smoothing processing on the text to be smoothed with the text unsmooth label to obtain a smoothed text; wherein the text smoothing model comprises an encoder, a text label classifier and a sentence fluency classifier, the text label classifier and the sentence fluency classifier share the encoder, and the text smoothing model is obtained by pre-training. Through the present disclosure, it can be ensured that the text to be smoothed after smoothing processing will not deviate from the original semantics of the text, thereby improving the text smoothing accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of text processing, and particularly relates to a text smoothing processing method and device, electronic equipment and storage medium. BACKGROUND

[0002] The text obtained by automatic speech recognition (ASR) often contains a large amount of unsmooth text. These unsmooth texts will seriously interfere with subsequent natural language understanding (NLU). The text smoothing task, as a task between the speech recognition system and the natural language understanding system, is to detect the unsmooth phenomenon of the text after speech recognition.

[0003] According to the related art, the text smoothing processing is realized by training a sequence labeling model to label the words in the text and deleting the words marked as unsmooth labels.

[0004] However, in the training process of the current sequence labeling model, attention is often paid to the label classification task itself, and the label classification is correct as the goal, without paying attention to the text semantics, which will lead to the problem that the text after smoothing processing deviates from the original semantics of the text, and reduces the text smoothing accuracy. SUMMARY

[0005] The present disclosure provides a text smoothing processing method and device, electronic equipment and storage medium to solve the problem of low text smoothing accuracy in the prior art, and realizes comprehensive consideration of text semantics and label annotation accuracy when performing text fluency labeling on the text to be smoothed, so as to ensure that the text to be smoothed after smoothing processing does not deviate from the original semantics of the text, and improves the text smoothing accuracy.

[0006] The present disclosure provides a text smoothing processing method, which comprises: obtaining a text to be smoothed; inputting the text to be smoothed into a text smoothing model to obtain the text to be smoothed with a text unsmooth label output by the text smoothing model; and performing smoothing processing on the text to be smoothed with the text unsmooth label to obtain a smoothed text; wherein the text smoothing model comprises an encoder, a text label classifier and a sentence fluency classifier, the text label classifier and the sentence fluency classifier share the encoder, and the text smoothing model is obtained by pre-training.

[0007] According to the text smoothing processing method provided in the present disclosure, the text smoothing model is pre-trained in the following manner: a first training sample set and a second training sample set are obtained; a first training sample in the first training sample set is input into the text smoothing model, and a first semantic representation of the first training sample is obtained based on the encoder; a second training sample in the second training sample set is input into the text smoothing model, and a second semantic representation of the second training sample and a single-word semantic representation of each word in the second training sample are obtained based on the encoder; the first semantic representation is input into the sentence fluency classifier to obtain a sentence fluency classification result output by the sentence fluency classifier, wherein the sentence fluency classification result includes a sentence unfluency result and a sentence fluency result; the single-word semantic representation is input into the character label classifier to obtain a character label classification result output by the character label classifier, wherein the character label classification result includes a character unfluency label result and a character fluency label result; based on the character label classification result and the second training sample, a smoothed training sample corresponding to the second training sample is constructed; the smoothed training sample is input into the encoder to obtain a third semantic representation of the smoothed training sample, and a loss function is obtained based on the second semantic representation and the third semantic representation; the text smoothing model is trained for multiple rounds based on the loss function until the value of the loss function is less than or equal to a loss threshold.

[0008] According to the text smoothing processing method provided in the present disclosure, based on the character label classification result and the second training sample, a smoothed training sample corresponding to the second training sample is constructed, specifically including: determining unfluent characters in the second training sample based on the character label classification result; deleting the unfluent characters in the second training sample to obtain the smoothed training sample corresponding to the second training sample.

[0009] According to the text smoothing processing method provided in the present disclosure, based on the second semantic representation and the third semantic representation, a loss function is obtained, specifically including: obtaining the loss function based on the mean square error of the second semantic representation and the third semantic representation.

[0010] According to the text smooth processing method provided by the present disclosure, the first training sample is provided with a first placeholder; after the first semantic representation of the first training sample is obtained based on the encoder, the method further comprises: labeling the first semantic representation to the first placeholder; and the first semantic representation is input into the sentence fluency classifier to obtain the sentence fluency classification result output by the sentence fluency classifier, specifically comprising: obtaining the first semantic representation at the first placeholder, and inputting the first semantic representation into the sentence fluency classifier to obtain the sentence fluency classification result output by the sentence fluency classifier.

[0011] According to the text smooth processing method provided by the present disclosure, the second training sample is provided with a second placeholder, and the preset position of the smoothed training sample is provided with a third placeholder; after the second semantic representation of the second training sample is obtained based on the encoder, the method further comprises: labeling the second semantic representation to the second placeholder; after the third semantic representation of the smoothed training sample is obtained, the method further comprises: labeling the third semantic representation to the third placeholder; and the loss function is obtained based on the second semantic representation and the third semantic representation, specifically comprising: obtaining the second semantic representation at the second placeholder, and obtaining the third semantic representation at the third placeholder; and obtaining the loss function based on the second semantic representation and the third semantic representation.

[0012] According to the text smooth processing method provided by the present disclosure, the first training sample set is obtained, specifically comprising: obtaining a plurality of fluent texts; randomly adding noise and / or deleting sentence components to part of the fluent texts to construct unfluent text samples, wherein the unfluent text samples are provided with sentence unfluent labels; and the fluent texts without added noise or deleted sentence components are taken as fluent text samples, wherein the fluent text samples are provided with sentence fluent labels; and the first training sample set is obtained based on the fluent text samples and the unfluent text samples.

[0013] According to the text smooth processing method provided by the present disclosure, the second training sample set is obtained, specifically comprising: obtaining a plurality of fluent texts; randomly adding noise to each of the fluent texts to obtain noise-added text samples; adding text unfluent labels to the noise in the noise-added text samples, and adding text fluent labels to other characters in the noise-added text samples except the noise; and the second training sample set is obtained based on the noise-added text samples.

[0014] According to the text smoothing processing method provided in the present disclosure, the text smoothing processing is performed on the text to be smoothed with the unsmoothed character label, and a smoothed text is obtained, which specifically comprises: determining unsmoothed characters in the text to be smoothed with the unsmoothed character label; and deleting the unsmoothed characters in the text to be smoothed to obtain the smoothed text.

[0015] The present disclosure also provides a text smoothing processing device, which comprises: an acquisition module configured to acquire a text to be smoothed; a processing module configured to input the text to be smoothed into a text smoothing model to obtain a text to be smoothed with an unsmoothed character label output by the text smoothing model; and a generation module configured to perform smoothing processing on the text to be smoothed with the unsmoothed character label to obtain a smoothed text; wherein the text smoothing model comprises an encoder, a character label classifier and a sentence fluency classifier, the character label classifier and the sentence fluency classifier share the encoder, and the text smoothing model is obtained through pre-training.

[0016] The present disclosure also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the text smoothing processing method according to any one of the above when executing the program.

[0017] The present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the text smoothing processing method according to any one of the above.

[0018] The present disclosure also provides a computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the text smoothing processing method according to any one of the above.

[0019] The text smoothing processing method, device, electronic device and storage medium provided by the present disclosure can make the sentence fluency classifier implicitly pass the sentence-level fluency or unfluency information to the character label classifier through the shared encoder, thereby affecting the learning process of the sentence fluency classifier, ensuring that the text smoothing model obtained through pre-training can comprehensively consider the text semantics and the accuracy of label annotation when performing character fluency annotation on the text to be smoothed, thereby ensuring that the text to be smoothed after smoothing processing does not deviate from the original semantics of the text, and improving the text smoothing accuracy. BRIEF DESCRIPTION OF DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the present disclosure or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings described below are some embodiments of the present disclosure, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0021] Figure 1 is a flowchart of the text smoothing processing method provided by the present disclosure;

[0022] Figure 2 is one of the flowcharts of the pre-trained text smoothing model provided by the present disclosure;

[0023] Figure 3 is another flowchart of the pre-trained text smoothing model provided by the present disclosure;

[0024] Figure 4 is an application scenario diagram of the pre-trained text smoothing model provided by the present disclosure;

[0025] Figure 5 is a flowchart of constructing a smoothed training sample corresponding to the second training sample based on the text label classification result and the second training sample provided by the present disclosure;

[0026] Figure 6 is a flowchart of obtaining a first training sample set provided by the present disclosure;

[0027] Figure 7 is a flowchart of obtaining a second training sample set provided by the present disclosure;

[0028] Figure 8 is a flowchart of smoothing processing the text to be smoothed with a text unsmooth label to obtain a smoothed text provided by the present disclosure;

[0029] Figure 9 is a structural diagram of the text smoothing processing device provided by the present disclosure;

[0030] Figure 10 is a structural diagram of the electronic device provided by the present disclosure. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the technical solutions in the present disclosure will be described clearly and completely below in combination with the drawings in the present disclosure. Obviously, the described embodiments are some embodiments of the present disclosure, not all embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present disclosure.

[0032] The text smoothing processing method provided in the present disclosure can perform text smoothing on the speech recognition result, delete the text with the unsmooth label, obtain smooth text, and keep the text semantics unchanged, so that the downstream natural language understanding module can correctly identify the user intent.

[0033] To further introduce the text smoothing processing method provided in the present disclosure, the following will be described in combination with Figure 1 .

[0034] Figure 1 FIG. 1 is a flowchart of the text smoothing processing method provided in the present disclosure.

[0035] In an exemplary embodiment of the present disclosure, in combination with Figure 1 , it can be seen that the text smoothing processing method can include steps 110 to 130, which will be introduced respectively.

[0036] In step 110, the text to be smoothed is obtained.

[0037] In step 120, the text to be smoothed is input into the text smoothing model to obtain the text to be smoothed output by the text smoothing model with the unsmooth label.

[0038] In an embodiment, the text to be smoothed can be obtained. The text to be smoothed can be the text converted by automatic speech recognition processing of the speech. Since the automatic speech recognition processing often contains additional text expressing semantics when converting the speech, such as “hmm”, “yes”, etc., the converted text (which can correspond to the text to be smoothed) has the problem of unsmoothness. In the present disclosure, the text to be smoothed can be smoothed based on the text smoothing processing method.

[0039] In another embodiment, the text to be smoothed can be input into the text smoothing model to obtain the text to be smoothed output by the text smoothing model with the unsmooth label. In an example, the text smoothing model can include an encoder, a character label classifier, and a sentence fluency classifier, wherein the character label classifier and the sentence fluency classifier can share the encoder, and the text smoothing model can be obtained by pre-training.

[0040] It should be noted that by sharing the encoder by the character label classifier and the sentence fluency classifier, the sentence fluency classifier can implicitly pass the sentence-level fluency or unfluency information to the character label classifier, thereby affecting the learning process of the sentence fluency classifier, ensuring that the text smoothing model obtained based on pre-training can consider the text semantics and the accuracy of label annotation when performing character fluency annotation on the text to be smoothed, thereby ensuring that the text to be smoothed after smoothing processing does not deviate from the original text semantics.

[0041] It can be understood that the text to be smoothed is processed based on the text to be smoothed with the text unsmooth label output by the text smoothing model, wherein the text corresponding to the text unsmooth label is unsmooth and has low importance to the sentence intention, and the smoothed text obtained based on the text to be smoothed with the text unsmooth label can be a semantic smooth text without changing the original semantics.

[0042] In step 130, the text to be smoothed with the text unsmooth label is smoothed to obtain a smoothed text.

[0043] Figure 8 The flowchart of smoothing the text to be smoothed with the text unsmooth label to obtain a smoothed text is provided in the present disclosure.

[0044] In an example embodiment of the present disclosure, in combination with Figure 8 It can be understood that smoothing the text to be smoothed with the text unsmooth label to obtain a smoothed text can include steps 810 and 820, which will be introduced respectively.

[0045] In step 810, the unsmooth text in the text to be smoothed with the text unsmooth label is determined.

[0046] In step 820, the unsmooth text in the text to be smoothed is deleted to obtain a smoothed text.

[0047] In an example, the unsmooth text in the text to be smoothed with the text unsmooth label can be determined according to the text to be smoothed with the text unsmooth label output by the text smoothing model, that is, the unsmooth text in the text to be smoothed is determined. It can be understood that the text labeled with the text unsmooth label is the unsmooth text in the text to be smoothed.

[0048] Further, the unsmooth text in the text to be smoothed is deleted to obtain a smoothed text. In an example, if the text to be smoothed is "uh uh uh is yesterday not is the day before the single", the text labeled with the text unsmooth label obtained after processing by the text smoothing model is "uh uh uh is yesterday not", "to", and the smoothed text can be "is the day before the single".

[0049] In the present embodiment, since the text smoothing model obtained based on pre-training comprehensively considers the text semantics and the accuracy of label annotation when labeling the text smoothness of the text to be smoothed, it can be ensured that the text to be smoothed after smoothing will not deviate from the original semantics of the text, and the text smoothing accuracy is improved.

[0050] The text smoothing processing method provided by the present disclosure can enable the sentence fluency classifier to implicitly pass sentence-level fluency or non-fluency information to the character label classifier, thereby affecting the learning process of the sentence fluency classifier, and ensuring that the text smoothing model obtained based on pre-training can comprehensively consider the accuracy of text semantics and label annotation when labeling the fluency of the text to be smoothed, thereby ensuring that the text to be smoothed after smoothing processing does not deviate from the original semantics of the text, and improving the text smoothing accuracy.

[0051] Figure 2 FIG. 1 is a flowchart of a pre-training text smoothing model provided by the present disclosure.

[0052] The following will be described in combination with Figure 2 The pre-training process of the text smoothing model will be described.

[0053] In an exemplary embodiment of the present disclosure, the pre-training process of the text smoothing model will be described in combination with Figure 2 It can be seen that the pre-training text smoothing model can include steps 210 to 280, which will be described below.

[0054] In step 210, a first training sample set and a second training sample set are obtained.

[0055] In an embodiment, the first training sample set and the second training sample set can be obtained. The first training sample set can be understood as a training sample set for training the encoder and the sentence fluency classifier. The second training sample set can be understood as a training sample set for training the encoder and the character label classifier.

[0056] In step 220, a first training sample in the first training sample set is input into the text smoothing model, and a first semantic representation of the first training sample is obtained based on the encoder.

[0057] In step 230, a second training sample in the second training sample set is input into the text smoothing model, and a second semantic representation of the second training sample and a single-character semantic representation of each character in the second training sample are obtained based on the encoder.

[0058] In an embodiment, a first training sample in the first training sample set can be input into the text smoothing model, and a first semantic representation of the first training sample can be obtained based on the encoder. The first semantic representation can be a semantic representation of the entire sentence of the first training sample, which can be understood as the intention of the first training sample.

[0059] In another embodiment, the second training samples from the second training sample set can be input into the text smoothing model, and the second semantic representation of the second training samples and the single-character semantic representation of each character in the second training samples can be obtained based on the encoder. The second semantic representation can be the semantic representation of the entire sentence about the second training samples, which can be understood as the intent of the second training samples. The single-character semantic representation can be the semantic information of each character in the second training samples. It should be noted that the single-character semantic representation can be used to determine whether the corresponding character is non-fluent text.

[0060] In step 240, the first semantic representation is input into the sentence fluency classifier to obtain the sentence fluency classification result output by the sentence fluency classifier.

[0061] In step 250, the semantic representation of a single character is input into the text label classifier to obtain the text label classification result output by the text label classifier.

[0062] In one embodiment, a first semantic representation can be input into a sentence fluency classifier to obtain a sentence fluency classification result output by the classifier. This sentence fluency classification result can include both non-fluency and fluency results. It is understood that, based on the sentence fluency classification result output by the classifier, it can be determined whether the first training sample is fluent text.

[0063] In another embodiment, the semantic representation of a single character can be input into a text label classifier to obtain the text label classification result output by the text label classifier. The text label classification result can include text non-fluency label results and text fluency label results. It is understood that based on the text label classification result output by the text label classifier, the text label classification result for each character in the second training sample can be obtained, that is, it can be determined which characters are fluent, and which are non-fluency or supplementary characters.

[0064] To maintain the text's meaning before and after the smoothing operation (the text to be smoothed and the smoothed text). Figure 1 To ensure consistency, the same encoder can be used to re-encode the initially smoothed text (corresponding to the smoothed training samples) to obtain a new textual intent (corresponding to the third semantics). This is achieved by constraining the preceding and following meanings. Figure 1 Consistency allows text smoothing models to learn more accurate non-fluent text information, laying the foundation for improving the accuracy of text smoothing.

[0065] The following will combine steps 260 to 280 to discuss the meaning. Figure 1 The process of consistency constraints will be explained.

[0066] In step 260, based on the text label classification results and the second training sample, a smoothed training sample corresponding to the second training sample is constructed.

[0067] In one embodiment, the initial smoothed text described above can be obtained, i.e., the smoothed training sample.

[0068] Figure 5 This is a flowchart illustrating the process of constructing a smoothed training sample corresponding to the second training sample based on the text label classification result and the second training sample.

[0069] In an exemplary embodiment of this disclosure, in conjunction with Figure 5 As can be seen, constructing a smoothed training sample corresponding to the second training sample based on the text label classification result and the second training sample can include steps 510 and 520, which will be described in detail below.

[0070] In step 510, based on the text label classification results, non-fluent text in the second training sample is identified.

[0071] In step 520, the non-fluent text in the second training sample is deleted to obtain a smooth training sample corresponding to the second training sample.

[0072] In one embodiment, since the text label classification results output by the text label classifier can include both non-fluent and fluent text label results, the text label classification results can be used to determine which characters in the second training sample are fluent and which are non-fluent. Furthermore, the non-fluent characters in the second training sample can be deleted, retaining only the fluent characters, to obtain a smoothed training sample corresponding to the second training sample.

[0073] In step 270, the smoothed training samples are input into the encoder to obtain the third semantic representation of the smoothed training samples, and the loss function is obtained based on the second and third semantic representations.

[0074] To maintain the text's meaning before and after the smoothing operation (the text to be smoothed and the smoothed text). Figure 1 To ensure consistency, the same encoder can be used to re-encode the initially smoothed text (corresponding to the smoothed training sample) to obtain a new textual intent (corresponding to the third semantics). In application, the smoothed training sample can be input into the encoder to obtain its third semantic representation. This third semantic representation can characterize the overall semantics or intent of the smoothed training sample.

[0075] Furthermore, the loss function can be obtained based on the second and third semantic representations.

[0076] In an exemplary embodiment of this disclosure, the loss function obtained based on the second semantic representation and the third semantic representation can be implemented in the following manner:

[0077] The loss function is obtained based on the mean squared error of the second and third semantic representations.

[0078] In one example, the loss function can be determined using formula (1):

[0079] loss intent =MSE(intent) disf intent flnt (1)

[0080] Where, loss intent Indicates the loss function; intent disf Indicates second semantic representation; intent flnt The third semantic representation is indicated; MSE(.) indicates mean squared error processing.

[0081] In another example, the loss function can also be obtained based on the KL divergence of the second and third semantic representations. It should be noted that the loss function can also be determined based on other processing methods of the second and third semantic representations; however, in this embodiment, the specific form of the loss function is not limited.

[0082] In step 280, the text smoothing model is trained multiple times based on the loss function until the value of the loss function is less than or equal to the loss threshold.

[0083] In one embodiment, the text smoothing model can be trained multiple times based on the loss function. That is, steps 220 to 270 are repeated using different first and second training samples until the value of the loss function is less than or equal to the loss threshold. The loss threshold can be adjusted according to the actual situation and is not specifically limited in this embodiment.

[0084] In this embodiment, unsupervised learning is employed in the pre-training process of the text smoothing method. Figure 1 Consistency constraint method constrains learning by sharing network structure and parameters (corresponding to encoder), and utilizes the semantic representation ability of deep neural networks to make the text smoothness model focus on the non-smooth parts of the text that are not important to the intent, so as to correctly classify the word labels (corresponding to text label classification results) in the text to obtain smooth text without changing the intent.

[0085] This method allows for more accurate tagging of non-fluent text, providing "cleaner" input for downstream processing (such as natural language understanding modules), thus enabling more accurate semantic understanding. Furthermore, it is important to...Figure 1 In the process of consistency constraint, self-supervised learning is adopted, only a small amount of labeled data is needed, the data labeling cost is saved, and the shared design does not increase the size and parameter quantity of the text smoothing model, and does not reduce the training and application efficiency.

[0086] Figure 3 FIG. 2 is a flowchart of a pre-training text smoothing model provided by the present disclosure.

[0087] In order to further introduce the text smoothing processing method provided by the present disclosure, the following will be described in combination with Figure 3 .

[0088] In an example embodiment of the present disclosure, in combination with Figure 3 It can be seen that the pre-training text smoothing model can include steps 301 to 310, which will be introduced respectively.

[0089] In step 301, fluent text is obtained.

[0090] In step 302, based on the fluent text, a classification text is constructed.

[0091] In step 303, based on the fluent text, a label text is constructed.

[0092] In an embodiment, a plurality of fluent texts can be obtained. Further, the fluent texts can be used to construct classification texts (corresponding to the first training samples in the first training sample set) and label texts (corresponding to the second training samples in the second training sample set).

[0093] In an example, part of the fluent texts can be selected, and noise and / or sentence components can be randomly added to the part of the fluent texts to construct unfluent text samples, wherein the unfluent text samples are provided with a sentence unfluent label. In addition, the fluent texts without added noise or deleted sentence components are used as fluent text samples, wherein the fluent text samples are provided with a sentence fluent label. Further, based on the obtained unfluent text samples and fluent text samples, classification texts can be obtained.

[0094] In another example, a plurality of fluent texts can be obtained, and noise can be randomly added to each of the fluent texts to obtain text samples after adding noise; the noise in the text samples after adding noise is added with a character unfluent label, and the other characters in the text samples after adding noise except the noise are added with a character fluent label; further, based on the text samples after adding noise, label texts can be obtained.

[0095] In step 304, the classification text and the label text are respectively input into an encoder to obtain a first semantic representation of the classification text, a second semantic representation of the label text, and a single character semantic representation.

[0096] In an embodiment, the classified text can be input into the text smoothing model, and a first semantic representation of the classified text can be obtained based on the encoder. The first semantic representation can be a semantic representation of the entire sentence of the classified text, and can be understood as an intent of the classified text.

[0097] In another embodiment, the label text can be input into the text smoothing model, and a second semantic representation of the label text and a single-word semantic representation of each word in the label text can be obtained based on the encoder. The second semantic representation can be a semantic representation of the entire sentence of the label text, and can be understood as an intent of the label text. The single-word semantic representation can be semantic information of each word in the label text. It should be noted that whether the corresponding word is an unsmooth word can be determined based on the single-word semantic representation.

[0098] In step 305, the first semantic representation is input into the sentence classifier.

[0099] In step 306, a sentence fluency classification result output by the sentence classifier is obtained.

[0100] In an embodiment, the first semantic representation can be input into the sentence classifier (corresponding to the sentence fluency classifier) to obtain a sentence fluency classification result output by the sentence classifier. The sentence fluency classification result can include an unsmooth sentence result and a smooth sentence result. It can be understood that whether the classified text is a sentence smooth text can be determined based on the sentence fluency classification result output by the sentence classifier.

[0101] In step 307, the single-word semantic representation is input into the label classifier.

[0102] In step 308, a character label classification result output by the label classifier is obtained.

[0103] In another embodiment, the single-word semantic representation can be input into the label classifier (corresponding to the character label classifier) to obtain a character label classification result output by the label classifier. The character label classification result can include an unsmooth character label result and a smooth character label result. It can be understood that the character label classification result output by the label classifier can obtain a character label classification result of each word in the label text, i.e., it can be determined which words are smooth words and which words are unsmooth words or additional words.

[0104] In step 309, based on the text label classification result, a smoothed label text is obtained, and a third semantic representation of the smoothed label text is obtained.

[0105] In step 310, an intent consistency constraint is performed based on the third semantic representation and the second semantic representation to update the model parameters. Figure 1 ​

[0106] In one embodiment, smoothed label text can be obtained based on the text label classification results. It is understood that the smoothed label text is the label text after removing the text corresponding to the non-fluent label results. Furthermore, the label text can be input into an encoder to obtain a third semantic representation of the smoothed label text.

[0107] To maintain the text's meaning before and after the smoothing operation (the text to be smoothed and the smoothed text). Figure 1 For consistency, the same encoder can be used to re-encode the initially smoothed text (corresponding to the smoothed label text) to obtain a new text intent (corresponding to the third semantics).

[0108] Furthermore, a loss function can be obtained based on the second and third semantic representations, and the text smoothing model can be trained multiple times based on the loss function until the value of the loss function is less than or equal to the loss threshold, thereby achieving semantic refinement of the text smoothing model. Figure 1 Consistency constraints are applied to update the model parameters of the text smoothing model.

[0109] The training method in this embodiment allows the trained text smoothness model to focus on the non-smooth parts of the text that are of low importance to the intent, thereby correctly classifying the word tags (corresponding to the text tag classification results) in the text to obtain smooth text that does not change the intent.

[0110] Figure 4 This is a schematic diagram illustrating an application scenario of the pre-trained text smoothing model provided in this publication.

[0111] To further introduce the text smoothing method provided in this disclosure, the following will combine... Figure 4 Please provide an explanation.

[0112] In an exemplary embodiment of this disclosure, in conjunction with Figure 4 It can be seen that the first training sample uses "Let's talk about it later" as an example, and the second training sample uses "Hmm, it was a single pair yesterday, not the day before yesterday" as an example for illustration.

[0113] The text smoothing model can be a model designed based on the Transformer network. During the training process, the first training sample and the second training sample can be input into the input layer of the text smoothing model, and after processing by the input layer, they are encoded by the encoder to obtain the first semantic representation h1(cls) of the first training sample, and the single-character semantic representation h1(1), h1(2)..., and the second semantic representation h2(cls) of the second training sample and the single-character semantic representation h2(1), h2(2)...h2(n) of each character in the second training sample.

[0114] In an example, the first semantic representation h1 (cls) can be input into the sentence fluency classifier to obtain a sentence fluency classification result output by the sentence fluency classifier, for example, 0, where 0 represents that the sentence is not fluent, and 1 represents that the sentence is fluent. Therefore, it can be determined that the first training sample "Come back later" is a sentence not fluent text, that is, it has no actual meaning.

[0115] In yet another example, the single-word semantic representations h2 (1), h2 (2),..., h2 (n) in the second training sample can be input into the character label classifier to obtain a character label classification result output by the character label classifier, for example, D, D,..., O, where D represents a character not fluent label, and O represents a character fluent label.

[0116] Further, based on the character label classification result and the second training sample, a smoothed post-training sample corresponding to the second training sample can be constructed, which can correspond to Figure 4 "Is the single word under the day before yesterday". The smoothed post-training sample is input into the encoder to obtain a third semantic representation of the smoothed post-training sample. And based on the third semantic representation and the second semantic representation, consistency constraints are performed to update the model parameters of the text fluency model. Figure 1

[0117] It should be noted that a special placeholder (for example, [CLS]) can also be added at a preset position (for example, the initial position of the sentence) of each training sample, for example, the first training sample and the second training sample, to represent the sentence level information (corresponding to the first semantic representation, the second semantic representation and the third semantic representation). Wherein, the preset position can be adjusted according to actual conditions, and in this embodiment, the preset position is not specifically limited.

[0118] In order to further introduce the text fluency processing method provided by the present disclosure, the following embodiments will be described.

[0119] In an example embodiment of the present disclosure, the first training sample can be provided with a first placeholder at a preset position. Wherein, the preset position can be adjusted according to actual conditions, for example, it can be the initial position of the sentence, and in this embodiment, the preset position is not specifically limited.

[0120] Continue to combine Figure 2 to illustrate, after step 220, the text fluency processing method can further include the following steps:

[0121] The first semantic representation is marked to the first placeholder.

[0122] The first semantic representation is input into the sentence fluency classifier to obtain a sentence fluency classification result output by the sentence fluency classifier, which can be implemented in the following way: ​

[0123] obtaining the first semantic representation at the first placeholder, and inputting the first semantic representation into the sentence fluency classifier to obtain a sentence fluency classification result output by the sentence fluency classifier.

[0124] In the application process, by setting the first semantic representation at a preset position, for example, at the first placeholder, when the first semantic representation is called, the first placeholder can be directly called, so that the calling speed and processing efficiency can be improved.

[0125] In an example embodiment of the present disclosure, the preset position of the second training sample can be provided with a second placeholder; and the preset position of the smoothed training sample is provided with a third placeholder. The preset position can be adjusted according to actual conditions, for example, it can be the initial position of the sentence, and in this embodiment, the preset position is not specifically limited.

[0126] Continue to combine Figure 2 It is explained that after step 230, the text smoothing processing method can further include the following steps:

[0127] The second semantic representation is labeled to the second placeholder.

[0128] After obtaining the third semantic representation of the smoothed training sample (corresponding to step 260), the text smoothing processing method can further include the following steps:

[0129] The third semantic representation is labeled to the third placeholder.

[0130] Further, the loss function is obtained based on the second semantic representation and the third semantic representation, specifically including:

[0131] The second semantic representation is obtained from the second placeholder, and the third semantic representation is obtained from the third placeholder;

[0132] The loss function is obtained based on the second semantic representation and the third semantic representation.

[0133] In the application process, by respectively setting the second semantic representation and the third semantic representation at preset positions, for example, at the second placeholder and the third placeholder, when the second semantic representation and the third semantic representation are called, the second placeholder and the third placeholder can be directly called, so that the calling speed and processing efficiency can be improved.

[0134] Figure 6 is a flowchart provided by the present disclosure for obtaining a first training sample set.

[0135] The following will be combined Figure 6 The process of obtaining the first training sample set will be described.

[0136] In an exemplary embodiment of this disclosure, in conjunction with Figure 6 As can be seen, obtaining the first training sample set may include steps 610 to 640, and each step will be described below.

[0137] In step 610, multiple fluent texts are obtained.

[0138] In step 620, noise is randomly added and / or sentence components are deleted from a portion of the fluent text to construct non-fluent text samples, wherein the non-fluent text samples are labeled with sentence non-fluency.

[0139] In one embodiment, a portion of fluent text can be selected to construct non-fluent text samples. During application, noise can be randomly added and / or sentence components can be deleted from the fluent text to construct non-fluent text samples. A sentence non-fluency label can be set for the non-fluent text samples.

[0140] In step 630, fluent text without added noise or deleted sentence components is used as a fluent text sample, wherein the fluent text sample is set with a sentence fluency label.

[0141] In another embodiment, a portion of fluent text can be selected to construct fluent text samples. During application, fluent text without added noise or deleted sentence components can be directly used as fluent text samples. Sentence fluency tags can be set for these fluent text samples.

[0142] In step 640, a first training sample set is obtained based on fluent text samples and non-fluent text samples.

[0143] In one embodiment, a first training sample set can be obtained by combining multiple constructed fluent text samples and multiple non-fluent text samples.

[0144] Figure 7 This is a flowchart illustrating the process of obtaining the second training sample set provided in this publication.

[0145] The following will combine Figure 7 The process of obtaining the second training sample set is explained.

[0146] In an exemplary embodiment of this disclosure, in conjunction with Figure 7 As can be seen, obtaining the second training sample set may include steps 710 to 740, and each step will be described below.

[0147] In step 710, multiple fluent texts are obtained.

[0148] In step 720, noise is randomly added to each fluent text to obtain text samples with added noise.

[0149] In one embodiment, noise can be randomly added to fluent text to construct text containing additional text (corresponding to the text sample with added noise). It is understood that the text sample with added noise is non-fluent text.

[0150] In step 730, a text non-fluency label is added to the noise in the text sample after noise is added, and a text fluency label is added to the other words in the text sample after noise is added.

[0151] In step 740, a second training sample set is obtained based on the text samples with added noise.

[0152] In one embodiment, the text sample with added noise can be divided into two parts: one part is noise, and the other part consists of characters other than the noise. In one example, a "text not smooth" label can be added to the noise, and a "text smooth" label can be added to the other characters in the text sample with added noise. It can be understood that the text sample with added noise is the labeled "text not smooth," and in the application process, a second training sample set can be obtained based on multiple such text samples with added noise.

[0153] In the aforementioned embodiments, by constructing a first training sample set and a second training sample set, the foundation can be laid for a pre-trained text smoothing model.

[0154] As described above, the text smoothing method disclosed herein is based on a Transformer network-based text smoothing model. This model includes an encoder and a classification layer (corresponding to a text label classifier and a sentence fluency classifier). The encoder encodes the input text to obtain semantic information. The classification layer performs sentence and label classification on the implicit representation of the text. The sentence classification (corresponding to the sentence fluency classifier) ​​shares the encoder of the label classification (corresponding to the text label classifier), thus implicitly passing sentence-level information and assisting in the label classification task. To ensure that the text retains its meaning before and after the smoothing operation... Figure 1 Consistency is achieved by using the same encoder to re-encode the smooth text and obtain new textual intents, thereby constraining the preceding and following meanings. Figure 1 Consistency is improved, enabling the model to learn more accurate non-fluent text information. In this disclosure, because the pre-trained text smoothing model comprehensively considers the accuracy of text semantics and label annotation when annotating the text to be smoothed, it can ensure that the text to be smoothed after smoothing does not deviate from the original semantics, thereby improving the accuracy of text smoothing.

[0155] Based on the same concept, this disclosure also provides a text smoothing processing apparatus.

[0156] The text smoothing apparatus provided in this disclosure is described below. The text smoothing apparatus described below can be referred to in correspondence with the text smoothing method described above.

[0157] Figure 9 This is a schematic diagram of the text smoothing processing device provided in this disclosure.

[0158] In an exemplary embodiment of this disclosure, in conjunction with Figure 9 As can be seen, the text smoothing processing device may include an acquisition module 910, a processing module 920, and a generation module 930. Each module will be described in detail below.

[0159] The acquisition module 910 can be configured to acquire the text to be smoothed.

[0160] The processing module 920 can be configured to input the text to be smoothed into the text smoothing model and obtain the text to be smoothed with text non-fluency labels output by the text smoothing model. The text smoothing model includes an encoder, a text label classifier and a sentence fluency classifier. The text label classifier and the sentence fluency classifier share the encoder. The text smoothing model is obtained through pre-training.

[0161] The generation module 930 can be configured to smooth text that has text non-fluency tags to obtain smooth text.

[0162] In an exemplary embodiment of this disclosure, the processing module 920 may pre-train a text smoothing model in the following manner:

[0163] Obtain the first training sample set and the second training sample set;

[0164] The first training sample in the first training sample set is input into the text smoothing model, and the first semantic representation of the first training sample is obtained based on the encoder;

[0165] The second training samples in the second training sample set are input into the text smoothing model, and the second semantic representation of the second training samples and the single-character semantic representation of each character in the second training samples are obtained based on the encoder.

[0166] The first semantic representation is input into the sentence fluency classifier to obtain the sentence fluency classification result output by the sentence fluency classifier. The sentence fluency classification result includes sentence non-fluency result and sentence fluency result.

[0167] The semantic representation of a single character is input into the text label classifier to obtain the text label classification result output by the text label classifier. The text label classification result includes the text non-fluent label result and the text fluent label result.

[0168] Based on the text label classification results and the second training sample, construct a smoothed training sample corresponding to the second training sample;

[0169] The smoothed training samples are input into the encoder to obtain the third semantic representation of the smoothed training samples, and the loss function is obtained based on the second and third semantic representations.

[0170] The text smoothing model is trained in multiple rounds based on the loss function until the value of the loss function is less than or equal to the loss threshold.

[0171] In an exemplary embodiment of this disclosure, the processing module 920 may construct a smoothed training sample corresponding to the second training sample based on the text label classification result and the second training sample in the following manner:

[0172] Based on the text label classification results, non-fluent text in the second training sample was identified.

[0173] The non-fluent text in the second training sample is deleted to obtain the smooth training sample corresponding to the second training sample.

[0174] In an exemplary embodiment of this disclosure, the processing module 920 may obtain the loss function based on the second semantic representation and the third semantic representation in the following manner:

[0175] The loss function is obtained based on the mean squared error of the second and third semantic representations.

[0176] In an exemplary embodiment of this disclosure, a first placeholder is provided at a preset position of the first training sample;

[0177] Processing module 920 can also be configured to:

[0178] Mark the first semantic representation as the first placeholder;

[0179] The processing module 920 can input the first semantic representation into the sentence fluency classifier in the following way to obtain the sentence fluency classification result output by the sentence fluency classifier:

[0180] The first semantic representation is obtained from the first placeholder and input into the sentence fluency classifier to obtain the sentence fluency classification result output by the sentence fluency classifier.

[0181] In an exemplary embodiment of this disclosure, a second placeholder is provided at the preset position of the second training sample, and a third placeholder is provided at the preset position of the smoothed training sample;

[0182] Processing module 920 can also be configured to:

[0183] Mark the second semantic representation as the second placeholder;

[0184] Mark the third semantic representation as the third placeholder;

[0185] The processing module 920 can also obtain the loss function based on the second semantic representation and the third semantic representation in the following ways:

[0186] The second semantic representation is obtained from the second placeholder, and the third semantic representation is obtained from the third placeholder;

[0187] The loss function is obtained based on the second and third semantic representations.

[0188] In an exemplary embodiment of this disclosure, the processing module 920 may also obtain the first training sample set in the following manner:

[0189] Get multiple fluent texts;

[0190] Noise is randomly added and / or sentence components are deleted from some fluent texts to construct non-fluent text samples, where non-fluent text samples are labeled with sentence non-fluency.

[0191] Fluent text without added noise or removed sentence components is used as a fluent text sample, wherein the fluent text sample is labeled with sentence fluency.

[0192] The first training sample set is obtained based on fluent and non-fluent text samples.

[0193] In an exemplary embodiment of this disclosure, the processing module 920 may also obtain the second training sample set in the following manner:

[0194] Get multiple fluent texts;

[0195] Noise was randomly added to each fluent text to obtain text samples with added noise.

[0196] Add a text non-fluency label to the noise in the text sample after adding noise, and add a text fluency label to other words in the text sample after adding noise, excluding the noise;

[0197] The second training sample set is obtained based on the text samples with added noise.

[0198] In an exemplary embodiment of this disclosure, the generation module 930 can smooth the text to be smoothed by means of a text with a non-fluency label, thereby obtaining smooth text:

[0199] Identify non-fluency text in the text to be smoothed that is tagged with "non-fluency text";

[0200] Remove non-fluent text from the text to be smoothed to obtain smooth text.

[0201] Figure 10 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 10 As shown, the electronic device may include a processor 1010, a communications interface 1020, a memory 1030, and a communication bus 1040, wherein the processor 1010, the communications interface 1020, and the memory 1030 communicate with each other via the communication bus 1040. The processor 1010 can call logical instructions in the memory 1030 to execute a text smoothing method, which includes: acquiring text to be smoothed; inputting the text to be smoothed into a text smoothing model to obtain text to be smoothed with non-fluency tags output by the text smoothing model; and performing smoothing processing on the text to be smoothed with non-fluency tags to obtain smoothed text; wherein the text smoothing model includes an encoder, a text tag classifier, and a sentence fluency classifier, the text tag classifier and the sentence fluency classifier sharing the encoder, and the text smoothing model being obtained through pre-training.

[0202] Furthermore, the logical instructions in the aforementioned memory 1030 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0203] On the other hand, this disclosure also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the text smoothing methods provided by the above methods. The method includes: acquiring text to be smoothed; inputting the text to be smoothed into a text smoothing model to obtain text to be smoothed with text non-fluency tags output by the text smoothing model; and performing smoothing processing on the text to be smoothed with text non-fluency tags to obtain smooth text. The text smoothing model includes an encoder, a text tag classifier, and a sentence fluency classifier. The text tag classifier and the sentence fluency classifier share the encoder. The text smoothing model is obtained through pre-training.

[0204] In another aspect, this disclosure also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the text smoothing methods provided by the above methods. The method includes: acquiring text to be smoothed; inputting the text to be smoothed into a text smoothing model to obtain text to be smoothed with non-fluency tags output by the text smoothing model; and smoothing the text to be smoothed with non-fluency tags to obtain smoothed text. The text smoothing model includes an encoder, a text tag classifier, and a sentence fluency classifier, wherein the text tag classifier and the sentence fluency classifier share the encoder, and the text smoothing model is obtained through pre-training.

[0205] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0206] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0207] It is further understood that although operations are described in a specific order in the accompanying drawings in the embodiments of this disclosure, this should not be construed as requiring these operations to be performed in the specific order or serial order shown, or requiring all of the shown operations to be performed to obtain the desired result. In certain environments, multitasking and parallel processing may be advantageous.

[0208] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit them. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure.

Claims

1. A text smoothing processing method, characterized in that, The text smoothing method includes: Get the text to be smoothed; The text to be smoothed is input into the text smoothing model to obtain the text to be smoothed with the text non-fluency label output by the text smoothing model. The text to be smoothed, which contains the text non-fluency tag, is smoothed to obtain smooth text; The text smoothing model includes an encoder, a text tag classifier, and a sentence fluency classifier. The text tag classifier and the sentence fluency classifier share the encoder. The text smoothing model is obtained through pre-training. The text smoothing model was pre-trained using the following method: Obtain the first training sample set and the second training sample set; The first training sample in the first training sample set is input into the text smoothing model, and the first semantic representation of the first training sample is obtained based on the encoder; The second training sample in the second training sample set is input into the text smoothing model, and the second semantic representation of the second training sample and the single-character semantic representation of each character in the second training sample are obtained based on the encoder. The first semantic representation is input into the sentence fluency classifier to obtain the sentence fluency classification result output by the sentence fluency classifier, wherein the sentence fluency classification result includes sentence non-fluency result and sentence fluency result; The semantic representation of the single character is input into the text label classifier to obtain the text label classification result output by the text label classifier, wherein the text label classification result includes text non-fluency label result and text fluency label result; Based on the text label classification results and the second training sample, a smoothed training sample corresponding to the second training sample is constructed. The smoothed training samples are input into the encoder to obtain the third semantic representation of the smoothed training samples, and a loss function is obtained based on the second semantic representation and the third semantic representation; The text smoothing model is trained multiple times based on the loss function until the value of the loss function is less than or equal to the loss threshold. The first training sample set is used to train the encoder and the sentence fluency classifier; the second training sample set is used to train the encoder and the text label classifier.

2. The text smoothing method according to claim 1, characterized in that, The step of constructing a smoothed training sample corresponding to the second training sample based on the text label classification result and the second training sample specifically includes: Based on the text label classification results, the non-fluent text in the second training sample is determined; The non-fluent text in the second training sample is deleted to obtain a smooth training sample corresponding to the second training sample.

3. The text smoothing method according to claim 1, characterized in that, The loss function is obtained based on the second semantic representation and the third semantic representation, specifically including: The loss function is obtained based on the mean squared error of the second semantic representation and the third semantic representation.

4. The text smoothing method according to claim 1, characterized in that, The first training sample has a first placeholder set at its preset position; After obtaining the first semantic representation of the first training sample based on the encoder, the method further includes: Mark the first semantic representation onto the first placeholder; The step of inputting the first semantic representation into the sentence fluency classifier to obtain the sentence fluency classification result output by the sentence fluency classifier specifically includes: The first semantic representation is obtained from the first placeholder, and the first semantic representation is input into the sentence fluency classifier to obtain the sentence fluency classification result output by the sentence fluency classifier.

5. The text smoothing method according to claim 1 or 3, characterized in that, The second training sample has a second placeholder at its preset position, and the smoothed training sample has a third placeholder at its preset position. After obtaining the second semantic representation of the second training sample based on the encoder, the method further includes: The second semantic representation is labeled to the second placeholder; After obtaining the third semantic representation of the smoothed training samples, the method further includes: The third semantic representation is labeled to the third placeholder; The loss function derived based on the second semantic representation and the third semantic representation specifically includes: The second semantic representation is obtained from the second placeholder, and the third semantic representation is obtained from the third placeholder; The loss function is obtained based on the second semantic representation and the third semantic representation.

6. The text smoothing method according to claim 1, characterized in that, The acquisition of the first training sample set specifically includes: Get multiple fluent texts; Noise is randomly added and / or sentence components are deleted from a portion of the fluent text to construct non-fluent text samples, wherein the non-fluent text samples are labeled with sentence non-fluency tags; The fluent text without added noise or deleted sentence components is used as a fluent text sample, wherein the fluent text sample is set with sentence fluency tags; The first training sample set is obtained based on the fluent text samples and the non-fluent text samples.

7. The text smoothing method according to claim 1, characterized in that, The acquisition of the second training sample set specifically includes: Get multiple fluent texts; Noise was randomly added to each of the fluent texts to obtain text samples with added noise. Add a text non-fluency label to the noise in the text sample after adding noise, and add a text fluency label to other characters in the text sample after adding noise, excluding the noise; The second training sample set is obtained based on the text samples with added noise.

8. The text smoothing method according to claim 1, characterized in that, The process of smoothing the text to be smoothed, which contains text with non-fluency tags, to obtain smooth text specifically includes: Identify the non-fluency text in the text to be smoothed, which is labeled with a non-fluency text tag. The non-fluent text in the text to be smoothed is deleted to obtain the smooth text.

9. A text smoothing processing device, characterized in that, The text smoothing processing apparatus is used to implement the text smoothing processing method according to any one of claims 1 to 8, the apparatus comprising: The acquisition module is used to acquire the text to be smoothed. The processing module is used to input the text to be smoothed into the text smoothing model and obtain the text to be smoothed with the text non-fluency label output by the text smoothing model; The generation module is used to smooth the text to be smoothed, which has a text non-fluency tag, to obtain smooth text. The text smoothing model includes an encoder, a text label classifier, and a sentence fluency classifier. The text label classifier and the sentence fluency classifier share the encoder. The text smoothing model is obtained through pre-training.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the text smoothing method as described in any one of claims 1 to 8.

11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the text smoothing method as described in any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the text smoothing method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Text smoothing method and system and computer equipment

    CN114611492A

  • Systems and methods for semi-supervised extraction of text classification information

    US20220229984A1