Method and apparatus for processing dialogue rewriting information, electronic device, and medium

CN116911318BActive Publication Date: 2026-10-27CHINA MOBILE COMM LTD RES INST +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310332024.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2026-10-27
Estimated Expiration
2043-03-30

AI Technical Summary

Technical Problem

这种方式一方面来说需要花费较大资源跑额外的模型;另外一方面,由于纠错模型需要单独训练,预测的时候也是基于单句,没有上下文的概念,所以在纠错时可能会脱离语义本身进行纠错,导致表达上没问题,但是和上下文不相关

Benefits of technology

[0039]本申请实施例提供的基于对话改写信息的处理方法、装置、电子设备及存储介质,其中,方法应用于对话改写系统中的处理装置;所述处理装置设置在所述对话改写系统中的模型预测装置之后,包括:通过所述模型预测装置获取第一文本;对第一文本进行分词处理,得到第一词文本和第二词文本;所述第一词文本表征用户的原始词信息;所述第二词文本表征所述原始词信息对应的预测词信息;根据所述第一词文本和所述第二词文本确定至少一个目标词;所述目标词属于所述第二词文本但不属于所述第一词文本;基于所述至少一个目标词和所述第一词文本确定所述目标词对应的修正词;根据所述修正词和所述第二词文本确定所述第二词文本对应的对话改写文本。采用本申请的技术方案,通过对话改写系统中的处理装置独立存在,对模型预测装置输出的第一文本进行分词处理,得到第一文本中包括的第一词文本和第二词文本;根据所述第一词文本和所述第二词文本确定至少一个目标词;基于所述至少一个目标词和所述第一词文本确定所述目标词对应的修正词;根据所述修正词和所述第二词文本确定所述第二词文本对应的对话改写文本;即无需额外的复杂模型,从而使使用成本更低,且更加贴近上下文语义。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116911318B_ABST
    Figure CN116911318B_ABST
Patent Text Reader

Abstract

The application discloses a processing method and device based on dialogue rewriting information, electronic equipment and storage medium. The method comprises the following steps: performing word segmentation processing on a first text to obtain a first word text and a second word text; the first word text represents original word information of a user; the second word text represents predicted word information corresponding to the original word information; at least one target word is determined according to the first word text and the second word text; the target word belongs to the second word text but does not belong to the first word text; a corrected word corresponding to the target word is determined based on the at least one target word and the first word text; a dialogue rewriting text corresponding to the second word text is determined according to the corrected word and the second word text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, electronic device and storage medium for processing information based on dialogue rewriting. Background Technology

[0002] One related technology involves a grammar correction-based solution, which appends a grammar correction model to the dialogue rewriting model for grammatical correction. However, this approach requires significant resources to run an additional model. Furthermore, because the correction model needs to be trained separately and predictions are based on single sentences without context, it may correct errors detached from the semantics, resulting in errors that are grammatically correct but irrelevant to the context. Currently, there is no effective solution to this problem. Summary of the Invention

[0003] To address the related technical issues, embodiments of this application provide a method, apparatus, electronic device, and storage medium for processing information based on dialogue rewriting.

[0004] The technical solution of this application embodiment is implemented as follows:

[0005] This application provides a processing method based on dialogue rewriting information, applied to a processing device in a dialogue rewriting system; the processing device is disposed after the model prediction device in the dialogue rewriting system, and the method includes:

[0006] The first text is obtained through the model prediction device;

[0007] The first text is segmented into word segments to obtain a first word text and a second word text; the first word text represents the user's original word information; the second word text represents the predicted word information corresponding to the original word information.

[0008] At least one target word is determined based on the first word text and the second word text; the at least one target word belongs to the second word text but not to the first word text.

[0009] Based on the at least one target word and the text of the first word, determine the corrected word corresponding to the target word;

[0010] The dialogue rewritten text corresponding to the second word text is determined based on the corrected word and the second word text.

[0011] In the above scheme, the first word text includes at least one first word; the step of determining the correction word corresponding to the target word based on the at least one target word and the first word text includes:

[0012] Determine whether the first target word is a subword of at least one of the first words; the first target word is any one of the at least one target words.

[0013] If the first target word is at least one subword of the first word, then at least one of the first words is used as the correction word corresponding to the target word.

[0014] In the above scheme, when the modified word corresponding to the first target word is multiple first words, the method further includes:

[0015] Determine the distance parameters between the first target word and each of the plurality of first words;

[0016] Based on the distance parameter, determine the second word corresponding to the minimum distance of the first target word;

[0017] The second word is used as the correction word corresponding to the first target word.

[0018] The method in the above scheme further includes:

[0019] Determine whether the modified word has a clear semantic meaning, and obtain the determination result;

[0020] If the judgment result indicates that the modified word has a clear semantic meaning, the dialogue rewritten text corresponding to the second word text is determined based on the modified word and the second word text.

[0021] In the above scheme, determining whether the modified word has a clear semantic meaning and obtaining the determination result includes:

[0022] Determine the part of speech of the modified word;

[0023] Determine whether the part of speech of the modified word belongs to the preset part of speech;

[0024] If the part of speech of the modified word belongs to the preset part of speech, the judgment result is determined to be that the modified word has a clear semantic meaning;

[0025] If the part of speech of the modified word does not belong to the preset part of speech, the determination result is that the modified word does not have a clear semantic meaning.

[0026] In the above scheme, determining whether the modified word has a clear semantic meaning and obtaining the determination result includes:

[0027] The modified words are matched with preset stop words; the preset stop words are determined by the user.

[0028] If the corrected word successfully matches a preset stop word, the determination result is that the corrected word does not have a clear semantic meaning;

[0029] If the modified word fails to match the preset stop word, the determination result is that the modified word has a clear semantic meaning.

[0030] In the above scheme, determining the dialogue rewritten text corresponding to the second word text based on the corrected word and the second word text includes:

[0031] Replace the target word corresponding to the corrected word in the second word text with the corrected word, and then rewrite the dialogue text corresponding to the second word text.

[0032] This application embodiment also provides a processing apparatus based on dialogue rewriting information, the processing apparatus comprising:

[0033] The word segmentation processing unit is used to segment the first text into word segments to obtain a first word text and a second word text; the first word text represents the user's original word information; the second word text represents the predicted word information corresponding to the original word information.

[0034] A determining unit is configured to determine at least one target word based on the first word text and the second word text; the at least one target word includes at least one target word; the target word belongs to the second word text but not to the first word text; determine a corrected word corresponding to the target word based on the at least one target word and the first word text; and determine the dialogue rewritten text corresponding to the second word text based on the corrected word and the second word text.

[0035] This application also provides an electronic device, including:

[0036] Memory, used to store executable instructions;

[0037] A processor, when executing executable instructions stored in the memory, implements any step of the method described above.

[0038] This application also provides a computer-readable storage medium storing executable instructions for implementing any step of the method described above when executed by a processor.

[0039] This application provides a method, apparatus, electronic device, and storage medium for processing dialogue rewriting information. The method is applied to a processing device within a dialogue rewriting system. The processing device is positioned after a model prediction device in the dialogue rewriting system and includes: acquiring first text through the model prediction device; performing word segmentation on the first text to obtain first-word text and second-word text; the first-word text representing the user's original word information; the second-word text representing predicted word information corresponding to the original word information; determining at least one target word based on the first-word text and the second-word text; the target word belonging to the second-word text but not to the first-word text; determining a corrected word corresponding to the target word based on the at least one target word and the first-word text; and determining the dialogue rewritten text corresponding to the second-word text based on the corrected word and the second-word text. By adopting the technical solution of this application, the processing device in the dialogue rewriting system exists independently. It performs word segmentation processing on the first text output by the model prediction device to obtain the first word text and the second word text included in the first text. At least one target word is determined based on the first word text and the second word text. The corrected word corresponding to the target word is determined based on the at least one target word and the first word text. The dialogue rewritten text corresponding to the second word text is determined based on the corrected word and the second word text. That is, no additional complex model is required, thereby reducing the cost of use and making it closer to the context semantics. Attached Figure Description

[0040] Figure 1 A diagram illustrating the rewriting of a dialogue example;

[0041] Figure 2 A diagram illustrating how to rewrite error cases for a dialogue;

[0042] Figure 3 This is a schematic diagram illustrating a process for processing dialogue-based information rewriting, as provided in an embodiment of this application.

[0043] Figure 4 This is a schematic diagram illustrating the division of the dialogue rewriting task into two stages in an embodiment of this application;

[0044] Figure 5 This is a schematic diagram illustrating post-processing optimization in the dialogue rewriting task of this application embodiment;

[0045] Figure 6 A schematic diagram of a processing device based on dialogue rewriting information is also provided as an embodiment of this application;

[0046] Figure 7 This is a schematic diagram of the hardware entity structure of an electronic device in an embodiment of this application. Detailed Implementation

[0047] The present application will now be described in further detail with reference to the accompanying drawings and embodiments.

[0048] Dialogue rewriting is a very important part of dialogue systems. Its main function is to complete the information omitted by users when expressing themselves during the dialogue, so as to make the overall semantics complete and facilitate intent recognition.

[0049] Figure 1 A diagram illustrating the rewriting of a dialogue example, such as... Figure 1 As shown, this is a simple dialogue flow. After a user asks about tomorrow's weather, they follow up with "What about the day after tomorrow?" At this point, the user's expression is incomplete. A complete expression would be like... Figure 2 As shown, Figure 2 This is an illustration of an incorrect example of dialogue rewriting. The complete expression should be, "What will the weather be like the day after tomorrow?" Without dialogue rewriting, the system would have difficulty recognizing the user's true intention based solely on the phrase "The day after tomorrow."

[0050] Currently, the mainstream solutions for dialogue rewriting fall into two categories: generative and annotation-based. Generative dialogue rewriting is based on a pre-trained encoder-decoder model. It concatenates historical dialogue information with the current user input and inputs it into the encoder part of the model for encoding. The encoded result is then fed into the decoder, which decodes the complete expression word by word. Annotation-based rewriting, on the other hand, does not require decoding. It directly predicts on the user input text in a manner similar to edit distance, predicting where insertions, deletions, and modifications are needed. Based on the prediction results, post-processing is then performed to obtain the final complete expression.

[0051] Currently, one solution to this problem is based on grammar correction, which involves appending a grammar correction model to the dialogue rewriting model for grammar correction. However, this approach requires significant resources to run an additional model. Furthermore, because the correction model needs to be trained separately and predictions are based on single sentences without context, it may correct errors detached from the semantics, resulting in errors that are grammatically correct but irrelevant to the context.

[0052] This application proposes a simple and convenient way to solve this problem, which requires no additional complex models, has lower usage costs, and is closer to the contextual semantics.

[0053] Based on this, embodiments of this application provide a method for processing dialogue-based rewritten information, applied to an electronic device. The functions implemented by this method can be achieved by a processor in the electronic device calling program code. Of course, the program code can be stored in a computer storage medium. Therefore, the electronic device includes at least a processor and a storage medium. As an example, the electronic device can be a mobile phone, computer, terminal, information transceiver, tablet device, personal digital assistant, etc.

[0054] Figure 3 This application provides a schematic diagram of a method for processing dialogue-based information rewriting, as illustrated in the embodiments of this application. Figure 3 As shown, the method includes:

[0055] Step 301: Perform word segmentation on the first text to obtain a first word text and a second word text; the first word text represents the user's original word information; the second word text represents the predicted word information corresponding to the original word information;

[0056] Step 302: Determine at least one target word based on the first word text and the second word text; the target word belongs to the second word text but not to the first word text;

[0057] Step 303: Determine the corrected word corresponding to the target word based on the at least one target word and the text of the first word;

[0058] Step 304: Determine the dialogue rewritten text corresponding to the second word text based on the corrected word and the second word text.

[0059] It should be noted that the method can be applied to the processing device in a dialogue rewriting system. The processing device is located after the model prediction device in the dialogue rewriting system, and the dialogue rewriting system can be determined according to the actual situation, without limitation here. As an example, the dialogue rewriting system mainly aims to complete the information omitted by the user in the dialogue process, so as to make the overall semantics complete and facilitate intent recognition. In this embodiment of the application, the dialogue rewriting system includes a model prediction device and a processing device, and the processing device is located after the model prediction device. The model prediction device has no restrictions on generative and labeled dialogue rewriting schemes, and both generative and labeled models can be used. The generative dialogue rewriting scheme is based on a pre-trained model of encoder and decoder. The historical dialogue information is concatenated with the current user input and then input into the encoder part of the model for encoding. The encoded result is then sent to the decoder, which decodes the complete expression word by word. The labeled dialogue rewriting scheme does not require decoding. It directly predicts on the user input text in a way similar to edit distance, predicting where to insert, where to delete, and where to modify. Based on the prediction results, post-processing can be performed to obtain the final complete expression. The processing device is separate and can exist independently. In practical applications, the processing device can also be understood as a processing module. The processing module can be used for post-processing optimization of generative and labeled schemes for dialogue rewriting. The post-processing optimization process can be determined according to the actual situation and is not limited here. As an example, the post-processing optimization process may include data segmentation, word segmentation deduplication, and result correction.

[0060] In step 301, the first text is segmented to obtain a first-word text and a second-word text. The first text can be obtained through the model prediction device, that is, the first text output by the model prediction device in the dialogue rewriting system. The first text can be determined according to the actual situation and is not limited here. As an example, the first text can be the generative text of dialogue rewriting and / or the labeled text of dialogue rewriting. In practical applications, the generative text of dialogue rewriting and / or the labeled text of dialogue rewriting can also be understood as data.

[0061] The first word text represents the user's original word information; wherein, the first word text and the original word information can be determined according to the actual situation, and are not limited here. As an example, the original word information can be understood as the dialogue history and the user's current input; the first word text can be a dictionary, denoted as C1.

[0062] The second word text represents the predicted word information corresponding to the original word information; wherein, the second word text and the predicted word information can be determined according to the actual situation, and are not limited here. As an example, the predicted word information can be understood as the result of predicting the original word information, such as the prediction result of the dialogue history or the user's current input; the second word text can be a dictionary, denoted as C2.

[0063] As an example, the word segmentation of the first text to obtain the first word text and the second word text can be performed by obtaining the first text through the model prediction device; performing word segmentation on the first text to obtain the first word text and the second word text included in the first text; the first word text represents the user's original word information; and the second word text represents the predicted word information corresponding to the original word information.

[0064] In practical applications, when the first text is data, the first word text is C1, and the second word text is C2, the word segmentation process can be understood as segmenting the data and simultaneously performing part-of-speech tagging. The data here includes two parts: the first part contains the dialogue history and the user's current input, resulting in dictionary C1; the second part is the prediction result of the dialogue rewriting, resulting in dictionary C2. Furthermore, to ensure more accurate word segmentation, the same word segmentation tool can be used, and the new word discovery function can be disabled to avoid confusion. When segmenting the prediction result of the dialogue rewriting, the contents of dictionary C1 should be added to the word segmentation tool's dictionary, and a high priority should be set to further avoid confusion during the segmentation process. Additionally, special markers should be introduced between different utterances to distinguish them and facilitate subsequent calculations.

[0065] In step 302, determining at least one target word based on the first word text and the second word text can be understood as deleting the first word text from the second word text to obtain the at least one target word. As an example, deleting the first word text from the second word text to obtain the at least one target word can be achieved by taking the difference between the second word text and the first word text. The at least one target word can be understood as a new word in the prediction result that does not appear in the historical information. In practical applications, the at least one target word can be a target dictionary, which can be denoted as D.

[0066] In practical applications, after rewriting the predicted content of the dialogue and segmenting it into words, words from the first part of the data segmentation result C1 are deleted from the dictionary C2. The difference set is then used to obtain new words in the prediction result that did not appear in the historical information. Let this be the dictionary D.

[0067] In step 303, determining the corrected word corresponding to the target word based on the at least one target word and the first word text can be understood as iterating through the words in the at least one target word and performing soft matching with the words in the first word text to obtain the corrected word corresponding to the target word. The soft matching process can be determined according to the actual situation and is not limited here. As an example, the soft matching process can be to determine whether the first target word is a subword of at least one of the first words; the first target word is any one of the at least one target words; if the first target word is a subword of at least one of the first words, then at least one of the first words is used as the corrected word corresponding to the target word.

[0068] In step 304, determining the dialogue rewritten text corresponding to the second word text based on the corrected word and the second word text can be understood as determining the dialogue rewritten text corresponding to the second word text based on the corrected word. As an example, determining the dialogue rewritten text corresponding to the second word text based on the corrected word can be replacing the target word corresponding to the corrected word in the second word text with the corrected word, and then determining the dialogue rewritten text corresponding to the second word text.

[0069] In this embodiment, the processing device in the dialogue rewriting system exists independently. It performs word segmentation on the first text output by the model prediction device to obtain the first word text and the second word text included in the first text. At least one target word is determined based on the first word text and the second word text. A corrected word corresponding to the target word is determined based on the at least one target word and the first word text. The dialogue rewritten text corresponding to the second word text is determined based on the corrected word and the second word text. That is, no additional complex model is required, thereby reducing the cost of use and making it closer to the context semantics.

[0070] In one embodiment, the first word text includes at least one first word; determining the correction word corresponding to the target word based on the at least one target word and the first word text includes:

[0071] Determine whether the first target word is a subword of at least one of the first words; the first target word is any one of the at least one target words.

[0072] If the first target word is at least one subword of the first word, then at least one of the first words is used as the correction word corresponding to the target word.

[0073] The first target word and the first word can be determined according to the actual situation, and are not limited here. As an example, the first target word can be understood as the current word, denoted as d1; the first word can be understood as a word in dictionary C1, denoted as c.

[0074] In practical applications, the words in dictionary D are traversed, and soft matching is performed. If the current word d1 is a subword of a word c in dictionary C1, then d1 is considered correctable, and the correcting word is c.

[0075] In one embodiment, when the correction word corresponding to the first target word is multiple first words, the method further includes:

[0076] Determine the distance parameters between the first target word and each of the plurality of first words;

[0077] Based on the distance parameter, determine the second word corresponding to the minimum distance of the first target word;

[0078] The second word is used as the correction word corresponding to the first target word.

[0079] In this embodiment, the corrected word corresponding to the first target word is multiple first words, which can be understood as the first target word matching multiple first words.

[0080] Determine the distance parameters between the first target word and each of the plurality of first words; wherein, the distance parameters can be determined according to the actual situation, and are not limited here. As an example, the distance parameters can be the distance between the position of the first target word and the position of each of the first words; the distance can be denoted as d1, d2, d3, ...

[0081] In practical applications, when multiple words are matched, the word closest to the word on the left and right sides of d1 in the original text is selected as the correction word.

[0082] In one embodiment, the method further includes:

[0083] Determine whether the modified word has a clear semantic meaning, and obtain the determination result;

[0084] If the judgment result indicates that the modified word has a clear semantic meaning, the dialogue rewritten text corresponding to the second word text is determined based on the modified word and the second word text.

[0085] It should be noted that the specific process for determining whether the modified word has a clear semantic meaning can be determined according to the actual situation and is not limited here. As an example, determining whether a word has a clear semantic meaning can be done by verifying its part of speech, such as verb, noun, time noun, etc., and by filtering through manually set stop words.

[0086] If the judgment result indicates that the corrected word has a clear semantic meaning, then determining the dialogue rewritten text corresponding to the second word text based on the corrected word and the second word text can be done by correcting the second word text based on the corrected word to determine the dialogue rewritten text corresponding to the second word text. As an example, if the judgment result indicates that the corrected word has a clear semantic meaning, then determining the dialogue rewritten text corresponding to the second word text based on the corrected word can be done by replacing the target word corresponding to the corrected word in the second word text with the corrected word, thus rewriting the dialogue rewritten text corresponding to the second word text.

[0087] In one embodiment, determining whether the modified word has explicit semantics and obtaining a determination result includes:

[0088] Determine the part of speech of the modified word;

[0089] Determine whether the part of speech of the modified word belongs to the preset part of speech;

[0090] If the part of speech of the modified word belongs to the preset part of speech, the judgment result is determined to be that the modified word has a clear semantic meaning;

[0091] If the part of speech of the modified word does not belong to the preset part of speech, the determination result is that the modified word does not have a clear semantic meaning.

[0092] In this embodiment, the specific process for determining the part of speech of the modified word can be determined according to the actual situation and is not limited here. As an example, the part of speech of the modified word can be determined by part-of-speech tagging.

[0093] The preset part of speech can be determined according to the actual situation and is not limited here. As an example, the preset part of speech may include verbs, nouns, time nouns, etc.

[0094] In one embodiment, determining whether the modified word has explicit semantics and obtaining a determination result includes:

[0095] The modified words are matched with preset stop words; the preset stop words are determined by the user.

[0096] If the corrected word successfully matches a preset stop word, the determination result is that the corrected word does not have a clear semantic meaning;

[0097] If the modified word fails to match the preset stop word, the determination result is that the modified word has a clear semantic meaning.

[0098] In this embodiment, the preset stop words can be determined according to the actual situation, and are not limited here. As an example, the preset stop words can be understood as words that are no longer used.

[0099] If the corrected word successfully matches a preset stop word, determining that the corrected word does not have a clear semantic meaning can be understood as the corrected word belonging to a preset stop word, and determining that the corrected word does not have a clear semantic meaning.

[0100] If the modified word fails to match the preset stop word, determining that the modified word has a clear semantic meaning can be understood as the modified word not belonging to the preset stop word, and determining that the modified word has a clear semantic meaning is the result of the judgment.

[0101] In one embodiment, determining the dialogue rewritten text corresponding to the second word text based on the modified word and the second word text includes:

[0102] Replace the target word corresponding to the corrected word in the second word text with the corrected word, and then rewrite the dialogue text corresponding to the second word text.

[0103] In this embodiment, the target word corresponding to the corrected word in the second word text is replaced by the corrected word. The dialogue rewritten text corresponding to the second word text can be understood as replacing the incomplete information in the prediction result by comparing the differences between the prediction result and the words in the dialogue history information, thereby restoring the words in the dialogue history information, and thus achieving the effect of correction, so as to be closer to the context semantics.

[0104] To facilitate understanding of the embodiments of this application, the example described here is an optimization method for dialogue rewriting tasks based on dialogue rewriting information from a Chinese pre-trained model. This application divides the dialogue rewriting task into two stages: model prediction and post-processing optimization, with the post-processing optimization being the focus of this paper. Furthermore, since the post-processing module is separate and can exist independently, there are no restrictions on the model prediction stage; both generative and labeled models can be used. It is important to note that if the model prediction result does not rewrite the last round of user utterances (in Chinese scenarios, this typically occurs when the topic changes), then post-processing is unnecessary. This content can be combined with... Figure 4 To understand, Figure 4 This is a schematic diagram illustrating the division of the dialogue rewriting task into two stages in an embodiment of this application.

[0105] Specifically, in the post-processing optimization section, the core process in this application proposal can be combined with... Figure 5 To understand, Figure 5 This is a schematic diagram illustrating post-processing optimization in the dialogue rewriting task of this application embodiment.

[0106] First, the data needs to be segmented and labeled with parts of speech. The data consists of two parts: the first part includes the dialogue history and the user's current input, resulting in dictionary C1; the second part is the prediction results of the dialogue rewriting, resulting in dictionary C2. There are three points to note here:

[0107] (1) Ensure that the same word segmentation tool is used and disable the new word discovery function to avoid confusion;

[0108] (2) When segmenting the prediction results of dialogue rewriting, the contents of the C1 dictionary should be added to the dictionary of the segmentation tool, and a high priority should be set to further avoid confusion during the segmentation process.

[0109] (3) Special markers need to be introduced between different discourses to distinguish them and facilitate subsequent calculations.

[0110] Next, after rewriting the predicted content of the dialogue and segmenting it into words, delete the words in the first part of the data segmentation result C1 from the dictionary C2. Perform a difference set to obtain new words in the prediction result that did not appear in the historical information. Let this be the dictionary D.

[0111] Finally, traverse the words in dictionary D to perform soft matching. If the current word d1 is a sub-word of a certain word c in dictionary C1, d1 is considered correctable, with c as the correction word, and d1 is replaced with c during correction; otherwise, the process skips. It should be additionally noted here that not all matched correction words require replacement. Instead, words with clear semantics are selected for replacement. To determine whether a word has clear semantics, verification can be performed on one hand through part-of-speech, such as verbs, nouns, temporal nouns, etc., and on the other hand, screening can be done through manually set stop words. In addition, there is a special case where multiple words are matched. At this time, the word closest to the words on the left and right sides of d1 in the original text is preferentially matched. Finally, the information of all correction words can be obtained, and this information is used to replace the content of the dialog rewriting, thereby completing the entire process.

[0112] For a clearer understanding, the above case is taken as an example to demonstrate the process.

[0113] First, perform word segmentation and part-of-speech tagging to obtain dictionaries C1 and C2, where ## is added as a special delimiter between different utterances:

[0114] C1: ['明天 / t','天气 / n','如何 / r','## / x','晴天 / nz','## / x','后天 / t','呢 / y'].

[0115] C2: ['后天 / t','气 / n','如何 / r','呢 / y'].

[0116] Next, take the difference set to obtain dictionary D:

[0117] D: ['气 / n'].

[0118] Finally, perform soft matching, search and match the word "气" to obtain "天气". Meanwhile, the part-of-speech of this word is a noun, so it can be corrected, and the final dialog rewriting result is obtained: 后天天气如何呢.

[0119] The present application proposes a dialog rewriting content correction method, which can solve the problem of incorrect content predicted by some character-based pre-trained models in dialog rewriting tasks. Specifically, this solution is implemented based on word restoration. By comparing the word differences between the dialog rewriting prediction result and the dialog history information, the content with incomplete information in the prediction result is replaced and restored to the words in the dialog history information, thereby achieving the correction effect.

[0120] Compared with the related art, the present proposal is more convenient in use, does not require large computing resources, and the final rewritten and corrected content is close to the context semantics.

[0121] To implement the method of the embodiments of this application, the embodiments of this application also provide a processing apparatus 600 based on dialogue rewriting information, such as... Figure 6 As shown, Figure 6 This application also provides a schematic diagram of a processing device based on dialogue rewriting information, including:

[0122] The word segmentation processing unit 601 is used to perform word segmentation processing on the first text to obtain a first word text and a second word text; the first word text represents the user's original word information; the second word text represents the predicted word information corresponding to the original word information.

[0123] The determining unit 602 is configured to determine at least one target word based on the first word text and the second word text; the at least one target word includes at least one target word; the target word belongs to the second word text but not to the first word text; determine the corrected word corresponding to the target word based on the at least one target word and the first word text; and determine the dialogue rewritten text corresponding to the second word text based on the corrected word and the second word text.

[0124] Here, in one embodiment, the first word text includes at least one first word; the determining unit 602 is further configured to determine whether the first target word is a sub-word of at least one first word; the first target word is any one of the at least one target words; in the case that the first target word is a sub-word of at least one first word, at least one first word is used as the correction word corresponding to the target word.

[0125] Here, in one embodiment, when the correction word corresponding to the first target word is a plurality of first words, the determining unit 602 is further configured to determine the distance parameters between the first target word and each of the plurality of first words; determine the second word corresponding to the minimum distance to the first target word based on the distance parameters; and use the second word as the correction word corresponding to the first target word.

[0126] Here, in one embodiment, the device 600 further includes a judgment unit, used to judge whether the modified word has a clear semantic meaning and obtain a judgment result; if the judgment result shows that the modified word has a clear semantic meaning, the device determines the dialogue rewritten text corresponding to the second word text based on the modified word and the second word text.

[0127] Here, in one embodiment, the judging unit is further configured to determine the part of speech of the modified word; judge whether the part of speech of the modified word belongs to a preset part of speech; if the part of speech of the modified word belongs to the preset part of speech, determine that the judging result is that the modified word has a clear semantic meaning; if the part of speech of the modified word does not belong to the preset part of speech, determine that the judging result is that the modified word does not have a clear semantic meaning.

[0128] Here, in one embodiment, the judgment unit is further configured to match the modified word with a preset stop word; the preset stop word is determined by the user; if the modified word and the preset stop word match successfully, the judgment result is determined to be that the modified word does not have a clear semantic meaning; if the modified word and the preset stop word do not match successfully, the judgment result is determined to be that the modified word has a clear semantic meaning.

[0129] Here, in one embodiment, the determining unit 602 is further configured to replace the target word corresponding to the corrected word in the second word text with the corrected word, and the dialogue rewritten text corresponding to the second word text.

[0130] It should be noted that the above embodiments of the dialogue-rewritten information processing device are only illustrated by the division of the above-described program modules. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. Furthermore, the dialogue-rewritten information processing device and the dialogue-rewritten information processing method embodiments provided above belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0131] Based on the hardware implementation of the above program modules, this application embodiment also provides an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements the steps in the dialogue-based information rewriting processing method provided in the above embodiments.

[0132] Correspondingly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the dialogue-based information rewriting processing method provided in the above embodiments.

[0133] It should be noted that the descriptions of the storage medium and device embodiments above are similar to the descriptions of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0134] It should be noted that, Figure 7 This is a schematic diagram of a hardware entity structure of an electronic device in an embodiment of this application, such as... Figure 7 As shown, the hardware entity of the electronic device 700 includes a processor 701 and a memory 703. Optionally, the electronic device 700 may also include a communication interface 702.

[0135] It is understood that memory 703 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memory 703 described in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0136] The methods disclosed in the embodiments of this application can be applied to processor 701, or implemented by processor 701. Processor 701 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 701 or by instructions in the form of software. The processor 701 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 701 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory 703. Processor 701 reads the information in memory 703 and combines its hardware to complete the steps of the aforementioned method.

[0137] In an exemplary embodiment, the device may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.

[0138] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0139] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0140] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0141] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0142] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0143] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for processing information based on dialogue rewriting, characterized in that, The method includes: The first text is segmented into word segments to obtain a first word text and a second word text; the first word text represents the user's original word information; the second word text represents the predicted word information corresponding to the original word information. At least one target word is determined based on the first word text and the second word text; the target word belongs to the second word text but not to the first word text. Based on the at least one target word and the text of the first word, determine the corrected word corresponding to the target word; Based on the corrected word and the second word text, determine the dialogue rewritten text corresponding to the second word text; The first word text includes at least one first word; the step of determining the correction word corresponding to the target word based on the at least one target word and the first word text includes: Determine whether the first target word is a subword of at least one of the first words; the first target word is any one of the at least one target words. If the first target word is at least one subword of the first word, then at least one of the first words is used as the correction word corresponding to the target word.

2. The method according to claim 1, characterized in that, When the correction word corresponding to the first target word is multiple first words, the method further includes: Determine the distance parameters between the first target word and each of the plurality of first words; Based on the distance parameter, determine the second word corresponding to the minimum distance of the first target word; The second word is used as the correction word corresponding to the first target word.

3. The method according to claim 1, characterized in that, The method further includes: Determine whether the modified word has a clear semantic meaning, and obtain the determination result; If the judgment result indicates that the modified word has a clear semantic meaning, the dialogue rewritten text corresponding to the second word text is determined based on the modified word and the second word text.

4. The method according to claim 3, characterized in that, The process of determining whether the modified word has a clear semantic meaning and obtaining a determination result includes: Determine the part of speech of the modified word; Determine whether the part of speech of the modified word belongs to the preset part of speech; If the part of speech of the modified word belongs to the preset part of speech, the judgment result is determined to be that the modified word has a clear semantic meaning; If the part of speech of the modified word does not belong to the preset part of speech, the determination result is that the modified word does not have a clear semantic meaning.

5. The method according to claim 3, characterized in that, The process of determining whether the modified word has a clear semantic meaning and obtaining a determination result includes: The modified words are matched with preset stop words; the preset stop words are determined by the user. If the corrected word successfully matches a preset stop word, the determination result is that the corrected word does not have a clear semantic meaning; If the modified word fails to match the preset stop word, the determination result is that the modified word has a clear semantic meaning.

6. The method according to any one of claims 1-5, characterized in that, The step of determining the dialogue rewritten text corresponding to the second word text based on the modified word and the second word text includes: Replace the target word corresponding to the corrected word in the second word text with the corrected word, and then rewrite the dialogue text corresponding to the second word text.

7. A processing device for rewriting information based on dialogue, characterized in that, The processing device includes: The word segmentation processing unit is used to segment the first text into word segments to obtain a first word text and a second word text; the first word text represents the user's original word information; the second word text represents the predicted word information corresponding to the original word information. A determining unit is configured to determine at least one target word based on the first word text and the second word text; the target word belongs to the second word text but not to the first word text; determine a corrected word corresponding to the target word based on the at least one target word and the first word text; and determine the dialogue rewritten text corresponding to the second word text based on the corrected word and the second word text. The determining unit is further configured to determine whether the first target word is a subword of at least one of the first words; the first target word is any one of the at least one target words; If the first target word is at least one subword of the first word, then at least one of the first words is used as the correction word corresponding to the target word.

8. An electronic device, characterized in that, include: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the processing method based on dialogue rewriting information as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, It stores executable instructions for use by a processor to implement the processing method based on dialogue rewriting information as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Text error correction and text error correction lexicon construction method

    CN114639386A