Personal common sense knowledge graph, personal dialogue data set and personal consistency method
By building a common sense knowledge map of characters and model rewriting technology, the problem of indirect character conflicts in chatbot replies is solved, and the consistency of characters in dialogue responses is achieved, which is suitable for scenarios that require common sense knowledge.
Patent Information
- Application Number
- CN202310348845.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-04
- Publication Date
- 2024-10-15
AI Technical Summary
The existing technology is difficult to handle indirect personality conflicts in chatbot replies, especially in implicit personality conflict scenarios that require common sense knowledge, and relies on predefined complete portraits, which is difficult to implement in the real world.
Construct a common sense knowledge map of persona, collect encyclopedia data from the Internet through artificial enrichment, establish portrait key pairs and their consistency relationships, combine the BERT-SPC model and p-UIE model, identify and rewrite responses with inconsistent personas, and generate personas. Consistent dialogue.
Effectively handles implicit personality conflicts in conversations, and ensures the consistency of dialogue responses through the personality knowledge map and model rewriting technology, improving the consistency of the chat robot's personality.
Smart Images

Figure CN118779409A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of dialogue systems, and specifically relates to a character common sense knowledge graph, a character dialogue data set, and a character consistency method. Background Art
[0002] Dialogue systems play an irreplaceable role in practical applications such as customer service and personal assistants. In natural language processing, developing a more human-like chatbot is a challenging task, and the key point is to maintain a consistent chatbot personality. Current work on chatbot personality consistency focuses on identifying explicit conflicts between the chatbot's responses and its predefined portraits. In some human-computer interaction scenarios, the chatbot is given a personality with some predefined portraits, such as name, age, hobbies, etc. For example, a three-stage end-to-end generation framework is used to generate dialogues consistent with the predefined portraits and detect and delete inconsistent words in the responses. A reinforcement learning framework with natural language inference technology is proposed to enhance the generation of dialogues consistent with the predefined portraits. Another work focuses more on the contextual consistency in the dialogue, that is, whether the responses are consistent under different questions. Humans ask chatbots questions in different ways, and they hope to get the same answer. For example, some studies use automatic question generation and question answering with natural language inference to ensure factual consistency in knowledge-based dialogues. There are also studies that use event graphs to determine the schema of multi-round dialogues to generate more coherent dialogues.
[0003] However, the existing portrait-centric persona consistency research relies on predefined complete portraits and can only detect direct and explicit persona conflicts between the chatbot's responses and its predefined portraits. In real-world scenarios, on the one hand, a complete chatbot portrait is usually difficult to obtain, and on the other hand, there are a large number of indirect persona conflicts between chatbot responses that are difficult to identify. The existing contextual consistency mainly focuses on the semantic consistency and continuity of the conversation, and this type of work cannot handle implicit persona conflicts that require common sense knowledge. Summary of the invention
[0004] The present invention is made to solve the above-mentioned problems, and its purpose is to provide a character common sense knowledge graph, a character dialogue data set and a character consistency method.
[0005] The present invention provides a method for constructing a common sense knowledge graph of a person, which has the following characteristics and comprises the following steps: step S1, selecting the person attributes in human characteristics and daily life content as portrait keys; step S2, searching the specific encyclopedia data corresponding to the portrait keys from the Internet platform as portrait values through artificial enrichment; step S3, for all portrait keys, forming a portrait key pair with two different portrait keys that are related to each other to obtain a plurality of portrait key pairs; step S4, for each portrait key pair, constructing a portrait value pair according to the portrait values corresponding to the two portrait keys in the portrait key pair; step S5, according to the portrait value pair, obtaining the corresponding portrait ((X, x), r, (Y, y)) through artificial annotation, and all the portraits constitute a common sense knowledge graph of a person, wherein (X, x) is a head node, (Y, y) is a tail node, X and Y are two portrait keys in the portrait respectively, x is a portrait value corresponding to the portrait key X, y is a portrait value corresponding to the portrait key Y, and r is the consistency relationship between the portrait value x and the portrait value y, i.e., consistency or inconsistency.
[0006] In the method for constructing the character common sense knowledge graph provided by the present invention, it can also have the following characteristics: wherein, the consistency relationship r between the head node (X, x) and the tail node (Y, y) is a directed edge from the head node (X, x) to the tail node (Y, y).
[0007] The present invention also provides a method for consistent persona under the guidance of common sense knowledge for a dialogue system, which is used to rewrite inconsistent persona replies in a dialogue text containing multiple questions and corresponding replies into replies consistent with the persona according to the common sense knowledge graph of the persona, and has the following characteristics, including the following steps: Step T1, selecting a reply to be identified in the dialogue text as the current reply; Step T2, inputting the current reply and the question and the next question corresponding to the current reply in the dialogue text into the attention-enhanced BERT-SPC model to obtain a label for the current reply; Step T3, judging whether the label is inconsistent with the persona, if so, entering step T4, if not, the current reply is a reply consistent with the persona; Step T4, The reply and the corresponding question are input into the p-UIE model to obtain the portrait key pair of the current reply; step T5, sort all the portrait value pairs corresponding to the portrait key pairs in the character common sense knowledge graph according to the weight from large to small, and select the first n portrait value pairs; step T6, input the n portrait value pairs and the 7 questions and replies before the current reply in the dialogue text into different encoders of the generation model T5 respectively, and obtain the corresponding encoded output; step T7, splice and decode all the encoded outputs to obtain a reply consistent with the character; step T8, replace the current reply with a reply consistent with the character in the dialogue text, and the rewriting is completed, wherein the character common sense knowledge graph is constructed by any of the character common sense knowledge graph construction methods as above.
[0008] The persona consistency method guided by common sense knowledge for a dialogue system provided by the present invention may also have the following features: wherein the attention-enhanced BERT-SPC model in step T2 includes a self-attention mechanism and a BERT-SPC model, and the specific formula for obtaining the label of the current reply is expressed as: p o ,s o =B S ([S post ; S cur ; S pre ]), H=p o +H att , Where S post , S cur and S pre are the next question of the current reply, the current reply, and the question corresponding to the current reply, respectively. S For the BERT-SPC model, p o is the semantic representation of the sentence of the current reply, s o is the hidden state in the last layer of the BERT-SPC model output, tt is the word segmentation type index, is the masked sentence output, Att is the self-attention mechanism, H att is the attention hidden state, H is the final hidden state, den is the dense layer, For the attention-enhanced BERT-SPC model, is the person consistency classifier of the attention-enhanced BERT-SPC model, and L is the label of the current reply.
[0009] The method for consistent character settings guided by common sense knowledge for dialogue systems provided by the present invention may also have the following features: wherein, the attention-enhanced BERT-SPC model in step T2 is trained by the adversarial training method FGM, combined with a dynamic decay learning rate and ten-fold cross validation, and the loss function is a binary focal loss.
[0010] The character consistency method guided by common sense knowledge for dialogue systems provided by the present invention may also have the following features: wherein, the construction process of the p-UIE model in step T4 is: inputting the training sentences and the portrait key pairs in the training sentences into the UIE-base model, performing F1 scoring on the output portrait value pairs, and fine-tuning the UIE-base model according to the F1 scoring to obtain the p-UIE model.
[0011] The character consistency method guided by common sense knowledge for a dialogue system provided by the present invention may also have the following features: wherein, the weight calculation process in step S5 is as follows: multiple groups of multi-round Chinese dialogues are collected from the dialogue platform, and answer sentences containing portrait key pairs of the character common sense knowledge graph are retrieved from each group of multi-round Chinese dialogues, and the answer sentences and the three sentences preceding the answer sentences in the multi-round Chinese dialogues are used as dialogue blocks, and the frequency of occurrence of each portrait-value pair corresponding to the portrait key pair in all dialogue blocks is calculated, and the ratio of the frequency of the portrait-value pair to the sum of the frequencies of all portrait-value pairs corresponding to the portrait key pair is the weight of the portrait-value pair.
[0012] The present invention also provides a method for constructing a character dialogue data set, which has the following characteristics, including the following steps: step R1, designing multiple question and answer templates for each portrait in the character common sense knowledge graph, and putting the portrait key and the portrait value into the corresponding multiple question and answer templates to obtain multiple question and answer pairs; step R2, collecting dialogues containing the portrait key in the character common sense knowledge graph from the open source data set DuLeMon as original dialogue blocks; step R3, according to the character common sense knowledge graph, retrieving the portrait key and the portrait value in the original dialogue block, and putting the retrieved portrait key or the retrieved portrait value into the corresponding multiple question and answer templates to obtain multiple question and answer pairs. The corresponding portrait key is used as the marked portrait key; step R4, searching the portrait corresponding to the head node containing the marked portrait key in the character common sense knowledge graph, randomly selecting a question-answer pair from all the question-answer pairs corresponding to the portrait key in the tail node of the portrait, and inserting the selected question-answer pair after the sentence where the marked portrait key is located to obtain a new dialogue block; step R5, executing steps R3 to R4 for all original dialogue blocks, and all the new dialogue blocks obtained constitute a character dialogue data set, wherein the character common sense knowledge graph is constructed by any of the character common sense knowledge graph construction methods as above.
[0013] Functions and Effects of the Invention
[0014] According to the character common sense knowledge graph, character dialogue data set and character consistency method involved in the present invention, because through the setting of portrait keys and the manual enrichment of portrait values, a character common sense knowledge graph that can express whether the character is consistent between two portrait values is constructed, and the character common sense knowledge graph is used to insert question and answer pairs based on question and answer templates on the basis of the existing open source data set to construct a character dialogue data set, and the attention-enhanced BERT-SPC model and the character common sense knowledge graph are used to identify whether the reply to be tested is inconsistent with the above character, and the p-UIE model is used to extract the portrait key pairs in the inconsistent replies, and the portrait value pairs are selected according to the weights to construct a character consistent reply to replace the original inconsistent reply, thereby achieving character consistency in the dialogue reply. Therefore, the character common sense knowledge graph, the character dialogue data set and the character consistency method of the present invention can handle implicit character conflicts based on common sense knowledge in the dialogue. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a schematic diagram of the principle of constructing a knowledge graph of common sense about a person setting in an embodiment of the present invention;
[0016] Figure 2 It is a schematic diagram of the process of constructing a knowledge graph of common sense of a person setting in an embodiment of the present invention;
[0017] Figure 3 is a flowchart of a method for constructing a human dialogue data set in an embodiment of the present invention;
[0018] Figure 4 is a schematic diagram of an example of constructing a new dialogue block in an embodiment of the present invention;
[0019] Figure 5 It is a flowchart of a method for consistent character settings guided by common sense knowledge for a dialogue system in an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the following embodiments and the accompanying drawings specifically illustrate the character common sense knowledge graph, character dialogue data set and character consistency method of the present invention.
[0021] Figure 1 It is a schematic diagram of the principle of constructing a character common sense knowledge graph in an embodiment of the present invention.
[0022] like Figure 1 As shown, select the human characteristics and the human attributes in daily life content, such as gender, height, job, and graduate school, as the portrait key, and then collect the encyclopedia data corresponding to the portrait key as the portrait value, for example, the gender value is male and female, the height value is 150cm, 160cm, 170cm, 180cm, etc., the job value is doctor, physical education teacher, actor, etc., and the graduate school value is Peking Union Medical College Hospital, Beijing Film Academy, Beijing Sport University, etc. Then, the two related portrait keys form a portrait key pair, such as (gender, height), (gender, job), (job, graduate school), etc., and then fill the portrait value into the key pair to obtain a portrait value pair, such as (male, 180cm), (male, doctor), (actor, Beijing Film Academy), etc., and manually annotate these portrait value pairs to confirm whether the relationship between the portrait values is consistent, and then obtain a portrait such as ((gender, male), consistent, (height, 180cm)), and all portraits constitute the human common sense knowledge map.
[0023] Figure 2 It is a flowchart of constructing a knowledge graph of common sense about human settings in an embodiment of the present invention.
[0024] like Figure 2 As shown in the figure, the construction of the character common sense knowledge graph includes the following steps:
[0025] Step S1, select human characteristics and human attributes in daily life content to set as portrait keys. In this embodiment, the portrait keys include gender, name, age, birthday, zodiac sign, height, etc.
[0026] Step S2, through manual enrichment, searching the Internet platform for specific encyclopedia data corresponding to the portrait key as the portrait value.
[0027] Step S3: for all portrait keys, two different portrait keys that are related to each other form a portrait key pair, thereby obtaining a plurality of portrait key pairs.
[0028] Step S4, for each portrait key pair, construct a portrait value pair according to the portrait values corresponding to the two portrait keys in the portrait key pair.
[0029] Step S5, according to the portrait value pair, obtain the corresponding portrait ((X,x),r,(Y,y)) through manual labeling, and all portraits constitute the character common sense knowledge graph.
[0030] Among them, (X,x) is the head node, (Y,y) is the tail node, X and Y are two portrait keys in the portrait, x is a portrait value corresponding to the portrait key X, y is a portrait value corresponding to the portrait key Y, and r is the consistency relationship between the portrait value x and the portrait value y, that is, consistency or inconsistency.
[0031] Among them, the consistency relationship r between the head node (X, x) and the tail node (Y, y) is the directed edge from the head node (X, x) to the tail node (Y, y), that is, when the persona contains x, the consistency relationship of the persona containing y is r.
[0032] Figure 3 It is a flowchart of a method for constructing a character dialogue data set in an embodiment of the present invention.
[0033] like Figure 3 As shown in the figure, the method for constructing the character dialogue dataset includes the following steps:
[0034] Step R1, design multiple question and answer templates for each portrait in the character common sense knowledge graph, and put the portrait key and portrait value into the corresponding multiple question and answer templates to obtain multiple question and answer pairs.
[0035] Step R2, collect the dialogues containing the portrait keys in the character common sense knowledge graph from the open source dataset DuLeMon as the original dialogue blocks.
[0036] Step R3, according to the character common sense knowledge graph, retrieve the portrait key and portrait value in the original dialogue block, and use the retrieved portrait key or the portrait key corresponding to the retrieved portrait value as the marked portrait key.
[0037] Step R4, retrieve the portrait corresponding to the head node containing the portrait key in the character common sense knowledge graph, randomly select a question-answer pair from all question-answer pairs corresponding to the portrait key in the tail node of the portrait, insert the selected question-answer pair after the sentence where the portrait key is located, and obtain a new dialogue block.
[0038] Step R5, execute steps R3 to R4 for all original dialogue blocks, and all new dialogue blocks obtained constitute the character dialogue data set.
[0039] Among them, the character common sense knowledge graph is constructed by any of the character common sense knowledge graph construction methods as above.
[0040] Figure 4 It is a schematic diagram of an example of constructing a new dialogue block in an embodiment of the present invention.
[0041] like Figure 4 As shown, in the original dialogue block, the portrait key and portrait value are retrieved according to the character common sense knowledge graph, and the portrait value "piano" is retrieved. Then, the corresponding portrait key "interest" in the character common sense knowledge graph is used as the marked portrait key, and the character common sense knowledge graph is retrieved to obtain the portrait key pair (interest, age). The template-based question-answer pair "How old are you this year? I am 8 years old this year" corresponding to the portrait key "age" is randomly selected, that is, "How old are you this year? I am 8 years old this year" is inserted after the sentence "piano". Then, with "age" as the marked portrait key, the character common sense knowledge graph is retrieved to obtain the portrait key pair (age, things you like to do), and the template-based question-answer pair "Makeup" corresponding to the portrait key "things you like to do" is randomly selected, that is, "What do you like to do? I like makeup" is inserted after the sentence "8 years old". And by automatically adding transition sentences "Not bad! Speaking of which", "Really good," and "Hmm," to achieve the readability of the entire new dialogue block, a new dialogue block containing dialogue content consistent with or inconsistent with the character is constructed, and a character dialogue data set is constructed through multiple new dialogue blocks, which can be used as a training data set for training models.
[0042] Figure 5 It is a flowchart of a method for consistent character settings guided by common sense knowledge for a dialogue system in an embodiment of the present invention.
[0043] like Figure 5 As shown, the character consistency method guided by common sense knowledge for the dialogue system is used to rewrite the inconsistent character replies in the dialogue text containing multiple questions and corresponding replies into consistent character replies according to the character common sense knowledge graph, including the following steps:
[0044] Step T1, select the reply to be recognized in the conversation text as the current reply.
[0045] Step T2: Input the current reply, the question corresponding to the current reply in the conversation text, and the next question into the attention-enhanced BERT-SPC model to obtain the label of the current reply.
[0046] Among them, the attention-enhanced BERT-SPC model includes the self-attention mechanism and the BERT-SPC model. The specific formula for obtaining the label of the current reply is expressed as:
[0047] p o ,s o =B S ([S post ; S cur ; S pre ]),
[0048]
[0049]
[0050]
[0051] Where S post , S cur and S pre are the next question of the current reply, the current reply, and the question corresponding to the current reply, respectively. S For the BERT-SPC model, p o is the semantic representation of the sentence of the current reply, s o is the hidden state in the last layer of the BERT-SPC model output, tt is the word segmentation type index, is the masked sentence output, Att is the self-attention mechanism, H att is the attention hidden state, H is the final hidden state, den is the dense layer, For the attention-enhanced BERT-SPC model, is the person consistency classifier of the attention-enhanced BERT-SPC model, and L is the label of the current reply.
[0052] Among them, the attention-enhanced BERT-SPC model is trained through the adversarial training method FGM, combined with dynamic attenuation learning rate and ten-fold cross validation, and the loss function is binary focal loss.
[0053] Step T3, determine whether the tag is inconsistent with the personality, if so, proceed to step T4, if not, the current reply is a reply consistent with the personality.
[0054] Step T4, input the current reply and the corresponding question into the p-UIE model to obtain the portrait key pair of the current reply.
[0055] The construction process of the p-UIE model is as follows: input the training sentences and the portrait key pairs in the training sentences into the UIE-base model, perform F1 scoring on the output portrait value pairs, and fine-tune the UIE-base model according to the F1 score to obtain the p-UIE model.
[0056] Step T5: sort all portrait-value pairs corresponding to the portrait key pairs in the character common sense knowledge graph according to their weights from large to small, and select the first n portrait-value pairs.
[0057] The weight calculation process is as follows: collect multiple groups of Chinese multi-round dialogues from the dialogue platform, retrieve the answer sentences containing the portrait key pairs of the character common sense knowledge graph from each group of Chinese multi-round dialogues, take the answer sentences and the three sentences before the answer sentences in the Chinese multi-round dialogue as dialogue blocks, calculate the frequency of each portrait value pair corresponding to the portrait key pair in all dialogue blocks, and the ratio of the frequency of the portrait value pair to the sum of the frequencies of all portrait value pairs corresponding to the portrait key pair is the weight of the portrait value pair. In this embodiment, the dialogue platform includes Tieba, Douban, etc.
[0058] Step T6, input the n image-value pairs and the seven questions and replies before the current reply in the conversation text into different encoders of the generation model T5 to obtain the corresponding encoding output.
[0059] Step T7, concatenate all the coded outputs and decode them to get a response consistent with the character setting.
[0060] Based on n portrait value pairs and a total of 7 questions and replies before the current reply in the conversation text, the process of obtaining a reply consistent with the persona is described as follows:
[0061]
[0062] h p ' = T5Enc(p'),
[0063]
[0064] Where S' pre is the total of 7 questions and answers before the previous reply. T5Enc is the encoder of the generative model T5. is the output of the encoder for 7 sentences, p' is n image-value pairs, h p ' is the output of the encoder for n image value pairs, T5Dec is the decoder of the generative model T5, and R is the reply.
[0065] Step T8, replace the current reply with a reply consistent with the character setting in the conversation text, and the rewriting is completed.
[0066] Among them, the character common sense knowledge graph is constructed by any of the character common sense knowledge graph construction methods as above.
[0067] Functions and Effects of the Embodiments
[0068] According to the character common sense knowledge graph, character dialogue data set, and character consistency method involved in this embodiment, a character common sense knowledge graph that can express the consistency of the character between two portrait values is constructed by setting portrait keys and manually enriching portrait values. The character common sense knowledge graph is used to insert question and answer pairs based on question and answer templates on the basis of the existing open source data set to construct a character dialogue data set. The attention-enhanced BERT-SPC model and the character common sense knowledge graph are used to identify whether the response to be tested is inconsistent with the character above. The p-UIE model is used to extract the portrait key pairs in the inconsistent replies. The portrait value pairs are selected according to the weights to construct a consistent character reply to replace the original inconsistent character reply, thereby achieving consistent character in the dialogue reply. In short, this method can handle implicit character conflicts based on common sense knowledge in dialogues.
[0069] The above-mentioned embodiments are preferred examples of the present invention and are not intended to limit the protection scope of the present invention.
Claims
1. A method for constructing a knowledge graph of common sense about human settings. It is characterized in that The following steps are involved: Step S1, selecting human characteristics and human attributes in daily life content as portrait keys; Step S2, searching the Internet platform for specific encyclopedia data corresponding to the portrait key as the portrait value through manual enrichment; Step S3, for all the portrait keys, two different portrait keys that are associated with each other form a portrait key pair, to obtain a plurality of portrait key pairs; Step S4, for each of the portrait key pairs, constructing a portrait value pair according to the portrait values corresponding to the two portrait keys in the portrait key pair; Step S5, according to the image-value pair, obtain the corresponding image ((X,x),r,(Y,y)) through manual annotation, and all the images constitute the character common sense knowledge graph, Among them, (X, x) is the head node, (Y, y) is the tail node, X and Y are respectively the two portrait keys in the portrait, x is a portrait value corresponding to the portrait key X, y is a portrait value corresponding to the portrait key Y, and r is the consistency relationship between the portrait value x and the portrait value y, that is, consistency or inconsistency.
2. The method for constructing a character common sense knowledge graph according to claim 1, characterized in that: in, The consistency relationship r between the head node (X, x) and the tail node (Y, y) is a directed edge from the head node (X, x) to the tail node (Y, y).
3. A common sense knowledge-guided persona consistency method for a dialogue system, which is used to rewrite inconsistent persona responses in a dialogue text containing multiple questions and corresponding responses into consistent persona responses based on a common sense knowledge graph of persona. It is characterized in that The following steps are involved: Step T1, selecting the reply to be identified in the conversation text as the current reply; Step T2, inputting the current reply and the question corresponding to the current reply in the conversation text and the next question into the attention-enhanced BERT-SPC model to obtain a label of the current reply; Step T3, determining whether the label is inconsistent with the persona, if so, proceeding to step T4, if not, the current reply is a reply consistent with the persona; Step T4, inputting the current reply and the corresponding question into the p-UIE model to obtain a portrait key pair of the current reply; Step T5, sorting all the portrait-value pairs corresponding to the portrait key pairs in the character common sense knowledge graph according to the weight from large to small, and selecting the first n portrait-value pairs; Step T6, inputting the n image-value pairs and the seven questions and replies before the current reply in the conversation text into different encoders of the generation model T5 respectively to obtain corresponding encoding outputs; Step T7, concatenating and decoding all the coded outputs to obtain a response consistent with the character setting; Step T8, in the dialogue text, the current reply is replaced with a reply consistent with the character setting, and the rewriting is completed. Among them, the character common sense knowledge graph is constructed by the character common sense knowledge graph construction method described in any one of claims 1 to 2.
4. The method for consistent character settings guided by common sense knowledge for a dialogue system according to claim 3, characterized in that: in, The attention-enhanced BERT-SPC model in step T2 includes a self-attention mechanism and a BERT-SPC model, and the specific formula for obtaining the label of the current reply is expressed as: p o ,s o =B S ([S post ;S cur ;S pre ]), H=p o +H att , Where S post , S cur and S pre are respectively the next question of the current reply, the current reply, and the question corresponding to the current reply, B S For the BERT-SPC model, p o is the semantic representation of the sentence of the current reply, s o is the hidden state in the last layer of the BERT-SPC model output, tt is the word segmentation type index, is the masked sentence output, Att is the self-attention mechanism, H att is the attention hidden state, H is the final hidden state, den is the dense layer, For the attention-enhanced BERT-SPC model, l is the person consistency classifier of the attention-enhanced BERT-SPC model, and L is the label of the current reply.
5. The method for consistent character settings guided by common sense knowledge for a dialogue system according to claim 3, characterized in that: in, The attention-enhanced BERT-SPC model in step T2 is trained by the adversarial training method FGM, combined with a dynamic decay learning rate and ten-fold cross validation, and the loss function is a binary focal loss.
6. The method for consistent character settings guided by common sense knowledge for a dialogue system according to claim 3, characterized in that: in, The construction process of the p-UIE model in step T4 is: The training sentences and the portrait key pairs in the training sentences are input into the UIE-base model, the output portrait value pairs are scored by F1, and the UIE-base model is fine-tuned according to the F1 score to obtain the p-UIE model.
7. The method for consistent character settings guided by common sense knowledge for a dialogue system according to claim 3, characterized in that: in, The calculation process of the weight in step S5 is as follows: Collect multiple groups of multi-round Chinese dialogues from the dialogue platform, retrieve answer sentences containing the portrait key pairs of the character common sense knowledge graph from each group of the Chinese multi-round dialogues, take the answer sentences and the three sentences preceding the answer sentences in the Chinese multi-round dialogues as dialogue blocks, calculate the frequency of occurrence of each portrait-value pair corresponding to the portrait key pair in all dialogue blocks, and the ratio of the frequency of the portrait-value pair to the sum of the frequencies of all the portrait-value pairs corresponding to the portrait key pair is the weight of the portrait-value pair.
8. A method for constructing a human dialogue dataset. It is characterized in that The following steps are involved: Step R1, design multiple question-answer templates for each portrait in the character common sense knowledge graph, and put the portrait key and portrait value into the corresponding multiple question-answer templates to obtain multiple question-answer pairs; Step R2, collect the dialogues containing the portrait keys in the character common sense knowledge graph from the open source dataset DuLeMon as the original dialogue blocks; Step R3, according to the character common sense knowledge graph, retrieve the portrait key and the portrait value in the original dialogue block, and use the retrieved portrait key or the portrait key corresponding to the retrieved portrait value as a marked portrait key; Step R4, searching the character common sense knowledge graph for the portrait corresponding to the head node containing the portrait key, randomly selecting a question-answer pair from all the question-answer pairs corresponding to the portrait key in the tail node of the portrait, and inserting the selected question-answer pair after the sentence where the portrait key is located to obtain a new dialogue block; Step R5, executing steps R3 to R4 for all original dialogue blocks, and all the new dialogue blocks obtained constitute a character dialogue data set, Among them, the character common sense knowledge graph is constructed by the character common sense knowledge graph construction method described in any one of claims 1 to 2.
Citation Information
Patent Citations
Knowledge graph construction method based on financial anti-fraud
CN110795574A
Travel-Related Cognitive Profiles
US20150356416A1
