Conversation text generation method and device, electronic equipment and medium

By using pre-trained intention generation model and response strategy of single-round dialogue scenarios in open domain multi-round dialogue scenarios, the real above is generated and the response processing is performed, and the problem of low accuracy of dialogue following generation in the prior art is solved, and the implementation of the real-world dialogue is achieved. Highly accurate dialogue generation.

CN119149677APending Publication Date: 2024-12-17BEIJING XIAOMI MOBILE SOFTWARE CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310708935.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-14
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

The prior art is difficult to generate accurate dialogue following in open-domain multi-round dialogue scenarios, resulting in a low accuracy of dialogue generation.

Method used

By obtaining the original above and historical dialogue of the current round of dialogue, the dialogue scene is determined to be an open-domain multi-round dialogue scenario, the real above is generated using a pre-trained intent generation model, and the response processing is performed based on the response strategy of the single-round dialogue scenario, and the response is generated More accurate following.

Benefits of technology

Highly accurate dialogue subtext generation in open domain multi-round dialogue scenarios is achieved, avoiding the complexity of dialogue state tracking and dialogue strategy learning, and improving the accuracy of the generated real above and subsequent responses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149677A_ABST
    Figure CN119149677A_ABST
Patent Text Reader

Abstract

The invention provides a dialogue text generation method and device, electronic equipment and a medium. The method comprises the steps of obtaining an original text in a current round of dialogue and a historical dialogue before the current round of dialogue; and under the condition that a dialogue scene to which the original previous text belongs is determined to be an open domain multi-round dialogue scene based on the original previous text and the historical dialogue, processing the original previous text and the historical dialogue based on a pre-trained intention generation model, and generating a real previous text corresponding to the current round of dialogue, the real text is a complete description of a real dialogue intention expressed by the original text; and based on a response strategy of the single-round dialogue scene, performing response processing on the real preceding text, and determining a response processing result as a following text corresponding to the original preceding text. By adopting the method, the accuracy of generating the dialogue text in the open domain multi-round dialogue scene can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a method, device, electronic device and medium for generating a dialogue context. Background Art

[0002] Dialogue systems are used in many AI (Artificial Intelligence) products, such as intelligent customer service, voice assistants, etc. In dialogue systems, there are many dialogue scenarios, such as vertical domain / task multi-round dialogue scenarios, vertical domain / task single-round dialogue scenarios, open domain multi-round dialogue scenarios, and open domain single-round dialogue scenarios.

[0003] Among them, for open domain multi-round dialogue scenarios, there is no good solution for generating dialogue context in related technologies. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present disclosure provides a method, device, electronic device and medium for generating a dialogue context.

[0005] According to a first aspect of an embodiment of the present disclosure, a method for generating a dialogue context is provided, the method comprising:

[0006] Obtaining the original context in the current round of dialogue and the historical dialogues before the current round of dialogue;

[0007] When it is determined based on the original context and the historical conversation that the conversation scenario to which the original context belongs is an open domain multi-round conversation scenario, the original context and the historical conversation are processed based on a pre-trained intent generation model to generate a real context corresponding to the current round of conversation, where the real context is a complete description of the real conversation intent expressed by the original context;

[0008] Based on the response strategy of a single-round dialogue scenario, the real context is responded to, and the result of the response processing is determined as the context corresponding to the original context, wherein one context and the context corresponding to the context constitute a complete dialogue.

[0009] Optionally, the method further comprises:

[0010] Processing the original context and the historical conversation based on a pre-trained first classification model to obtain a category of a first sub-scenario included in the conversation scenario;

[0011] According to the correspondence between the category of the first sub-scene and the second sub-scene recognition strategy, the second sub-scene recognition strategy corresponding to the category of the first sub-scene is selected to identify the category of the second sub-scene included in the dialogue scene, so as to obtain the category of the second sub-scene included in the dialogue scene.

[0012] Optionally, the selecting, according to the correspondence between the category of the first subscene and the second subscene identification strategy, the second subscene identification strategy corresponding to the category of the first subscene to identify the category of the second subscene included in the dialogue scene, to obtain the category of the second subscene included in the dialogue scene includes:

[0013] In a case where the category of the first sub-scenario is an open domain dialogue scenario, the original context and the historical dialogue are processed based on a pre-trained second classification model to obtain a category of a second sub-scenario included in the dialogue scenario;

[0014] In the case where the category of the first sub-scenario is a non-open domain dialogue scenario, the intent and slot of the original context, and the intent and slot of the context in the historical dialogue are extracted, and based on the extracted intent and slot, the category of the second sub-scenario included in the dialogue scenario is determined.

[0015] Optionally, the pre-trained second classification model includes a feature extraction network, which is used to extract at least one of the following features: semantic information of the context and the context of each round of dialogue, the length of the character string of the context and the context of each round of dialogue, the content of question words contained in the context of each round of dialogue, the number of question words contained in the context of each round of dialogue, the longest substring and length between the contexts of two adjacent rounds of dialogue, the longest substring and length between the contexts of two adjacent rounds of dialogue, the longest co-occurrence sequence and length between the contexts of two adjacent rounds of dialogue, the longest co-occurrence sequence and length between the contexts of two adjacent rounds of dialogue, the edit distance of corresponding pinyin in the contexts of two adjacent rounds of dialogue, whether the context of the previous round of dialogue of the original context belongs to an open domain dialogue scenario, and whether the context of the previous round of dialogue of the original context belongs to a catch-all answer.

[0016] Optionally, the first classification model based on pre-training processes the original context and the historical conversation to obtain a category of a first sub-scenario included in the conversation scene, including:

[0017] Processing the original context and the historical conversation based on a pre-trained first classification model to obtain a recall result of the first classification model;

[0018] In a case where the recall result includes an open domain dialogue scene and a non-open domain dialogue scene, it is determined that the category of the first sub-scene is the non-open domain dialogue scene.

[0019] Optionally, the response strategy based on the single-round dialogue scenario performs response processing on the real context, and determines the result of the response processing as the context corresponding to the original context, including:

[0020] Performing category recognition of a first sub-scene on the real context to obtain a category of a first sub-scene corresponding to the real context, wherein the category of the first sub-scene includes an open domain dialogue scene, a non-open domain dialogue scene, and a non-dialogue scene;

[0021] According to the correspondence between the category of the first sub-scenario and the reply strategy, a reply strategy corresponding to the category of the first sub-scenario corresponding to the real context is selected to perform reply processing on the real context, and the result of the reply processing is determined as the context corresponding to the original context.

[0022] Optionally, the method further comprises:

[0023] In the case that the category of the second sub-scenario included in the dialogue scenario is a single-round dialogue scenario, based on the response strategy of the single-round dialogue scenario, the original context is responded to and processed to obtain the context corresponding to the original context.

[0024] According to a second aspect of an embodiment of the present disclosure, a device for generating a dialogue context is provided, the device comprising:

[0025] An acquisition module is configured to acquire the original context in the current round of dialogue and the historical dialogue before the current round of dialogue;

[0026] an intention generation module, configured to, when it is determined based on the original context and the historical conversation that the conversation scenario to which the original context belongs is an open domain multi-round conversation scenario, process the original context and the historical conversation based on a pre-trained intention generation model to generate a real context corresponding to the current round of conversation, wherein the real context is a complete description of the real conversation intention expressed by the original context;

[0027] The dialogue context generation module is configured to perform response processing on the real context based on the response strategy of a single-round dialogue scenario, and determine the result of the response processing as the context corresponding to the original context, wherein a context and the context corresponding to the context constitute a complete round of dialogue.

[0028] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing processor executable instructions; wherein the processor is configured to implement the steps of the method described in the first aspect when executed.

[0029] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the method provided in the first aspect of the present disclosure are implemented.

[0030] The present disclosure provides a method, device, electronic device and medium for generating a conversation context. When it is determined that the conversation scenario to which the original context belongs is an open domain multi-round conversation scenario based on the original context and the historical conversation, the original context and the historical conversation are processed based on a pre-trained intention generation model to generate a real context corresponding to the current round of conversation, and the real context is processed based on the response strategy of the single-round conversation scenario, and the result of the response processing is determined as the context corresponding to the original context. By converting the original context into a real context that fully expresses the real conversation intention, the conversion from multi-round conversation to single-round conversation can be achieved, so that the real context can be processed based on the response strategy of the single-round conversation scenario to obtain a more accurate context corresponding to the original context.

[0031] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0033] Figure 1 is a flow chart of a method for generating a dialogue context according to an exemplary embodiment of the present disclosure;

[0034] Figure 2 is a flow chart of another method for generating a dialogue context according to an exemplary embodiment of the present disclosure;

[0035] Figure 3 is a block diagram of a device for generating a dialogue context according to an exemplary embodiment;

[0036] Figure 4 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0037] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0038] It should be noted that all actions of acquiring signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.

[0039] Some terms of the embodiments of the present disclosure are first explained below.

[0040] In the disclosed embodiment, a single-round conversation refers to a conversation in which the current content is unrelated to the previous and following content. For example, in the following conversation, the two rounds of conversations between users are complete and independent, and the true intention can be determined without the previous and following information.

[0041] Q: Hello!

[0042] A: Hello!

[0043] Q: I want to know why the sky is blue.

[0044] A: When sunlight enters the atmosphere, the longer wavelengths of colored light…

[0045] In the disclosed embodiment, multi-round dialogue means that the current dialogue content needs to be supplemented by the historical dialogue content or needs to be supplemented later to form a complete intention expression. For example, in the following dialogue, the second round of questions needs the information of the previous round to determine the complete intention:

[0046] Q: Hello, where is the source of the Yellow River?

[0047] A: The source of the Yellow River is located in the Bayankala Mountains on the Qinghai-Tibet Plateau.

[0048] Q: What about the Yangtze River?

[0049] A: The source of the Yangtze River is located at Geladandong Peak-Tuotuo River.

[0050] In the disclosed embodiment, a round of dialogue may include a preceding dialogue context and a following dialogue context. In the above example, "Hello, where is the source of the Yellow River" can be understood as the preceding dialogue context of the first round of dialogue, and "the source of the Yellow River is located in the Bayan Har Mountains of the Qinghai-Tibet Plateau" can be understood as the following dialogue context of the first round of dialogue.

[0051] In the disclosed embodiments, vertical domain can be understood as a conversation in a professional field, open domain conversation can be understood as a conversation not limited to a field, and task conversation realizes the conversation function by defining task-related slots and intentions.

[0052] In the disclosed embodiments, the vertical domain / task multi-round dialogue scenario can be understood as a dialogue scenario including a multi-round dialogue scenario, and a dialogue scenario including a vertical domain dialogue scenario or a task dialogue scenario. The vertical domain / task single-round dialogue scenario can be understood as a dialogue scenario including a single-round dialogue scenario, and a dialogue scenario including a vertical domain dialogue scenario or a task dialogue scenario. The open domain multi-round dialogue scenario can be understood as a dialogue scenario including a multi-round dialogue scenario and an open domain dialogue scenario, and the open domain single-round dialogue scenario can be understood as a dialogue scenario including a single-round dialogue scenario and an open domain dialogue scenario.

[0053] In some implementations, a vertical domain / task dialogue scenario may also be referred to as a non-open domain dialogue scenario.

[0054] In some implementations, dialogue state tracking and dialogue policy learning can be used to generate the context corresponding to the previous context in the current round of dialogue in a vertical domain / task dialogue scenario. However, the use of dialogue state tracking and dialogue policy learning requires predefining the state of each task, and it is difficult to define a relatively comprehensive state in open-domain question and answering, so it is not suitable for open-domain question and answering scenarios.

[0055] In some implementations, the context corresponding to the previous context in the current round of dialogue can be generated by a generative dialogue system. The generative dialogue system uses a conditional generative model to generate the content of the dialogue context, similar to a machine translation task. However, open-domain multi-round question-answering is highly dependent on knowledge, which is supported by a variety of knowledge bases, such as large-scale knowledge graphs and massive question-answering data. This knowledge is difficult to fully describe using a generative model, which results in a low accuracy rate in the generation of context by the generative dialogue system in open-domain multi-round question-answering scenarios.

[0056] In view of the above situation, an embodiment of the present disclosure provides a method for generating a dialogue context in an open domain multi-turn dialogue scenario. The method has high accuracy in generating a dialogue context in an open domain multi-turn dialogue scenario.

[0057] refer to Figure 1 , Figure 1 is a flowchart of a method for generating a dialogue context according to an exemplary embodiment. Figure 1 As shown, the method for generating a conversation context is applied to an electronic device, and the electronic device may be, for example, a mobile phone, a notebook, a tablet computer, a desktop computer, a smart speaker, a smart TV, a wearable device, an intelligent robot, a vehicle terminal, and a terminal equipped with an intelligent voice assistant, etc. The method for generating a conversation context may include the following steps:

[0058] Step S110, obtaining the original context in the current round of dialogue and the historical dialogue before the current round of dialogue.

[0059] In the disclosed embodiment, in order to generate a conversation context reply for the current conversation round, the original context in the current conversation round and the historical conversations before the current conversation round may be obtained.

[0060] In some implementations, the historical dialogue before the current round of dialogue may be the preceding and following contexts corresponding to each round of dialogue before the current round.

[0061] In addition, considering that the historical conversations before the current round of conversation may be long and contain a large amount of information, in order to reduce the amount of data obtained, in other embodiments, the historical conversations before the current round of conversation may be the previous and next contexts corresponding to a preset number of adjacent rounds of conversations before the current round.

[0062] The original context may be understood as the original content of the conversation context in the current round of conversation obtained.

[0063] Step S120, when it is determined based on the original context and the historical conversations that the conversation scenario to which the original context belongs is an open domain multi-round conversation scenario, the original context and the historical conversations are processed based on a pre-trained intent generation model to generate a real context corresponding to the current round of conversation.

[0064] Among them, the real context is a complete description of the real conversation intention expressed by the original context.

[0065] In the disclosed embodiment, the conversation scenario to which the original context belongs can be determined based on the original context and the historical conversations. The conversation scenarios may include vertical domain / task multi-round conversation scenarios, vertical domain / task single-round conversation scenarios, open domain multi-round conversation scenarios, and open domain single-round conversation scenarios.

[0066] In the disclosed embodiment, when it is determined based on the original context and historical conversations that the conversation scenario to which the original context belongs is an open domain multi-round conversation scenario, it is not suitable to use the conversation state tracking and conversation strategy learning system, and the generative conversation system to generate the conversation context for the current round of conversation. At this time, the original context and historical conversations can be processed based on a pre-trained intent generation model to generate the real context corresponding to the current round of conversation.

[0067] In some implementations, the intent generation model may be some pre-trained generation models, such as GPT (Generative Pre-Trained Transformer), T5 (Text-to-Text Transfer Transformer), etc. The input of the pre-trained intent generation model is the original context and the historical dialogue, and the output is the real context corresponding to the dialogue context of the current dialogue round, that is, the real context corresponding to the current dialogue round.

[0068] For example, it is assumed that the conversation process includes the following contents:

[0069] Q1: Where is the source of the Yellow River?

[0070] A1: The source of the Yellow River is located in the Bayankala Mountains on the Qinghai-Tibet Plateau.

[0071] Q2: What about the Yangtze River?

[0072] In this example, the original context of the current round of dialogue is "Where is the Yangtze River?", the historical dialogues before the current round of dialogue are "Where is the source of the Yellow River?" and "The source of the Yellow River is located in the Bayankala Mountains on the Qinghai-Tibet Plateau." The real context corresponding to the current round of dialogue is "Where is the source of the Yangtze River?".

[0073] The training process of the intent generation model may adopt a training method including but not limited to supervised learning, and the specific training process is not described in detail here. In supervised learning, the label of the sample is the real context corresponding to the sample context.

[0074] Step S130, based on the response strategy of the single-round dialogue scenario, response processing is performed on the real context, and the result of the response processing is determined as the context corresponding to the original context.

[0075] Among them, a previous context and the corresponding following context constitute a complete round of dialogue.

[0076] In the disclosed embodiment, after obtaining the real context corresponding to the current round of dialogue, the real intention expressed by the original context of the current dialogue can be fully described. At this time, the dialogue process no longer depends on the previous dialogue content, and thus, the dialogue process can be transformed into a single-round dialogue. Therefore, the real context can be directly responded to based on the response strategy of the single-round dialogue scenario, and then the result of the response processing can be determined as the context corresponding to the original context.

[0077] According to the method for generating a conversation context provided by the embodiment of the present disclosure, when the conversation scene to which the original context belongs is determined to be an open domain multi-round conversation scene based on the original context and the historical conversation, the original context and the historical conversation are processed based on the pre-trained intention generation model to generate a real context corresponding to the current round of conversation, and the real context is processed based on the response strategy of the single-round conversation scene, and the result of the response processing is determined as the context corresponding to the original context. The method of the embodiment of the present disclosure does not use conversation state tracking and conversation strategy learning. At the same time, compared with the method of directly generating a conversation context through a generative dialogue system, the process of first generating the real context of the current round of conversation does not require the model to represent and learn a large amount of knowledge, so that the accuracy of the generated real context is higher, and after further responding to the single-round conversation context, the accuracy of the conversation context obtained is also higher. It can be seen that by converting the original context into a real context that fully expresses the real conversation intention, the conversion from multi-round conversation to single-round conversation can be achieved, so that the real context can be processed through the response strategy of the single-round conversation scene in the future to obtain a more accurate context corresponding to the original context.

[0078] In the disclosed embodiment, the dialogue scene may include scenes of two dimensions. The first dimensional scene may also be referred to as the first sub-scene, which includes the vertical domain / task dialogue scene and the open domain dialogue scene. The second dimensional scene may also be referred to as the second sub-scene, which includes the single-round dialogue scene and the multi-round dialogue scene. Therefore, in order to obtain the complete dialogue scene to which the original text belongs, the first sub-scene and the second sub-scene to which the original text belongs may be obtained respectively.

[0079] In the disclosed embodiment, the first sub-scenario can be classified into vertical domain / task dialogue scenarios and open domain dialogue scenarios. For vertical domain / task dialogue scenarios, intent and slot information can be identified, while open domain dialogue scenarios cannot identify intent and slot information. Therefore, in some implementations, an attempt can be made to extract the intent and slot information of the original context and historical dialogues. If the intent and slot information can be extracted, the category of the first scene can be determined to be a vertical domain / task dialogue scenario, otherwise the category of the first scene is determined to be an open domain dialogue scenario.

[0080] In some implementations, the category of the first sub-scenario may also be identified by a pre-trained first classification model. Therefore, in some implementations, the method of the embodiment of the present disclosure may further include the following steps:

[0081] Processing the original context and the historical dialogue based on a pre-trained first classification model to obtain a category of a first sub-scene included in the dialogue scene;

[0082] According to the correspondence between the category of the first subscene and the second subscene identification strategy, the second subscene identification strategy corresponding to the category of the first subscene is selected to identify the category of the second subscene included in the dialogue scene, so as to obtain the category of the second subscene included in the dialogue scene.

[0083] In the disclosed embodiment, the first classification model is used to identify the category of the first sub-scene. When used, the original context and historical conversations are taken as input. After being processed by the first classification model, the category of the first sub-scene determined by the first classification model can be obtained.

[0084] The training process of the first classification model may adopt a training method including but not limited to supervised learning, and the specific training process is not described in detail here. In supervised learning, the classification labels may include open domain dialogue scenes and non-open domain dialogue scenes, or the classification labels may include open domain dialogue scenes, vertical domain dialogue scenes, and task dialogue scenes.

[0085] In some embodiments, there may be two recognition results for the category of the first sub-scenario determined by the first classification model, that is, the recall result of the first classification model may include an open domain dialogue scenario and a non-open domain dialogue scenario. In this case, considering that the application scenarios of vertical domain question and answer and task-based dialogue are fixed, the accuracy of multi-round scene recognition is relatively high. Therefore, when the recall results include an open domain dialogue scenario and a non-open domain dialogue scenario, it can be determined that the category of the first sub-scenario is a non-open domain dialogue scenario.

[0086] In the disclosed embodiment, when the recall result includes an open domain dialogue scene and a non-open domain dialogue scene, the second sub-scene is identified according to a strategy corresponding to the non-open domain scene to improve the recognition accuracy of the category of the second sub-scene.

[0087] After determining the category of the first sub-scene, the category of the second sub-scene corresponding to the original context may be determined. In the embodiment of the present disclosure, different first sub-scenes may correspond to different methods for identifying the second sub-scene corresponding to the original context.

[0088] In some embodiments, the correspondence between the category of the first sub-scene and the second sub-scene recognition strategy can be pre-stored. Thus, after determining the first sub-scene, the second sub-scene recognition strategy corresponding to the category of the first sub-scene can be further selected according to the correspondence between the category of the first sub-scene and the second sub-scene recognition strategy to identify the category of the second sub-scene included in the dialogue scene, thereby obtaining the category of the second sub-scene included in the dialogue scene.

[0089] In some implementations, according to the correspondence between the category of the first sub-scene and the second sub-scene recognition strategy, selecting the second sub-scene recognition strategy corresponding to the category of the first sub-scene to recognize the category of the second sub-scene included in the dialogue scene, and obtaining the category of the second sub-scene included in the dialogue scene may include the following steps:

[0090] When the category of the first sub-scenario is an open domain dialogue scenario, the original context and the historical dialogue are processed based on a pre-trained second classification model to obtain the category of the second sub-scenario included in the dialogue scenario;

[0091] When the category of the first sub-scenario is a non-open domain dialogue scenario, the intent and slot of the original context, and the intent and slot of the context in the historical dialogue are extracted, and the category of the second sub-scenario included in the dialogue scenario is determined based on the extracted intent and slot.

[0092] In the disclosed embodiment, the second classification model is used to identify the category of the second sub-scene. When used, the original context and historical conversations are taken as input. After being processed by the second classification model, the category of the second sub-scene determined by the second classification model can be obtained.

[0093] The training process of the second classification model may adopt a training method including but not limited to supervised learning, and the specific training process is not described in detail here. In supervised learning, the classification labels may include single-round dialogue scenarios and multi-round dialogue scenarios.

[0094] In some implementations, the intent and slot of the original context and the intent and slot of the context in the historical conversation can be extracted through SLU (Spoken Language Understanding, semantic parsing module).

[0095] In the disclosed embodiment, the non-open domain dialogue scenario may include a vertical domain / task dialogue scenario.

[0096] In the disclosed embodiment, when the category of the first sub-scene is a non-open domain dialogue scene, after extracting the intentions of each part and the slots, the category of the second sub-scene corresponding to the original context can be determined based on the intentions of each part and the filling of the slots.

[0097] Exemplarily, if the intent and slot extracted from the original context can completely fill the slot information, the category of the second sub-scenario is determined to be a single-round dialogue scenario; if the intent and slot extracted from the original context cannot completely fill the slot information and is part of the complete slot information, the category of the second sub-scenario is determined to be a multi-round dialogue scenario.

[0098] Therefore, after identifying the category of the first sub-scene and the category of the second sub-scene, the conversation scene corresponding to the original context can be obtained. For example, if the category of the first sub-scene is an open domain conversation scene and the category of the second sub-scene is a multi-round conversation scene, it can be determined that the conversation scene to which the original context belongs is an open domain multi-round conversation scene.

[0099] In addition, when the first classification model is trained through supervised learning, the accuracy of the first classification model will be relatively low when there is less labeled data. In view of this situation, the applicant has found through long-term research that the current open domain multi-round dialogue scenarios mainly include the following scenarios:

[0100] In the first scenario, the question content is inherited. The real intention of this round needs to inherit the previous round of questions. For example, in the example below, the real intention of the user is in brackets. The Q2 round of dialogue needs to inherit part of the content in Q1.

[0101] Q1: Where is the source of the Yellow River?

[0102] A1: The source of the Yellow River is located in the Bayankala Mountains on the Qinghai-Tibet Plateau.

[0103] Q2: Where is the Yangtze River? (Where is the source of the Yangtze River?)

[0104] A2: The source of the Yangtze River is located at Geladandong Peak-Tuotuo River.

[0105] In the second scenario, the answer content is inherited. The real intention of this round needs to inherit not only the questions in the previous rounds, but also the answer content. As shown in the example below, the content in brackets is the user's real intention. The Q2 round of dialogue needs to inherit the content in Q1 and A1.

[0106] Q1: What is the most precious thing in the world?

[0107] A1: It’s motherly love.

[0108] Q2: Why? (Why is maternal love the most precious thing in the world?)

[0109] A2: …

[0110] The third scenario is the error correction scenario. Due to incorrect statements in the previous round of dialogue or errors in voice recognition, the user will use multiple rounds of dialogue to correct them. As shown in the example below, the actual intention of the user is in brackets. Round Q2 corrected the erroneous content in Q1.

[0111] Q1: What is bed-wetting addiction?

[0112] A1: I’m sorry, I don’t understand.

[0113] Q2: What is the reason? (What is the reason for bedwetting?)

[0114] A2: …

[0115] The fourth scenario is intention repetition. Since the previous round of dialogue was not well satisfied, the user repeats the intention of the previous round through multiple rounds of dialogue, as shown in the example below. The actual intention of the user is in brackets.

[0116] Q1: Can tomatoes whiten your skin?

[0117] A1: Tomatoes can moisten the intestines, promote bowel movements, slow down aging, and lower blood lipids and blood pressure.

[0118] Q2: Can tomatoes whiten your skin? (Can tomatoes whiten your skin?)

[0119] A2: …

[0120] According to the applicant's analysis, in open domain multi-round scene recognition, in addition to the semantic information of each round in the conversation, some additional features can be introduced into the second classification model to improve the recognition accuracy of the category of the second sub-scene.

[0121] Therefore, in some embodiments, the pre-trained second classification model includes a feature extraction network, which is used to extract at least one of the following features: semantic information of the context and the context of each round of dialogue, the length of the character string of the context and the context of each round of dialogue, the content of question words contained in the context of each round of dialogue, the number of question words contained in the context of each round of dialogue, the longest substring and length between the contexts of two adjacent rounds of dialogue, the longest substring and length between the contexts of two adjacent rounds of dialogue, the longest co-occurrence sequence and length between the contexts of two adjacent rounds of dialogue, the longest co-occurrence sequence and length between the contexts of two adjacent rounds of dialogue, the edit distance of corresponding pinyin in the contexts of two adjacent rounds of dialogue, whether the context of the previous round of dialogue of the original context belongs to an open domain dialogue scenario, and whether the context of the previous round of dialogue of the original context belongs to a catch-all answer.

[0122] Among them, the longest substring and its length, the longest co-occurrence sequence and its length, and the edit distance of pinyin can reflect the similarity between the two corresponding paragraphs.

[0123] Take the following example to illustrate some features, with the user's actual intention in brackets:

[0124] Q1: What is the most precious thing in the world?

[0125] A1: It’s motherly love.

[0126] Q2: Why in the world? (Why is maternal love the most precious thing in the world?)

[0127] A2: …

[0128] Among them, the longest substring can be understood as the longest identical string. In the example, the longest substring between the previous Q1 and the previous Q2 in two adjacent rounds of conversations is "what", with a length of 2.

[0129] Among them, the longest co-occurrence sequence can be understood as the longest text content that appears in the same sequence. In the example, the longest co-occurrence sequence between the previous Q1 and the previous Q2 in two adjacent rounds of conversations is "what in the world", with a length of 4.

[0130] Among them, regarding whether the subsequent text of the previous round of conversation in the original previous text belongs to a fallback answer, the fallback answer can be understood as a fallback subsequent text answer given when a standard objective subsequent text answer cannot be given to avoid the subsequent text being empty.

[0131] In some embodiments, based on the response strategy for a single-round conversation scenario, performing a response process on the real previous text and determining the result of the response process as the subsequent text corresponding to the original previous text may include the following steps:

[0132] Performing category recognition of the first sub-scenario on the real previous text to obtain the category of the first sub-scenario corresponding to the real previous text, where the category of the first sub-scenario includes an open-domain conversation scenario, a non-open-domain conversation scenario, and a non-conversation scenario;

[0133] According to the corresponding relationship between the category of the first sub-scenario and the response strategy, selecting the response strategy corresponding to the category of the first sub-scenario corresponding to the real previous text to perform a response process on the real previous text, and determining the result of the response process as the subsequent text corresponding to the original previous text.

[0134] In the embodiments of the present disclosure, after obtaining the real previous text, the first sub-scenario corresponding to the real previous text may change. For example, it may change from an open-domain conversation to a non-open-domain conversation scenario or a non-conversation scenario. In this case, the first sub-scenario corresponding to the real previous text can be recognized to obtain the category of the first sub-scenario corresponding to the real previous text. And at this time, the real previous text is a single-round conversation sub-scenario. Then, according to the corresponding relationship between the category of the first sub-scenario and the response strategy, selecting the response strategy corresponding to the category of the first sub-scenario corresponding to the real previous text to perform a response process on the real previous text, and determining the result of the response process as the subsequent text corresponding to the original previous text. For example, selecting a vertical domain / task single-round conversation response strategy for processing, or selecting an open-domain single-round conversation strategy for processing.

[0135] Among them, the vertical domain / task single-round dialogue response strategy and the open domain single-round dialogue strategy can refer to the strategy of the NLG (Natural Language Generation) module in the relevant technology, which will not be repeated here. For example, the vertical domain / task single-round dialogue response strategy can be dialogue state tracking and dialogue strategy learning, and the open domain single-round dialogue strategy can be a pre-trained intent generation model.

[0136] For non-dialogue intent, the dialogue process can be ended. In this case, the context corresponding to the original context can be "end".

[0137] In some embodiments, the category of the second sub-scene may be a single-round dialogue scene. For example, in some embodiments, according to the correspondence between the category of the first sub-scene and the second sub-scene identification strategy, after selecting the second sub-scene identification strategy corresponding to the category of the first sub-scene to identify the category of the second sub-scene included in the dialogue scene, the category of the second sub-scene included in the dialogue scene is obtained as a single-round dialogue scene. In this case, the method of the embodiment of the present disclosure may further include the following steps:

[0138] In the case where the category of the second sub-scenario included in the dialogue scenario is a single-round dialogue scenario, based on the response strategy of the single-round dialogue scenario, the original context is responded to and processed to obtain the context corresponding to the original context.

[0139] In the disclosed embodiment, since the category of the second sub-scenario corresponding to the original context is identified as a single-round dialogue scenario, the original context can be directly responded to according to the response strategy of the single-round dialogue scenario to obtain the context corresponding to the original context.

[0140] For example, in some embodiments, based on the correspondence between the category of the first sub-scenario corresponding to the original context and the reply strategy, a reply strategy corresponding to the category of the first sub-scenario corresponding to the original context is selected to perform reply processing on the original context, and the result of the reply processing is determined as the context corresponding to the original context.

[0141] Among them, the response strategy corresponding to the category of the first sub-scenario can refer to the aforementioned embodiment and will not be repeated here.

[0142] That is to say, in the embodiment of the present disclosure, if the second sub-scenario corresponding to the original above text is a single-round dialogue scenario, it can be processed according to the response strategy of the single-round dialogue scenario. The process is relatively simple and can refer to the response strategy in the relevant technology.

[0143] Next, combine Figure 2 The flowchart shown uses a specific example to illustrate the method for generating a dialogue context according to the embodiment of the present disclosure.

[0144] like Figure 2 As shown, when it is necessary to reply to the original context of the current round of dialogue, the original context and the historical dialogue content before the current round can be obtained.

[0145] Next, the category of the first sub-scenario corresponding to the original context may be determined.

[0146] Optionally, the original context and historical conversation content before the current round may be input into a pre-trained first classification model, and processed by the first classification model to obtain the category of the first sub-scenario corresponding to the original context.

[0147] Optionally, the category of the first sub-scenario corresponding to the original context may be determined by combining the intent and slot in the analysis result of the original context by SLU with the analysis information of the historical conversation content.

[0148] Next, after determining the category of the first sub-scenario corresponding to the original context, the category of the second sub-scenario corresponding to the original context may be further determined.

[0149] If the category of the first sub-scenario is an open domain dialogue scene, the original context and the historical dialogue can be processed based on a pre-trained second classification model to obtain the category of the second sub-scenario included in the dialogue scene.

[0150] If the category of the first sub-scene is a vertical domain / task dialogue scene, the category of the second sub-scene included in the dialogue scene can be determined based on the intention and slot of the extracted original context, and the intention and slot of the context in the historical dialogue.

[0151] Based on the first sub-scenario and the second sub-scenario determined above, the original dialogue scene to which the above text belongs can be obtained by combining them.

[0152] If it is a single-round dialogue scenario, at this time, no matter the first sub-scenario is a vertical domain / task dialogue scenario or an open domain dialogue scenario, it is processed according to the single-round dialogue scenario, that is, the category of the second sub-scenario is the first sub-scenario corresponding to the original context of the single-round dialogue scenario. If it is an open domain dialogue scenario, the original context is processed according to the open domain single-round dialogue scenario. If it is a vertical domain / task dialogue scenario, the original context is processed according to the vertical domain / task single-round dialogue scenario. If it is not a question-and-answer scenario, the dialogue can be ended.

[0153] If it is an open domain multi-round dialogue scenario, the original context and historical dialogue are processed based on the pre-trained intent generation model to generate the real context corresponding to the original context. At this time, the real context can be processed as the dialogue context in a single-round dialogue scenario.

[0154] In this case, the same strategy can be used to process it as the original context of the single-round dialogue scenario obtained during category identification of the second sub-scenario, that is, the first sub-scenario corresponding to the real context can be obtained first. If it is an open domain dialogue scenario, the real context can be processed according to the open domain single-round dialogue scenario strategy. If it is a vertical domain / task dialogue scenario, the real context can be processed according to the vertical domain / task single-round dialogue scenario strategy. If it is a non-question-and-answer scenario, the dialogue can be ended.

[0155] If it is a vertical domain / task multi-round dialogue scenario, the context corresponding to the original context in the vertical domain / task dialogue scenario can be generated through dialogue state tracking and dialogue strategy learning.

[0156] Figure 3 is a block diagram of a device for generating a dialogue context according to an exemplary embodiment. Figure 3 The device 300 for generating a dialogue context is applied to an electronic device, and the device 300 for generating a dialogue context includes:

[0157] An acquisition module 310 is configured to acquire the original context in the current round of dialogue and the historical dialogue before the current round of dialogue;

[0158] The intention generation module 320 is configured to process the original context and the historical dialogue based on a pre-trained intention generation model to generate a real context corresponding to the current round of dialogue, when it is determined that the dialogue scenario to which the original context belongs is an open domain multi-round dialogue scenario based on the original context and the historical dialogue, and the real context is a complete description of the real dialogue intention expressed by the original context;

[0159] The dialogue context generation module 330 is configured to perform response processing on the real context based on the response strategy of a single-round dialogue scenario, and determine the result of the response processing as the context corresponding to the original context, wherein a context and the context corresponding to the context constitute a complete round of dialogue.

[0160] Optionally, the apparatus 300 further includes:

[0161] A first classification module is configured to process the original context and the historical conversation based on a pre-trained first classification model to obtain a category of a first sub-scenario included in the conversation scenario;

[0162] The second classification module is configured to select the second subscene recognition strategy corresponding to the category of the first subscene according to the correspondence between the category of the first subscene and the second subscene recognition strategy to identify the category of the second subscene included in the dialogue scene, so as to obtain the category of the second subscene included in the dialogue scene.

[0163] Optionally, the second classification module includes:

[0164] A first category identification submodule is configured to process the original context and the historical conversation based on a pre-trained second classification model to obtain a category of a second subscene included in the conversation scene when the category of the first subscene is an open domain conversation scene;

[0165] The second category identification submodule is configured to extract the intention and slot of the original context and the intention and slot of the context in the historical conversation when the category of the first sub-scene is a non-open domain dialogue scene, and determine the category of the second sub-scene included in the dialogue scene based on the extracted intention and slot.

[0166] Optionally, the pre-trained second classification model includes a feature extraction network, which is used to extract at least one of the following features: semantic information of the context and the context of each round of dialogue, the length of the character string of the context and the context of each round of dialogue, the content of question words contained in the context of each round of dialogue, the number of question words contained in the context of each round of dialogue, the longest substring and length between the contexts of two adjacent rounds of dialogue, the longest substring and length between the contexts of two adjacent rounds of dialogue, the longest co-occurrence sequence and length between the contexts of two adjacent rounds of dialogue, the longest co-occurrence sequence and length between the contexts of two adjacent rounds of dialogue, the edit distance of corresponding pinyin in the contexts of two adjacent rounds of dialogue, whether the context of the previous round of dialogue of the original context belongs to an open domain dialogue scenario, and whether the context of the previous round of dialogue of the original context belongs to a catch-all answer.

[0167] Optionally, the first classification module includes:

[0168] A recall result determination submodule is configured to process the original context and the historical conversation based on a pre-trained first classification model to obtain a recall result of the first classification model;

[0169] The third category identification submodule is configured to determine that the category of the first sub-scenario is the non-open domain dialogue scene when the recall result includes the open domain dialogue scene and the non-open domain dialogue scene.

[0170] Optionally, the dialogue context generating module 330 includes:

[0171] a fourth category identification submodule, configured to perform category identification of a first sub-scene on the real context to obtain a category of the first sub-scene corresponding to the real context, wherein the categories of the first sub-scene include an open domain dialogue scene, a non-open domain dialogue scene, and a non-dialogue scene;

[0172] The first response submodule is configured to select a response strategy corresponding to the category of the first subscenario corresponding to the real context according to the correspondence between the category of the first subscenario and the response strategy, perform response processing on the real context, and determine the result of the response processing as the context corresponding to the original context.

[0173] Optionally, the dialogue context generating module 330 includes:

[0174] The second response submodule is configured to, when the category of the second subscenario included in the dialogue scenario is a single-round dialogue scenario, perform response processing on the original context based on the response strategy of the single-round dialogue scenario to obtain the context corresponding to the original context.

[0175] Regarding the dialogue context generating device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0176] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the steps of the method for generating a dialogue context provided by the present disclosure.

[0177] Figure 4 400 is a block diagram of an electronic device for a method for generating a conversation context according to an exemplary embodiment. For example, the electronic device 400 may be a mobile phone, a notebook, a tablet computer, a desktop computer, a smart speaker, a smart TV, a wearable device, a smart robot, a vehicle-mounted terminal, and a terminal equipped with a smart voice assistant.

[0178] Reference Figure 4 , the electronic device 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output interface 412 , a sensor component 414 , and a communication component 416 .

[0179] The processing component 402 generally controls the overall operation of the electronic device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.

[0180] The memory 404 is configured to store various types of data to support operations on the electronic device 400. Examples of such data include instructions for any application or method operating on the electronic device 400, contact data, phone book data, messages, pictures, videos, etc. The memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0181] The power supply component 406 provides power to the various components of the electronic device 400. The power supply component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 400.

[0182] The multimedia component 408 includes a screen that provides an output interface between the electronic device 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front camera and / or a rear camera. When the electronic device 400 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0183] The audio component 410 is configured to output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC), and when the electronic device 400 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio signals.

[0184] The input / output interface 412 provides an interface between the processing component 402 and the peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0185] The sensor assembly 414 includes one or more sensors for providing various aspects of status assessment for the electronic device 400. For example, the sensor assembly 414 can detect the open / closed state of the electronic device 400, the relative positioning of the components, such as the display and keypad of the electronic device 400, and the sensor assembly 414 can also detect the position change of the electronic device 400 or a component of the electronic device 400, the presence or absence of contact between the user and the electronic device 400, the orientation or acceleration / deceleration of the electronic device 400, and the temperature change of the electronic device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 414 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0186] The communication component 416 is configured to facilitate wired or wireless communication between the electronic device 400 and other devices. The electronic device 400 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0187] In an exemplary embodiment, the electronic device 400 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned dialog context generation method.

[0188] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, and the instructions can be executed by a processor 420 of an electronic device 400 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0189] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program that can be executed by a programmable device, and the computer program has a code portion for executing the above-mentioned dialog context generating method when executed by the programmable device.

[0190] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0191] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for generating a dialogue context, characterized in that: The method comprises: Obtaining the original context in the current round of dialogue and the historical dialogues before the current round of dialogue; When it is determined based on the original context and the historical conversation that the conversation scenario to which the original context belongs is an open domain multi-round conversation scenario, the original context and the historical conversation are processed based on a pre-trained intent generation model to generate a real context corresponding to the current round of conversation, where the real context is a complete description of the real conversation intent expressed by the original context; Based on the response strategy of a single-round dialogue scenario, the real context is responded to, and the result of the response processing is determined as the context corresponding to the original context, wherein one context and the context corresponding to the context constitute a complete dialogue.

2. The method according to claim 1, characterized in that The method further comprises: Processing the original context and the historical conversation based on a pre-trained first classification model to obtain a category of a first sub-scenario included in the conversation scenario; According to the correspondence between the category of the first sub-scene and the second sub-scene recognition strategy, the second sub-scene recognition strategy corresponding to the category of the first sub-scene is selected to identify the category of the second sub-scene included in the dialogue scene, so as to obtain the category of the second sub-scene included in the dialogue scene.

3. The method according to claim 2, characterized in that The step of selecting the second subscene recognition strategy corresponding to the category of the first subscene to recognize the category of the second subscene included in the dialogue scene according to the correspondence between the category of the first subscene and the second subscene recognition strategy to obtain the category of the second subscene included in the dialogue scene includes: In a case where the category of the first sub-scenario is an open domain dialogue scenario, the original context and the historical dialogue are processed based on a pre-trained second classification model to obtain a category of a second sub-scenario included in the dialogue scenario; In the case where the category of the first sub-scenario is a non-open domain dialogue scenario, the intent and slot of the original context, and the intent and slot of the context in the historical dialogue are extracted, and based on the extracted intent and slot, the category of the second sub-scenario included in the dialogue scenario is determined.

4. The method according to claim 3, characterized in that The pre-trained second classification model includes a feature extraction network, which is used to extract at least one of the following features: semantic information of the context and the context of each round of dialogue, the length of the character string of the context and the context of each round of dialogue, the content of question words contained in the context of each round of dialogue, the number of question words contained in the context of each round of dialogue, the longest substring and length between the contexts of two adjacent rounds of dialogue, the longest substring and length between the contexts of two adjacent rounds of dialogue, the longest co-occurrence sequence and length between the contexts of two adjacent rounds of dialogue, the longest co-occurrence sequence and length between the contexts of two adjacent rounds of dialogue, the edit distance of corresponding pinyin in the contexts of two adjacent rounds of dialogue, whether the context of the previous round of dialogue of the original context belongs to an open domain dialogue scenario, and whether the context of the previous round of dialogue of the original context belongs to a catch-all answer.

5. The method according to claim 2, characterized in that: The first classification model based on pre-training processes the original context and the historical dialogue to obtain a category of a first sub-scenario included in the dialogue scenario, including: Processing the original context and the historical conversation based on a pre-trained first classification model to obtain a recall result of the first classification model; In a case where the recall result includes an open-domain dialogue scene and a non-open-domain dialogue scene, it is determined that the category of the first sub-scene is the non-open-domain dialogue scene.

6. The method according to claim 1, characterized in that The answering strategy based on the single-round dialogue scenario performs answering processing on the real context, and determines the result of the answering processing as the context corresponding to the original context, including: Performing category recognition of a first sub-scene on the real context to obtain a category of a first sub-scene corresponding to the real context, wherein the category of the first sub-scene includes an open domain dialogue scene, a non-open domain dialogue scene, and a non-dialogue scene; According to the correspondence between the category of the first sub-scenario and the reply strategy, a reply strategy corresponding to the category of the first sub-scenario corresponding to the real context is selected to perform reply processing on the real context, and the result of the reply processing is determined as the context corresponding to the original context.

7. The method according to claim 1, characterized in that The method further comprises: In the case that the category of the second sub-scenario included in the dialogue scenario is a single-round dialogue scenario, based on the response strategy of the single-round dialogue scenario, the original context is responded to and processed to obtain the context corresponding to the original context.

8. A device for generating a dialogue context, characterized in that: The device comprises: An acquisition module is configured to acquire the original context in the current round of dialogue and the historical dialogue before the current round of dialogue; an intention generation module, configured to, when it is determined based on the original context and the historical conversation that the conversation scenario to which the original context belongs is an open domain multi-round conversation scenario, process the original context and the historical conversation based on a pre-trained intention generation model to generate a real context corresponding to the current round of conversation, wherein the real context is a complete description of the real conversation intention expressed by the original context; The dialogue context generation module is configured to perform response processing on the real context based on the response strategy of a single-round dialogue scenario, and determine the result of the response processing as the context corresponding to the original context, wherein a context and the context corresponding to the context constitute a complete round of dialogue.

9. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing processor-executable instructions; The processor is configured to implement the steps of any one of the methods of claims 1 to 7 when executing.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method, device and electronic device for classifying multi-round conversation data based on depth learning

    CN109101537A

  • Multi-round dialogue method and device based on artificial intelligence and storage medium

    CN113806508A

  • Label generation method and device, computer readable storage medium and computer equipment

    CN115617992A

  • Context-based multi-turn dialogue method and storage medium

    US20210200961A1

  • Human-machine dialogue method and electronic device

    WO2019144858A1