Conversation rewriting method and device, computer equipment, readable storage medium and program product
By obtaining and utilizing the key information of the previous round of dialogue in the dialogue rewriting model, the target dialogue is rewritten, and the problem of inefficient dialogue in the existing technology is solved, achieving more accurate user intention understanding and higher dialogue efficiency.
Patent Information
- Application Number
- CN202411724917.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to accurately understand the user's intentions when handling multiple rounds or complex conversations, resulting in inefficiency of conversations.
By obtaining the key information of the previous round of conversations in the target dialogue and rewriting based on the preset dialogue rewriting model, the rewritten target dialogue is obtained, thereby improving dialogue efficiency.
It realizes a more accurate understanding of user intentions in multiple rounds or complex conversations, improves conversation efficiency, and improves user experience.
Smart Images

Figure CN119623481A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of natural language processing, and in particular to a dialogue rewriting method, apparatus, computer equipment, readable storage medium and program product. Background Art
[0002] With the rapid development of artificial intelligence technology, dialogue systems have become one of the important forms of human-computer interaction. Dialogue systems can simulate communication between people and provide functions such as information query, task execution, and emotional companionship. In multi-round dialogue systems, the understanding and use of previous round information is particularly critical. The previous context includes not only the dialogue history, but also the user's behavior patterns, emotional state, etc. Context-aware technology can help the dialogue system better understand the user's intentions and needs, thereby providing more accurate and personalized responses. However, related technologies and dialogue methods often have certain limitations, especially when dealing with complex or multi-round dialogues, they cannot accurately understand the user's intentions, resulting in low dialogue efficiency. Summary of the invention
[0003] Based on this, it is necessary to provide a dialogue rewriting method, device, computer equipment, readable storage medium and program product to improve dialogue efficiency when conducting multi-round or complex dialogues in response to the above technical problems.
[0004] In a first aspect, the present application provides a dialogue rewriting method, comprising:
[0005] Get the key information of the previous round of the target dialogue;
[0006] According to the preset dialogue rewriting model and the key information, the target dialogue is rewritten to obtain a rewritten target dialogue, and the rewritten target dialogue is stored.
[0007] In one embodiment, rewriting the target dialogue according to the preset dialogue rewriting model and the key information to obtain the rewritten target dialogue includes:
[0008] If the target dialogue is a follow-up question of the previous round of dialogue of the target dialogue, and the content of the target dialogue is incomplete, the target dialogue is completed based on the key information to obtain a completed target dialogue;
[0009] The completed target dialogue is determined as the rewritten target dialogue.
[0010] In one embodiment, the method further comprises:
[0011] If the target dialogue does not belong to the follow-up question of the previous round of dialogue of the target dialogue, the target dialogue is output, and the target dialogue, the answer corresponding to the target dialogue, and the rewritten previous round of dialogue are determined as the rewritten target dialogue.
[0012] In one embodiment, the method further comprises:
[0013] If the target dialogue is the first round of dialogue, the target dialogue and the answer corresponding to the target dialogue are stored.
[0014] In one embodiment, the method further comprises:
[0015] If the target dialogue is the first round of dialogue, the target dialogue and the answer corresponding to the target dialogue are stored.
[0016] In one embodiment, the method further comprises:
[0017] Annotating the target dialogue and the rewritten target dialogue based on a preset annotation strategy to obtain an annotation result;
[0018] An initial dialogue rewriting model is trained based on the annotation results, the target dialogue, and the rewritten target dialogue to obtain the preset dialogue rewriting model.
[0019] In a second aspect, the present application also provides a dialogue rewriting device, comprising:
[0020] The acquisition module is used to obtain the key information of the previous round of the target dialogue;
[0021] The processing module is used to rewrite the target dialogue according to the preset dialogue rewriting model and the key information, obtain the rewritten target dialogue, and store the rewritten target dialogue.
[0022] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0023] Get the key information of the previous round of the target dialogue;
[0024] According to the preset dialogue rewriting model and the key information, the target dialogue is rewritten to obtain a rewritten target dialogue, and the rewritten target dialogue is stored.
[0025] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0026] Get the key information of the previous round of the target dialogue;
[0027] According to the preset dialogue rewriting model and the key information, the target dialogue is rewritten to obtain a rewritten target dialogue, and the rewritten target dialogue is stored.
[0028] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0029] Get the key information of the previous round of the target dialogue;
[0030] According to the preset dialogue rewriting model and the key information, the target dialogue is rewritten to obtain a rewritten target dialogue, and the rewritten target dialogue is stored.
[0031] The above-mentioned dialogue rewriting method, device, computer equipment, readable storage medium and program product rewrite the target dialogue by presetting the dialogue rewriting model and the key information of the previous round of the target dialogue, obtain the rewritten target dialogue, and store the rewritten target dialogue. It is possible to store only the rewritten target dialogue of each round of dialogue, so that when conducting multiple rounds of dialogue or complex dialogues, the user's intention can be understood more accurately, the dialogue efficiency can be improved, and the user experience can be enhanced. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 A flowchart of a conversation rewriting method in one embodiment;
[0034] Figure 2 A flowchart of a conversation rewriting method in one embodiment;
[0035] Figure 3 A flowchart of a conversation rewriting method in one embodiment;
[0036] Figure 4 is a structural block diagram of a dialogue rewriting device in one embodiment;
[0037] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0039] In an exemplary embodiment, Figure 1 As shown, a method for rewriting a conversation is provided. This embodiment uses the method applied to a terminal as an example for explanation. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0040] Step 101: Obtain key information of the previous round of dialogue of the target dialogue.
[0041] Among them, the key information can reflect the topic of the previous round of dialogue, the user's behavior pattern and emotional state, etc. The target dialogue can be the question raised in the current dialogue.
[0042] Specifically, the terminal may extract key information of each round of dialogue. The terminal may extract key information of the previous round of dialogue at the end of each round of dialogue or the current round of dialogue, or may extract key information of the previous round of dialogue while the current round of dialogue is in progress. The terminal may determine the current dialogue as the target dialogue. When the terminal detects the target dialogue, it may obtain key information of the previous round of dialogue of the target dialogue.
[0043] Exemplarily, the terminal can identify one or more of the entities (names, place names, etc.), keywords, and topic information of each round of conversation. The terminal can select keywords with high frequency of occurrence as target keywords for the current round, and determine the entity, target keyword, or topic information as key information. The terminal can identify the entities, keywords, and topic information of each round of conversation through a preset recognition model. For example, the preset recognition model can be a bidirectional encoder representation (Bidirectional Encoder Representations from Transformers, BERT) based on a deep learning model architecture (Transformers), etc., which is not specifically limited here.
[0044] Step 102: rewrite the target dialogue according to the preset dialogue rewriting model and key information to obtain the rewritten target dialogue, and store the rewritten target dialogue.
[0045] The rewritten target dialogue at least includes the rewritten questions in the target dialogue.
[0046] Specifically, the terminal may determine the relationship between the target dialogue and the previous dialogue of the target dialogue according to the preset dialogue rewriting model to obtain a determination result. The terminal may rewrite the target dialogue based on the determination result and key information to obtain a rewritten target dialogue. The terminal may adopt an incremental storage strategy to store the rewritten target dialogue.
[0047] In addition, the terminal can respond according to the rewritten target dialogue to obtain the question of the target dialogue. The terminal can judge the relationship between the next round of the target dialogue and the target dialogue according to the rewritten target dialogue to obtain the judgment result, and so on, which will not be repeated here.
[0048] The above-mentioned dialogue rewriting method rewrites the target dialogue by presetting the dialogue rewriting model and the key information of the previous round of the target dialogue, obtains the rewritten target dialogue, and stores the rewritten target dialogue. It can only store the rewritten target dialogue of each round of dialogue, so that when conducting multiple rounds of dialogue or complex dialogues, it can more accurately understand the user's intentions, improve dialogue efficiency, and enhance the user experience.
[0049] In an exemplary embodiment, rewriting the target dialogue according to the preset dialogue rewriting model and key information to obtain the rewritten target dialogue specifically includes:
[0050] If the target dialogue is a follow-up question of the previous round of dialogue of the target dialogue and the content of the target dialogue is incomplete, the target dialogue is completed based on the key information to obtain a completed target dialogue; the completed target dialogue is determined as the rewritten target dialogue.
[0051] Specifically, the terminal can determine whether the target dialogue belongs to the follow-up question of the previous round of dialogue of the target dialogue. The terminal can identify whether the target dialogue is related to the previous round of dialogue of the target dialogue based on a preset semantic recognition model. If the target dialogue is related to the previous round of dialogue of the target dialogue, it is determined that the target dialogue belongs to the follow-up question of the previous round of dialogue. The terminal can determine whether the content of the question of the target dialogue is complete. The terminal can identify the target dialogue based on the preset semantic recognition model and perform grammatical and semantic analysis to obtain grammatical and semantic analysis results. The terminal can determine whether there is any missing content in the question of the target dialogue based on the grammatical and semantic analysis results. If there is any missing content in the question of the target dialogue, it is determined that the content of the target dialogue is incomplete.
[0052] If the terminal determines that the target dialogue is a follow-up question of the previous round of dialogue of the target dialogue, and the content of the target dialogue is incomplete, the target dialogue is completed based on the key information of the previous round of dialogue to obtain the completed target dialogue.
[0053] The terminal may determine the completed target dialogue as the rewritten target dialogue.
[0054] Exemplarily, if the terminal determines that the content of the target dialogue lacks a subject or other parts, it determines that the content of the target dialogue is incomplete, and completes the target dialogue based on key information of the previous round of dialogue to obtain a completed target dialogue.
[0055] In this embodiment, when the target dialogue is a follow-up question of the previous round of dialogue of the target dialogue and the content of the target dialogue is incomplete, only the completed target dialogue is stored, which improves storage efficiency, reduces storage costs, and facilitates subsequent multiple rounds of dialogue, thereby improving dialogue efficiency.
[0056] In an exemplary embodiment, the dialogue rewriting method further includes:
[0057] If the target dialogue does not belong to the follow-up question of the previous round of dialogue of the target dialogue, the target dialogue is output, and the target dialogue, the answer corresponding to the target dialogue, and the rewritten previous round of dialogue are determined as the rewritten target dialogue.
[0058] The rewritten last round of dialogue may be a rewritten dialogue of the last round of dialogue of the target dialogue.
[0059] Specifically, the terminal can determine whether the target dialogue is a follow-up question of the previous round of dialogue of the target dialogue. The terminal can identify whether the target dialogue is related to the previous round of dialogue of the target dialogue based on a preset semantic recognition model. If the target dialogue is not related to the previous round of dialogue of the target dialogue, it is determined that the target dialogue is not a follow-up question of the previous round of dialogue.
[0060] If the terminal determines that the target dialogue does not belong to the follow-up question of the previous round of dialogue of the target dialogue, the target dialogue is directly output. The terminal can respond based on the target dialogue and obtain the answer corresponding to the target dialogue. The terminal can obtain the rewritten previous round of dialogue of the previous round of dialogue of the target dialogue. The terminal can determine the target dialogue, the answer corresponding to the target dialogue, and the rewritten previous round of dialogue as the rewritten target dialogue. It should be understood that the rewritten previous dialogue can be determined according to the above embodiment, which will not be repeated here.
[0061] In addition, when the terminal receives the next round of the target dialogue, it can judge whether the next round of the target dialogue belongs to the follow-up question of the target dialogue or the follow-up question of the previous round of the target dialogue through the rewritten target dialogue. If the next round of the target dialogue belongs to the follow-up question of the previous round of the target dialogue, the next round of the target dialogue is rewritten based on the rewritten previous round of dialogue to obtain the next round of the rewritten target dialogue. The specific rewriting process is similar to the rewriting process of the target dialogue in the above embodiment, which will not be repeated here.
[0062] In this embodiment, when the target dialogue is not a follow-up question of the previous round of dialogue of the target dialogue, the target dialogue, the answer to the target dialogue and the rewritten previous round of dialogue are stored, so that even if there is a switch between different topics during the dialogue, multiple rounds of questions and answers can be conducted on the previous rounds of dialogue topics when answering subsequent questions, thereby improving storage efficiency and reducing storage costs.
[0063] In an exemplary embodiment, the dialogue rewriting method further includes:
[0064] If the content of the target dialogue is complete, the target dialogue is output, and the target dialogue is determined as the rewritten target dialogue.
[0065] Specifically, the terminal may determine whether the content of the question of the target dialogue is complete. The terminal may identify the target dialogue based on a preset semantic recognition model and perform grammatical and semantic analysis to obtain grammatical and semantic analysis results. The terminal may determine whether the question of the target dialogue has missing content based on the grammatical and semantic analysis results. If the question of the target dialogue does not have missing content, it is determined that the content of the target dialogue is complete. The terminal may directly output the target dialogue and determine the target dialogue as the rewritten target dialogue.
[0066] In addition, if the target dialogue is a follow-up question of the previous round of dialogue of the target dialogue and the content of the target dialogue is complete, the terminal outputs the target dialogue and determines the target dialogue as the rewritten target dialogue.
[0067] In this embodiment, considering whether the content of the target conversation is complete, if the content of the target conversation is complete,
[0068] In an exemplary embodiment, the dialogue rewriting method further includes:
[0069] If the target dialogue is the first round of dialogue, the target dialogue and the answer corresponding to the target dialogue are stored.
[0070] Specifically, if the terminal detects that the target dialogue is the first round of dialogue in the current dialogue, it responds based on the target dialogue, obtains an answer corresponding to the target dialogue, and stores the target dialogue and the answer corresponding to the target dialogue.
[0071] In addition, the terminal can determine the target dialogue as the rewritten target dialogue. If the next round of dialogue of the target dialogue, that is, the second round of dialogue is not a follow-up question of the first round of dialogue, the second round of dialogue, the answer to the second round of dialogue and the rewritten target dialogue of the first round are determined as the rewritten dialogue of the second round.
[0072] In this embodiment, it is determined whether the current round is the first round of dialogue. If it is the first round of dialogue, the target dialogue and the answer to the target dialogue are directly stored, so that it is convenient to update the rewritten result when conducting questions and answers on the same topic.
[0073] In an exemplary embodiment, the dialogue rewriting method further includes:
[0074] The target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue are annotated based on a preset annotation strategy to obtain an annotation result; the initial dialogue rewriting model is trained based on the annotation result, the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue to obtain a preset dialogue rewriting model.
[0075] The initial dialogue model may be a model with semantic understanding capability, and the annotation result may reflect the effect of the rewriting of the target dialogue.
[0076] Specifically, the terminal may collect the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue of a preset cycle duration. The terminal may use the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue as training data. The terminal may annotate the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue based on a preset annotation strategy to obtain an annotation result. The terminal may determine the effect of the rewriting of the target dialogue based on the annotation result. The terminal may input the annotation results, the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue collected within the preset cycle duration into the initial dialogue rewriting model, train the initial dialogue rewriting model, and obtain a preset dialogue rewriting model. For example, the preset cycle duration may be one week or one month, etc., which is not limited here. The terminal may collect the annotation results, the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue within the preset cycle duration to train the preset dialogue rewriting results.
[0077] Exemplarily, the terminal may collect the user's annotation results of the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue according to the user interaction system.
[0078] In addition, the terminal can dynamically adjust the preset labeling strategy based on the real-time feedback of the conversation and the portrait of the online user.
[0079] In addition, the terminal can collect a large amount of round-by-round dialogue data, and the multi-round dialogue data can be multiple rounds of continuous or discontinuous questions and answers. The terminal can collect multi-round dialogue data from online dialogue system logs, public dialogue data sets, social media dialogue records, etc. The terminal can also guide the large model to autonomously generate contextual dialogues through prompt engineering, and guide the large model to generate follow-up questions of the question and second-round questions to complete the answer by inputting questions and answers to the large model. The terminal can annotate a batch of multi-round dialogue rewriting data sets according to the preset annotation strategy, and organize the collected multi-round dialogues into the form of: first round questions-first round answers-second round questions-second round questions completion, as the initial training set of the multi-round dialogue rewriting model. The terminal can build an initial dialogue rewriting model based on the initial training set.
[0080] In this embodiment, the dialogue rewriting model is trained by labeling the results, the target dialogue, the answer to the target dialogue, and the rewritten target dialogue to improve the accuracy of the dialogue rewriting model. Through adaptive learning, the dialogue rewriting model can continuously learn the latest user behavior patterns, gradually improve the understanding of user intentions and user portraits, and thus improve the accuracy and personalization of the rewriting, enhance user satisfaction and the natural fluency of the interactive experience. In addition, this dynamic adaptability ensures that the system can meet the growing diversity and specialization needs.
[0081] In one embodiment, the terminal may periodically evaluate the performance indicators of the preset dialogue rewriting model, and the performance indicators may include but are not limited to rewriting accuracy, rewriting result quality, and user satisfaction, etc. The terminal may compare the performance indicators with the preset performance indicator conditions. If the performance indicators exceed the range specified by the preset performance indicator conditions, it is determined that the performance indicators do not meet the preset performance indicator conditions, and the relevant parameters of the preset dialogue rewriting model are updated based on the performance indicators.
[0082] In this embodiment, through regular performance monitoring, problems existing in the model can be discovered and optimized in a timely manner, ensuring the stability and reliability of the multi-round dialogue rewriting model.
[0083] In an exemplary embodiment, Figure 2 As shown, the dialogue rewriting method includes the following steps:
[0084] Construct a multi-round dialogue dataset; train a dialogue rewriting model based on the dialogue dataset; rewrite the target dialogue based on the preset dialogue rewriting model to obtain the rewritten target dialogue, and store the rewritten target dialogue based on the key information incremental storage strategy; periodically train the dialogue rewriting model based on an adaptive feedback loop to obtain the preset dialogue rewriting model; evaluate the performance of the dialogue rewriting model and monitor the dialogue rewriting model.
[0085] In an exemplary embodiment, Figure 3 As shown, the dialogue rewriting method can be implemented by a dialogue rewriting system. The dialogue rewriting system can include a key information incremental storage module and an adaptive foul loop module. The dialogue rewriting method specifically includes the following steps:
[0086] The terminal may detect whether the target dialogue is the first round, and if the target dialogue is the first round, store the target dialogue and the question of the target dialogue.
[0087] If the target dialogue is not the first round, it is determined based on the preset dialogue rewriting model whether the topic is the same as the previous round of dialogue of the target dialogue. If it is the same topic, the rewritten target dialogue is stored.
[0088] If they are different topics, the rewritten previous round of dialogue, the target dialogue, and the answer corresponding to the target dialogue are stored.
[0089] The terminal can collect the conversation data of each round of conversation. The terminal can annotate the conversation data based on a preset annotation strategy to obtain an annotation result, and input the annotation result, the target conversation, the answer corresponding to the target conversation, and the rewritten target conversation as training data into a preset rewriting model to train the preset rewriting model.
[0090] In this embodiment, by introducing an incremental storage strategy for key information and an adaptive feedback reflow method, the interaction quality of the online dialogue system can be continuously improved, the user experience can be enhanced, and more accurate, natural, and personalized multi-round dialogues can be achieved. At the same time, resource utilization can be optimized and storage efficiency can be improved.
[0091] This embodiment can be used in online multi-round dialogue scenarios.
[0092] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0093] Based on the same inventive concept, the embodiment of the present application also provides a dialogue rewriting device for implementing the above-mentioned dialogue rewriting method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more dialogue rewriting device embodiments provided below can refer to the above-mentioned limitations on the dialogue rewriting method, and will not be repeated here.
[0094] In an exemplary embodiment, Figure 4 As shown, a dialogue rewriting device 40 is provided, comprising: an acquisition module 41 and a processing module 42, wherein:
[0095] An acquisition module 41 is used to acquire key information of the previous round of the target conversation;
[0096] The processing module 42 is used to rewrite the target dialogue according to the preset dialogue rewriting model and key information, obtain the rewritten target dialogue, and store the rewritten target dialogue.
[0097] In one embodiment, the processing module 42 is specifically configured to complete the target dialogue based on the key information to obtain a completed target dialogue if the target dialogue is a follow-up question of the previous dialogue and the content of the target dialogue is incomplete;
[0098] The completed target dialogue is determined as the rewritten target dialogue.
[0099] In one embodiment, the processing module 42 is further used to output the target dialogue if the target dialogue does not belong to the follow-up question of the previous round of dialogue of the target dialogue, and determine the target dialogue, the answer corresponding to the target dialogue and the rewritten previous round of dialogue as the rewritten target dialogue.
[0100] In one embodiment, the processing module 42 is further configured to output the target dialogue if the content of the target dialogue is complete, and determine the target dialogue as the rewritten target dialogue.
[0101] In one embodiment, the processing module 42 is further configured to store the target dialogue and the answer corresponding to the target dialogue if the target dialogue is the first round of dialogue.
[0102] In one embodiment, the processing module 42 is further used to annotate the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue based on a preset annotation strategy to obtain an annotation result;
[0103] The initial dialogue rewriting model is trained based on the annotation results, the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue to obtain the preset dialogue rewriting model.
[0104] Each module in the above-mentioned dialogue rewriting device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0105] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a dialogue rewriting model method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0106] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0107] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0108] Get the key information of the previous round of the target dialogue;
[0109] According to the preset dialogue rewriting model and key information, the target dialogue is rewritten to obtain the rewritten target dialogue, and the rewritten target dialogue is stored.
[0110] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0111] If the target dialogue is a follow-up question of the previous round of dialogue of the target dialogue, and the content of the target dialogue is incomplete, the target dialogue is completed based on the key information to obtain a completed target dialogue;
[0112] The completed target dialogue is determined as the rewritten target dialogue.
[0113] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0114] If the target dialogue does not belong to the follow-up question of the previous round of dialogue of the target dialogue, the target dialogue is output, and the target dialogue, the answer corresponding to the target dialogue, and the rewritten previous round of dialogue are determined as the rewritten target dialogue.
[0115] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0116] If the content of the target dialogue is complete, the target dialogue is output, and the target dialogue is determined as the rewritten target dialogue.
[0117] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0118] If the target dialogue is the first round of dialogue, the target dialogue and the answer corresponding to the target dialogue are stored.
[0119] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0120] Annotate the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue based on a preset annotation strategy to obtain an annotation result;
[0121] The initial dialogue rewriting model is trained based on the annotation results, the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue to obtain a preset dialogue rewriting model.
[0122] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0123] Get the key information of the previous round of the target dialogue;
[0124] According to the preset dialogue rewriting model and key information, the target dialogue is rewritten to obtain the rewritten target dialogue, and the rewritten target dialogue is stored.
[0125] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0126] If the target dialogue is a follow-up question of the previous round of dialogue of the target dialogue, and the content of the target dialogue is incomplete, the target dialogue is completed based on the key information to obtain a completed target dialogue;
[0127] The completed target dialogue is determined as the rewritten target dialogue.
[0128] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0129] If the target dialogue does not belong to the follow-up question of the previous round of dialogue of the target dialogue, the target dialogue is output, and the target dialogue, the answer corresponding to the target dialogue, and the rewritten previous round of dialogue are determined as the rewritten target dialogue.
[0130] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0131] If the content of the target dialogue is complete, the target dialogue is output, and the target dialogue is determined as the rewritten target dialogue.
[0132] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0133] If the target dialogue is the first round of dialogue, the target dialogue and the answer corresponding to the target dialogue are stored.
[0134] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0135] Annotate the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue based on a preset annotation strategy to obtain an annotation result;
[0136] The initial dialogue rewriting model is trained based on the annotation results, the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue to obtain a preset dialogue rewriting model.
[0137] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0138] Get the key information of the previous round of the target dialogue;
[0139] According to the preset dialogue rewriting model and key information, the target dialogue is rewritten to obtain the rewritten target dialogue, and the rewritten target dialogue is stored.
[0140] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0141] If the target dialogue is a follow-up question of the previous round of dialogue of the target dialogue, and the content of the target dialogue is incomplete, the target dialogue is completed based on the key information to obtain a completed target dialogue;
[0142] The completed target dialogue is determined as the rewritten target dialogue.
[0143] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0144] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0145] If the target dialogue does not belong to the follow-up question of the previous round of dialogue of the target dialogue, the target dialogue is output, and the target dialogue, the answer corresponding to the target dialogue, and the rewritten previous round of dialogue are determined as the rewritten target dialogue.
[0146] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0147] If the content of the target dialogue is complete, the target dialogue is output, and the target dialogue is determined as the rewritten target dialogue.
[0148] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0149] If the target dialogue is the first round of dialogue, the target dialogue, the answer corresponding to the target dialogue, and the answer corresponding to the target dialogue are stored.
[0150] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0151] Annotate the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue based on a preset annotation strategy to obtain an annotation result;
[0152] The initial dialogue rewriting model is trained based on the annotation results, the target dialogue, and the rewritten target dialogue to obtain a preset dialogue rewriting model.
[0153] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0154] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0155] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A dialogue rewriting method, characterized in that: The method comprises: Get the key information of the previous round of the target dialogue; According to the preset dialogue rewriting model and the key information, the target dialogue is rewritten to obtain a rewritten target dialogue, and the rewritten target dialogue is stored.
2. The method according to claim 1, characterized in that The step of rewriting the target dialogue according to the preset dialogue rewriting model and the key information to obtain the rewritten target dialogue includes: If the target dialogue is a follow-up question of the previous round of dialogue of the target dialogue, and the content of the target dialogue is incomplete, the target dialogue is completed based on the key information to obtain a completed target dialogue; The completed target dialogue is determined as the rewritten target dialogue.
3. The method according to claim 1, characterized in that The method further comprises: If the target dialogue does not belong to the follow-up question of the previous round of dialogue of the target dialogue, the target dialogue is output, and the target dialogue, the answer corresponding to the target dialogue, and the rewritten previous round of dialogue are determined as the rewritten target dialogue.
4. The method according to claim 1, characterized in that: The method further comprises: If the content of the target dialogue is complete, the target dialogue is output, and the target dialogue is determined as the rewritten target dialogue.
5. The method according to claim 1, characterized in that The method further comprises: If the target dialogue is the first round of dialogue, the target dialogue and the answer corresponding to the target dialogue are stored.
6. The method according to claim 1, characterized in that The method further comprises: Annotating the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue based on a preset annotation strategy to obtain an annotation result; The initial dialogue rewriting model is trained based on the annotation results, the target dialogue, the answer corresponding to the target dialogue, and the rewritten target dialogue to obtain the preset dialogue rewriting model.
7. A dialogue rewriting device, characterized in that: The device comprises: The acquisition module is used to obtain the key information of the previous round of the target dialogue; The processing module is used to rewrite the target dialogue according to the preset dialogue rewriting model and the key information, obtain the rewritten target dialogue, and store the rewritten target dialogue.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Question conversation completion method and device
CN110399456A
Inquiry statement rewriting method and device
CN113673256A
Text processing method and device, electronic equipment and storage medium
CN115994211A
Man-machine multi-round dialogue rewriting method based on Transform pointer extraction
CN116028606A
Dialogue method and device based on dialogue graph, equipment and storage medium
CN117633176A