A human-computer conversation method, system, electronic device and storage medium

By employing dialogue type selection and double-loss fine-tuning methods, combined with a knowledge selection model, the problems of role consistency and lack of background knowledge in role-based dialogue systems are solved. This achieves role consistency and background knowledge understanding in multiple dialogues, enhancing the anthropomorphism and sustainability of the dialogue.

CN116431780BActive Publication Date: 2025-12-12COMMUNICATION UNIVERSITY OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310280216.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-22
Publication Date
2025-12-12
Estimated Expiration
2043-03-22

Smart Images

  • Figure CN116431780B_ABST
    Figure CN116431780B_ABST
Patent Text Reader

Abstract

The application discloses a human-computer conversation method and system, electronic equipment and storage medium, and relates to the technical field of human-computer conversation. The method comprises the following steps: acquiring a current conversation; the current conversation comprises a target question and historical data; the historical data comprises role information and historical conversation; inputting the historical data into a conversation type selection model to obtain the conversation type of the current conversation; the conversation type is a role information independent conversation or a role information related conversation; when the conversation type of the current conversation is the role information independent conversation, inputting the target question into a role information independent conversation model to obtain a role independent reply to the target question; and when the conversation type of the current conversation is the role information related conversation, inputting the target question into a role information related conversation model to obtain a role related reply to the target question. The application improves the personification of the conversation and the sustainability of human-computer interaction.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of human-computer conversation, and in particular to a human-computer conversation method and system, an electronic device and a storage medium. BACKGROUND

[0002] Building a humanoid conversation system has always been the goal pursued by the natural language processing (NLP) industry, and one of the main challenges is how to make the conversation system show consistent personality in multiple conversations, that is, the conversation system should generate consistent replies in the role for semantically identical or similar questions. For example, when the user inputs "How old are you?", the system may reply "18 years old", but when the user asks "How old are you this year?", the system answers "I am 65 years old". The reason for this phenomenon is that the training corpus of the conversation system is complex, some corpus shows "18 years old", and some corpus shows "65 years old", so when the user asks in different ways, the system will have inconsistent replies, and this inconsistency in the role will greatly affect the user experience.

[0003] In recent years, the development of technology and market demand has stimulated the interest of academia and industry in researching role-consistent conversation systems, and with the rise of virtual people and the concept of the metaverse, role-based conversation technology is expected to empower IP images, virtual idols, intelligent customer service, game NPCs, smart education and other fields. The research on role-based conversation technology has important significance in both academic research and practical application.

[0004] The earliest research on role-based dialogue technology was conducted in 2016 by Dr. Li et al. from Stanford University. They proposed a SpeakerModel based on a seq2seq architecture for embedding roles using role features, and a Speaker-Addressee Model that adjusts the speaker's style based on the different interlocutors. This research did not explicitly display role information for each user in the training data; instead, it determined roles based on the similarity of their role vectors in space. Therefore, this method cannot explicitly modify role information and is difficult to implement in practice. In 2018, to address the role consistency problem in role-based dialogue, Zhang et al. proposed a manually annotated role-based dialogue dataset, Persona-Chat. In this dataset, annotators first wrote role information, and then assigned the role information to different annotators to act out the dialogue. Thomas Wolf et al. proposed the TransferTransfo model based on GPT2. For role information embedding, TransferTransfo uses a simple concatenation method and uses state embedding to distinguish different content. Furthermore, TransferTransfo's fine-tuning process differs slightly. Besides the standard language model loss, it includes a new next-sentence classification loss. This involves concatenating the predicted response and the randomly selected response into the historical dialogue, then using a classifier to predict which response is more appropriate. These two losses are combined to jointly optimize the model. Golovanov et al. employed an encoder-decoder framework. The encoder encodes both persona information and dialogue history, while the decoder uses a self-attention mechanism to integrate the encoded information and the output, thus incorporating persona information.

[0005] ConvA12 competition inspired researchers' interest in the research of persona-consistent dialogue generation. Since then, scholars have begun to study persona-consistent dialogue generation from multiple aspects. Sean Welleck et al. transformed the problem of role consistency into natural language inference, that is, to judge the logical relationship between the current reply and the role information, and proposed the Dialogue Natural Language Inference (DNLI) dataset based on the Persona-Chat dataset. Song et al. combined the role-consistent reply generation problem with reinforcement learning in 2020, strengthened the role information attributes of the generated reply, and proposed a generation-deletion-rewrite framework, that is, first use the DNLI dataset to pre-train a module for judging role consistency, then use this module to detect and mask the role-inconsistent words in the reply, and finally rewrite the masked reply to improve the role information consistency. In 2021, Song et al. divided the role-based dialogue generation task into two sub-tasks: consistency understanding and dialogue generation. They proposed a BERT-based generation framework BoB to train role-based dialogue models from limited data. They also introduced unlikelihood training based on non-dialogue inference data to understand the consistency of the character roles. Chen et al. proposed the P2BOT model based on the transformer model, which improves the quality of our chat by modeling the role perception between the interlocutors in the dialogue process. In addition, some scholars have tried to use the copy mechanism to solve the problem of role consistency. Yavuz et al. proposed DeepCopy to use the copy mechanism to generate the information needed for the reply from the role information. The authors proposed a hierarchical pointer-generator mechanism to copy from both the historical dialogue and the role information.

[0006] However, there are still some unsolved problems in the current research on persona-consistent dialogue generation:

[0007] 1. Role consistency problem. The model trained on limited personalized data cannot fully understand the consistency of the role, and sometimes the generated reply will be inconsistent with the preset role information, which cannot give a clear understanding of its own positioning.

[0008] 2. The problem of lack of role background knowledge. Current researches are mostly focused on one of the knowledge-enhanced reply and role consistency, or the introduction of common sense knowledge in the role dialogue model. However, the current researches mostly ignore a problem: the fixed role has different life backgrounds, so it cannot be solved by simply injecting common sense knowledge in the real world, which leads to the problem of lack of role background knowledge.

[0009] 3. The role hallucination problem of large-scale pre-training language model. The dialogue generation pre-training model has very good performance in open domain dialogue. However, the role dialogue ability of the pre-training model is poor, because the large amount of dialogue data used in the pre-training process will confuse the role information of the model, and it is difficult to maintain consistent cognition of the role.

[0010] 4. The problem that the ability of large-scale pre-training language model is difficult to utilize in role dialogue task. The pre-training model has strong open domain dialogue ability but poor role dialogue ability, and the role dialogue small model is difficult to obtain fluent dialogue ability under limited data resources, and lacks an architecture combining the abilities of the two. SUMMARY

[0011] The purpose of the present application is to provide a human-computer dialogue method, system, electronic device and storage medium, which gives the ability to maintain own role information while understanding dialogue background knowledge during dialogue, and improves the personification of dialogue and the sustainability of human-computer interaction.

[0012] To achieve the above purpose, the present application provides the following scheme:

[0013] A human-computer dialogue method, the method comprising:

[0014] Obtaining a current dialogue; the current dialogue comprises a target question and historical data; the historical data comprises role information and historical dialogue;

[0015] Inputting the historical data into a dialogue type selection model to obtain the dialogue type of the current dialogue; the dialogue type is a role information independent dialogue or a role information related dialogue; the dialogue type selection model is obtained based on Chinese-BERT-wwm;

[0016] When the dialogue type of the current dialogue is a role information independent dialogue, inputting the target question into a role information independent dialogue model to obtain a role independent reply to the target question; the role information independent dialogue model is obtained based on a large-scale pre-training model;

[0017] When the dialogue type of the current dialogue is a role information related dialogue, the target question is input into a role information related dialogue model to obtain a role related reply to the target question; the role information related dialogue model is obtained based on a transformer model.

[0018] Optionally, the training process of the dialogue type selection model specifically comprises:

[0019] A first training data set is obtained; the first training data set comprises role information and historical dialogues of a plurality of first training roles;

[0020] A first label is added to each of the training roles to obtain a first training data set with a first label; when the role information and the historical dialogues of the training role are related, the first label is a role related label; when the role information and the historical dialogues of the training role are irrelevant, the first label is a role irrelevant label;

[0021] The Chinese-BERT-wwm is trained by using the first training data set with the label to obtain the dialogue type selection model.

[0022] Optionally, the training process of the role information irrelevant dialogue model specifically comprises:

[0023] A second training data set is obtained; the second training data set comprises role information and historical dialogues of a plurality of second training roles;

[0024] Each question in the second training data set is input into the large-scale pre-training model to obtain a model reply to each question;

[0025] A loss of the model reply of each question and a real reply corresponding to each question in the second training data set is calculated to obtain a first loss;

[0026] A second loss is determined according to the model reply of each question and the role information by using a RoBERTa model;

[0027] The large-scale pre-training model is trained based on the first loss and the second loss to obtain the role information irrelevant dialogue model.

[0028] Optionally, the training process of the role information related dialogue model specifically comprises:

[0029] A third training data set is obtained; the third training data set comprises role information and historical dialogues of a plurality of third training roles;

[0030] The third training data set is cleaned by using a knowledge selection model to obtain a third training data set containing background information;

[0031] The transformer model is trained by using the third training data set containing background information to obtain the role information related dialogue model.

[0032] Optionally, a calculation formula of the first loss is:

[0033]

[0034] Wherein, Loss1 is the first loss, n is the number of questions in the second training data set, i is the serial number of the question in the second training data set, y i is the true reply of the i-th question, is the model reply of the i-th question.

[0035] A human-computer dialogue system, the system comprises:

[0036] A data acquisition module is configured to acquire a current dialogue; the current dialogue comprises a target question and historical data; the historical data comprises role information and historical dialogue;

[0037] A dialogue type determination module is configured to input the historical data into a dialogue type selection model to obtain a dialogue type of the current dialogue; the dialogue type is a role information independent dialogue or a role information related dialogue; the dialogue type selection model is obtained based on Chinese-BERT-wwm;

[0038] A first reply module is configured to input the target question into a role information independent dialogue model when the dialogue type of the current dialogue is a role information independent dialogue to obtain a role independent reply of the target question; the role information independent dialogue model is obtained based on a large-scale pre-training model;

[0039] A second reply module is configured to input the target question into a role information related dialogue model when the dialogue type of the current dialogue is a role information related dialogue to obtain a role related reply of the target question; the role information related dialogue model is obtained based on a transformer model.

[0040] An electronic device comprises:

[0041] One or more processors;

[0042] A storage device having one or more programs stored thereon;

[0043] The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the human-computer dialogue method as described above.

[0044] A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the human-computer dialogue method as described above.

[0045] According to the specific embodiments of the present application, the following technical effects are disclosed.

[0046] The present application discloses a human-computer dialogue method, system, electronic device and storage medium, first determine the dialogue type of the current dialogue; when the dialogue type of the current dialogue is a role information independent dialogue, input the target question into the role information independent dialogue model to obtain the role independent reply of the target question; when the dialogue type of the current dialogue is a role information related dialogue, input the target question into the role information related dialogue model to obtain the role related reply of the target question, give the ability to maintain own role information while understanding the dialogue background knowledge when dialogue, improve the anthropomorphism of dialogue and the sustainability of human-computer interaction. BRIEF DESCRIPTION OF DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0048] Figure 1 The human-computer dialogue method flowchart provided for Embodiment 1 of the present application;

[0049] Figure 2 The CDConv data set format before modification is shown in the schematic diagram;

[0050] Figure 3 The CDConv-persona data set format is shown in the schematic diagram;

[0051] Figure 4 The process of fine-tuning the large-scale pre-training model to obtain the role information independent dialogue model is shown in the schematic diagram;

[0052] Figure 5 The process of fine-tuning the transformer model to obtain the role information related dialogue model is shown in the schematic diagram;

[0053] Figure 6 The role dialogue system block diagram is shown in the schematic diagram. DETAILED DESCRIPTION

[0054] The technical solutions in the embodiments of the present application will be apparently and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0055] The present application aims to provide a human-computer conversation method, system, electronic device and storage medium, which aims to give the ability to maintain own role information while understanding the background knowledge of the conversation, and to improve the personification of the conversation and the sustainability of human-computer interaction.

[0056] In order to make the above-mentioned purposes, features and advantages of the present application more apparent and easy to understand, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0057] Embodiment 1

[0058] Figure 1 The human-computer conversation method flowchart provided by Embodiment 1 of the present application is shown in FIG. 1. As shown in FIG. 1, the human-computer conversation method in the present embodiment comprises: Figure 1

[0059] Step 101: obtaining a current conversation; the current conversation comprises a target question and historical data; the historical data comprises role information and historical conversation.

[0060] Step 102: inputting the historical data into a conversation type selection model to obtain a conversation type of the current conversation; the conversation type is a role information independent conversation or a role information related conversation.

[0061] The conversation type selection model is obtained based on Chinese-BERT-wwm.

[0062] Step 103: when the conversation type of the current conversation is the role information independent conversation, inputting the target question into a role information independent conversation model to obtain a role independent reply to the target question.

[0063] The role information independent conversation model is obtained based on a large-scale pre-training model.

[0064] Step 104: when the conversation type of the current conversation is the role information related conversation, inputting the target question into a role information related conversation model to obtain a role related reply to the target question.

[0065] The role information related conversation model is obtained based on a transformer model.

[0066] ​As an optional implementation, the training process of the dialogue type selection model specifically comprises the following steps.

[0067] Obtain a first training data set; the first training data set comprises: role information and historical dialogues of a plurality of first training roles.

[0068] Add a first label to each training role to obtain a first training data set with a first label; when the role information of the training role is related to the historical dialogues, the first label is a role-related label, and when the role information of the training role is unrelated to the historical dialogues, the first label is a role-unrelated label.

[0069] Specifically, since there is no open source dialogue type discrimination data set at present, the application proposes a kind of preprocessing of Chinese dialogue consistency detection data set CDConv to obtain a data set CDConv-persona for personalized dialogue type discrimination, i.e. the first training data set, and the processing idea is as follows:

[0070] As shown in Figure 2 , the label in the modified CDConv data set represents the contradiction type label (0: no contradiction, 1: b2 intra-sentence contradiction, 2: b2 role confusion, 3: b2 dialogue history contradiction), and persona represents the contradiction content label (1: character attribute, 2: character viewpoint and preference, 3: character experience, 0: other) from the perspective of personae. When label is 3, there is a persona item.

[0071] As shown in Figure 3 , when processing the modified CDConv data set, first delete the error reply, then modify the label of the role confusion error to the role background related dialogue label, the role background related label is 1 (i.e. role-related label), the role background unrelated label is 0 (i.e. role-unrelated label), and the persona label is deleted, thereby obtaining the CDConv-persona data set, i.e. the first training data set with the first label.

[0072] The first training data set with the label is used to train Chinese-BERT-wwm to obtain a dialogue type selection model.

[0073] Specifically, the Chinese pre-training model Chinese-BERT-wwm based on the full-word mask is fine-tuned using the CDConv-persona dataset to obtain a dialogue type selection model. The dialogue type selection model has the following specific parameters: 24 layers, 1024 hidden layers, 16 attention heads, and 330M parameter quantity. When used, the input of the dialogue type selection model is the role information and the historical dialogue, and the output structure is 1 or 0, where 1 represents a dialogue related to the role information, and 0 represents a dialogue unrelated to the role information.

[0074] As an optional implementation, the training process of the role information unrelated dialogue model specifically includes:

[0075] Obtaining a second training dataset; the second training dataset includes: role information and historical dialogues of a plurality of second training roles.

[0076] Inputting the questions in the second training dataset into the large-scale pre-training model to obtain the model responses of each question.

[0077] Calculating the loss of the model response of each question and the true response corresponding to each question in the second training dataset to obtain a first loss.

[0078] Using the RoBERTa model, determining a second loss according to the model response of each question and the role information.

[0079] Training the large-scale pre-training model based on the first loss and the second loss to obtain the role information unrelated dialogue model.

[0080] Specifically, the process of fine-tuning the large-scale pre-training model to obtain the role information unrelated dialogue model is as follows:

[0081] The input of the large-scale pre-training model is the role information and the dialogue history, and the output is the response of the dialogue robot to the role-unrelated dialogue.

[0082] To address the role hallucination problem of large models, a double-loss joint fine-tuning training method is proposed as shown in FIG. 4, which aims to reduce the confusion of role information in the role dialogue task caused by the rich prior knowledge of the pre-training model, and better control and exploit the capabilities of large-scale pre-training models.

[0083] The double-loss fine-tuning manner first needs to use a dialogue consistency discrimination model to discriminate the consistency, the dialogue consistency discrimination model uses a RoBERTa model, discriminates the consistency of the reply generated by the current model and the given role information by fine-tuning the RoBERTa on the second training data set, and takes the discrimination result, i.e., a score, as loss2, wherein loss2 represents the loss between the generated reply and the role information. The difference between the generation result of the large-scale pre-training model (i.e., the model reply) and the true result (i.e., the true reply) is calculated as loss1. Then, loss1 and loss2 are added as the loss of the fine-tuning of the large-scale pre-training model, so as to solve the role confusion problem of the large model, thereby obtaining the role information independent dialogue model.

[0084] As an optional implementation, the training process of the role information related dialogue model specifically includes:

[0085] A third training data set is obtained, and the third training data set includes a plurality of third training role information and historical dialogues.

[0086] The third training data set is cleaned by using a knowledge selection model to obtain a third training data set containing background information.

[0087] The transformer model is trained by using the third training data set containing background information to obtain the role information related dialogue model.

[0088] Specifically, in order to solve the problem of lack of role background knowledge caused by simply introducing common sense knowledge into the background knowledge of the role dialogue robot, the knowledge enhancement technology and the role consistency technology are fused to improve the role consistency and knowledge richness of the dialogue robot, and a role dialogue model architecture is proposed as shown in Figure 5

[0089] In the aspect of role knowledge enhancement, a role knowledge information selection model is selected, and the specific implementation manner is as follows:

[0090] First, the knowledge selection model is used to preprocess the third training data set to obtain an HPD-knowledge data set. The processing method is as follows: first, the dialogue background is cleaned to remove the dialogue information contained therein, and a background knowledge base is constructed. Then, the role information and the historical dialogue in the data set are retained, and the input of the model is the role information and the current dialogue during training, and the prediction target is the corresponding background knowledge. Through this supervised training manner, the model learns to select the corresponding background knowledge in the knowledge base according to the current dialogue.

[0091] As an optional implementation, the calculation formula of the first loss is as follows: ​

[0092]

[0093] wherein Loss1 is the first loss, n is the number of questions in the second training data set, i is the serial number of the question in the second training data set, y i is the real reply of the i-th question, is the model reply of the i-th question.

[0094] As Figure 6 shown below, a role-oriented dialogue system is provided for implementing the method in embodiment 1.

[0095] The role-oriented dialogue system includes an input part (Input), a dialogue type selection module (Choose), a dialogue generation module (Generate) and an output part (Output).

[0096] The input part is used to input role information and historical dialogue.

[0097] The dialogue type selection module is used to determine the dialogue type according to the role information and the historical dialogue, so as to select a role information independent dialogue model or a role information related dialogue model.

[0098] The dialogue generation module includes a role information independent dialogue model and a role information related dialogue model, which are used to obtain the reply to the question.

[0099] The output part is used to output the reply to the question.

[0100] Embodiment 2

[0101] The human-computer dialogue system in this embodiment includes:

[0102] A data acquisition module is used to acquire the current dialogue; the current dialogue includes a target question and historical data; the historical data includes role information and historical dialogue.

[0103] A dialogue type determination module is used to input the historical data into a dialogue type selection model to obtain the dialogue type of the current dialogue; the dialogue type is a role information independent dialogue or a role information related dialogue; the dialogue type selection model is obtained based on Chinese-BERT-wwm.

[0104] A first reply module is used to input the target question into a role information independent dialogue model to obtain a role independent reply to the target question when the dialogue type of the current dialogue is a role information independent dialogue; the role information independent dialogue model is obtained based on a large-scale pre-training model.

[0105] The second reply module is configured to input the target question into a role information related dialogue model to obtain a role related reply to the target question when the dialogue type of the current dialogue is a role information related dialogue. The role information related dialogue model is obtained based on a transformer model.

[0106] Embodiment 3

[0107] An electronic device includes:

[0108] One or more processors.

[0109] A memory device having one or more programs stored thereon.

[0110] When the one or more programs are executed by the one or more processors, the one or more processors implement the human-computer dialogue method as in Embodiment 1.

[0111] Embodiment 4

[0112] A storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the human-computer dialogue method as in Embodiment 1.

[0113] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between the various embodiments can be mutually referred to. For the system disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part.

[0114] The principles and implementation manners of the present application are described by using specific examples in the present application. The above description of the embodiments is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manner and application range can be changed. In conclusion, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A human-machine dialog method, characterized in that, The method comprises: obtaining a current dialogue; the current dialogue comprises a target question and historical data; the historical data comprises role information and historical dialogue; inputting the historical data into a dialogue type selection model to obtain a dialogue type of the current dialogue; the dialogue type is a role information independent dialogue or a role information related dialogue; the dialogue type selection model is obtained based on Chinese-BERT-wwm; when the dialogue type of the current dialogue is a role information independent dialogue, inputting the target question into a role information independent dialogue model to obtain a role independent reply to the target question; the role information independent dialogue model is obtained based on a large-scale pre-training model; when the dialogue type of the current dialogue is a role information related dialogue, inputting the target question into a role information related dialogue model to obtain a role related reply to the target question; the role information related dialogue model is obtained based on a transformer model.

2. The human-to-computer dialog method of claim 1, wherein, The training process of the dialogue type selection model comprises: obtaining a first training data set; the first training data set comprises: role information and historical dialogue of a plurality of first training roles; adding a first label to each training role to obtain a first training data set with a first label; when the role information and historical dialogue of the training role are related, the first label is a role related label; when the role information and historical dialogue of the training role are independent, the first label is a role independent label; training the Chinese-BERT-wwm using the labeled first training data set to obtain the dialogue type selection model.

3. The human-to-computer dialog method of claim 1, wherein, The training process of the role information independent dialogue model comprises: obtaining a second training data set; the second training data set comprises: role information and historical dialogue of a plurality of second training roles; inputting the questions in the second training data set into the large-scale pre-training model to obtain a model reply to each question; calculating the loss of the model reply of each question and the true reply corresponding to each question in the second training data set to obtain a first loss; determining a second loss according to the model reply of each question and the role information using a RoBERTa model; training the large-scale pre-training model based on the first loss and the second loss to obtain the role information independent dialogue model.

4. The human-to-computer dialog method of claim 1, wherein, The training process of the role information related dialogue model comprises: obtaining a third training data set; the third training data set comprises: role information and historical dialogue of a plurality of third training roles; cleaning the third training data set using a knowledge selection model to obtain a third training data set containing background information; training the transformer model using the third training data set containing background information to obtain the role information related dialogue model.

5. The human-to-computer dialog method of claim 3, wherein, The calculation formula of the first loss is: wherein Loss1 is the first loss, n is the number of questions in the second training data set, i is the serial number of the question in the second training data set, y i is the true reply for the i-th question, is the model reply for the i-th question.

6. A man-machine dialog system, characterized in that The system comprises: The data acquisition module is configured to acquire a current dialogue, wherein the current dialogue comprises a target question and historical data, and the historical data comprises role information and historical dialogue. The dialogue type determination module is configured to input the historical data into a dialogue type selection model to obtain a dialogue type of the current dialogue, wherein the dialogue type is a role information independent dialogue or a role information related dialogue, and the dialogue type selection model is obtained based on Chinese-BERT-wwm. The first reply module is configured to input the target question into a role information independent dialogue model to obtain a role independent reply to the target question when the dialogue type of the current dialogue is the role information independent dialogue, and the role information independent dialogue model is obtained based on a large-scale pre-training model. The second reply module is configured to input the target question into a role information related dialogue model to obtain a role related reply to the target question when the dialogue type of the current dialogue is the role information related dialogue, and the role information related dialogue model is obtained based on a transformer model.

7. An electronic device, comprising: The method comprises the following steps: one or more processors; a storage device having one or more programs stored thereon; when the one or more programs are executed by the one or more processors, the one or more processors implement the human-computer dialogue method according to any one of claims 1 to 5.

8. A storage medium, characterized by a computer program is stored thereon, and the computer program is executed by a processor to implement the human-computer dialogue method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Man-machine conversation method and system based on role and knowledge information comparison selection network

    CN115828933A

  • Program, method, and information processor

    JP2022121770A