Knowledge graph-based multi-turn dialogue method, system, device and storage medium
By combining deep learning and syntactic analysis with dialogue history and state information for intent recognition and question answering, the problem of correlation between multi-turn dialogues is solved, and accurate multi-turn dialogue processing is achieved.
Patent Information
- Application Number
- CN202311031732.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-16
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2043-08-16
AI Technical Summary
Existing technology cannot establish connections between multiple rounds of dialogue, resulting in an inability to accurately handle different user intentions and inaccurate responses.
Deep learning and syntactic analysis are used to identify the intent of questions, and state tracking and backtracking are performed by combining dialogue history state information. Intent-based question answering is achieved by using question categories and dialogue history state information to realize the association between multi-turn dialogues.
It enables connections between multiple rounds of dialogue, accurately handles different user intentions, and provides more accurate question-and-answer results.
Smart Images

Figure CN117076633B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of multi-turn dialogue, in particular to a multi-turn dialogue method and system based on a knowledge graph, a device and a storage medium. BACKGROUND
[0002] With the development of artificial intelligence fields such as deep learning technology, natural language processing technology, knowledge graph technology, human-computer dialogue is widely used in the fields of smart home, intelligent voice assistants, etc., so the human-computer dialogue technology based on multi-turn dialogue has developed greatly. However, the multi-turn dialogue based on the knowledge graph is based on the knowledge graph, and according to the user's input question, the knowledge in the knowledge graph is used as the answer to reply.
[0003] The multi-turn dialogue of the knowledge graph belongs to the task type dialogue. Generally, the task type dialogue is a multi-turn dialogue based on a specific task, so as to complete the task required by the user and provide the information required by the user. At present, the multi-turn dialogue of the knowledge graph first performs intent recognition and slot filling according to the user dialogue information, then performs decision processing according to the intent recognition, and finally returns the decision processing result to the user; however, with the increasing types of sentence patterns and keywords in the multi-turn dialogue, the slot filling method of presetting slots gradually no longer applies to the multi-turn dialogue, and cannot realize the association between the multi-turn dialogues, thereby losing the interaction between the upper and lower turn dialogues and being unable to answer more accurately. SUMMARY
[0004] The present application provides a multi-turn dialogue method and system based on a knowledge graph, a device and a storage medium, which solves the problem that the prior art cannot realize the association between the multi-turn dialogues and cannot accurately process different intents of the user and answer inaccurately.
[0005] In a first aspect, a multi-turn dialogue method based on a knowledge graph is provided in the embodiments of the present application, and the method comprises the following steps:
[0006] Obtain question information, and query dialogue history state information according to the question information;
[0007] Perform intent recognition on the question information in a deep learning and syntax analysis manner to obtain a question category;
[0008] Perform intent question answering on the question information based on the state tracking of the question category and the dialogue history state information to obtain a current state answer;
[0009] Perform strategy processing on the current state answer to obtain a question and answer result of the multi-turn dialogue, and perform state backtracking based on the question and answer result of the multi-turn dialogue to update the dialogue history state.
[0010] In the above embodiment, the intention of the question information is recognized by using deep learning and syntax analysis, the question category is obtained, and then the accurate question and answer are carried out for the intention of different question categories, and the association between multiple rounds of dialogues is realized by state tracking and state backtracking in the intention recognition process, which solves the problem that the prior art cannot realize the association between multiple rounds of dialogues, cannot accurately process different intentions of the user, and cannot accurately answer the question.
[0011] As some optional embodiments of the present application, the process of recognizing the intention of the question information by using deep learning and syntax analysis is as follows:
[0012] The question information is classified and processed by using deep learning to obtain a first attribute classification result;
[0013] The question information is classified and processed by using syntax analysis to obtain a second attribute classification result;
[0014] The first attribute classification result and the second attribute classification result of the question information are weighted to obtain the question category of the question information.
[0015] In the above embodiment, the question information is classified by using deep learning and syntax analysis respectively, and the classification results are weighted based on the classification results, so that the classification result of the question information is more accurate, and the accurate question and answer are carried out for the intention of different question categories.
[0016] As some optional embodiments of the present application, the question category of the question information includes a knowledge graph question and answer question and a multi-condition joint query question.
[0017] In the above embodiment, the question category of the question information is divided into a knowledge graph question and answer question and a multi-condition joint query question based on the syntax analysis and the part-of-speech analysis result of the question information, so that the accurate question and answer are carried out for the intention of different question categories.
[0018] As some optional embodiments of the present application, the process of carrying out the intention question and answer of the question information based on the state tracking of the question category and the dialogue history state information is as follows:
[0019] If the question category of the question information is a knowledge graph question and answer question, the question information is classified, entity recognized, entity linked, and simply queried based on the state tracking of the dialogue history state information to obtain a current state answer;
[0020] If the question category of the question information is a multi-condition joint query question, the question information is syntax analyzed, condition divided, relationship / attribute extracted, and jointly queried based on the state tracking of the dialogue history state information to obtain a current state answer.
[0021] In the above embodiments, the question category of the question information is determined in advance, and the targeted intent question answering can be performed according to the determination result, so that the question answering is more accurate and the question answering efficiency is higher.
[0022] As some optional embodiments of the present application, the processes of question classification, entity recognition, entity linking and simple query of the question information based on the state tracking of the dialogue history state information are as follows:
[0023] The question information is classified by using the deep learning method to obtain the triple classification result;
[0024] The entity recognition is performed on the question information or the dialogue history state information by using the deep learning method to obtain the entity;
[0025] The entity linking is performed on the entity by using the knowledge graph method to obtain the entity linking result;
[0026] The similarity analysis is performed on the entity linking result by using the deep learning method to obtain the answer triple;
[0027] The simple query of the graph database is performed based on the answer triple to obtain the current state answer.
[0028] In the above embodiments, based on the state tracking of the dialogue history state information, the knowledge graph question answering question is subjected to the intent question answering in combination with the deep learning technology and the knowledge graph technology, so that the current state answer can be obtained more quickly and directly.
[0029] As some optional embodiments of the present application, the processes of syntax analysis, condition division, relationship / attribute extraction and joint query of the question information based on the state tracking of the dialogue history state information are as follows:
[0030] The syntax analysis is performed on the question information by using the syntax analysis method to obtain the part-of-speech tagging result, and the condition word recognition is performed on the question information or the dialogue history state information by using the deep learning method to obtain the condition word;
[0031] The single-condition question division is performed on the question information based on the part-of-speech tagging result and the condition word to obtain a plurality of single-condition short sentences;
[0032] The relationship / attribute word extraction is performed on all the single-condition short sentences to obtain all the condition words and the relationship / attribute words;
[0033] The joint query of the graph database is performed based on all the condition words and the relationship / attribute words to obtain the current state answer.
[0034] In the above embodiment, based on the state tracking of the dialogue history state information, the multi-condition joint query question is subjected to intention question answering by combining the deep learning technology and the syntax analysis technology, so that the current state answer can be more accurately obtained.
[0035] As some optional embodiments of the present application, the process of strategy processing of the current state answer is as follows:
[0036] The current state answer is verified, if there is an entity or a condition word in the question information but no answer, the question containing the entity or the condition word is returned, if there is an answer, the current state answer is directly returned as the question and answer result of the multi-round dialogue;
[0037] The state is traced back based on the question and answer result of the multi-round dialogue, so as to maintain the dialogue history state information management.
[0038] In the above embodiment, by strategy processing of the current state answer, the user intention can be accurately obtained, and more accurate question and answer results can be provided, and by maintaining the dialogue history state information management, the normal state tracking can be ensured, and the association between the multi-round dialogues can be realized.
[0039] In a second aspect, the present application provides a multi-round dialogue system based on a knowledge graph, the system comprising:
[0040] A question obtaining unit is configured to obtain question information and query dialogue history state information according to the question information;
[0041] A question classification unit is configured to identify the intention of the question information by using deep learning and syntax analysis, so as to obtain a question category;
[0042] A classified question and answer unit is configured to subject the question information to intention question answering based on the question category and the state tracking of the dialogue history state information, so as to obtain a current state answer;
[0043] A strategy processing unit is configured to subject the current state answer to strategy processing, so as to obtain a question and answer result of a multi-round dialogue, and trace back the state based on the question and answer result of the multi-round dialogue, so as to update the dialogue history state.
[0044] In a third aspect, the present application provides a computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the multi-round dialogue method based on the knowledge graph when executing the computer program.
[0045] In a fourth aspect, the present application provides a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program is executed by a processor to implement the method for multi-turn dialogue based on a knowledge graph.
[0046] The present application has the following advantages: the present application adopts a deep learning and syntax analysis method, performs intent recognition and intent question answering on question information based on a knowledge graph, accurately answers file information for different question categories, and realizes the association between multi-turn dialogues through state tracking and state backtracking in the process of intent recognition and intent question answering, thereby solving the problem that the prior art cannot realize the association between multi-turn dialogues and cannot accurately process different intents of users and answer inaccurately. BRIEF DESCRIPTION OF DRAWINGS
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0048] Figure 1 is a flowchart of the method for multi-turn dialogue based on a knowledge graph according to an embodiment of the present application;
[0049] Figure 2 is a schematic diagram of the classifier model based on BERT according to an embodiment of the present application;
[0050] Figure 3 is a schematic diagram of the entity recognition model based on BERT and CRT according to an embodiment of the present application;
[0051] Figure 4 is a schematic diagram of the semantic similarity model based on BERT according to an embodiment of the present application;
[0052] Figure 5 is a structural block diagram of the multi-turn dialogue system based on a knowledge graph according to an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to better understand the above technical solutions, the following will describe the technical solutions of the present application in detail through the drawings and specific embodiments. It should be understood that the specific features in the embodiments and the specific features in the embodiments are detailed descriptions of the technical solutions of the present application, and are not limitations on the technical solutions of the present application. In the case of no conflict, the technical features in the embodiments and the embodiments can be combined with each other.
[0054] It is also to be understood that, in the claims, any means-plus-function clauses are intended to cover the structures described herein as performing the recited functionality along with structures yet to be invented.
[0055] In the process of human-computer conversation, with the gradual increase of multi-round conversation sentences and keyword categories, the existing multi-round conversation method based on a knowledge graph cannot realize the association between multi-round conversations and cannot more accurately output multi-round conversation results. Therefore, the present application provides a multi-round conversation method based on a knowledge graph, which aims to effectively solve the above technical problems.
[0056] Embodiment 1
[0057] The present application provides a multi-round conversation method based on a knowledge graph, please refer to Figure 1 , Figure 1 The flowchart of the method is shown in the figure, and the method flow is as follows:
[0058] (1) Obtain the question information, and query the dialogue history state information according to the question information;
[0059] Among them, if the current question information is the first time the user inputs the inquiry information, at this time, the dialogue history state information cannot be queried according to the question information, that is, the dialogue history state information is empty; if the current question information is the kth time the user inputs the inquiry information, k≥2, at this time, the dialogue history state information queried according to the question information is the question and answer result of the last round of conversation.
[0060] (2) Intention recognition is performed on the question information to obtain the question category;
[0061] Specifically, the flow of intention recognition on the question information is as follows:
[0062] (2.1) A BERT-based classifier model is used to classify the question information to obtain the first attribute classification result; please refer to Figure 2 , Figure 2As an illustration of the BERT-based classifier model, each character Q_n of the question information is first converted into E_n through a pre-training vector; then E_n is input into the BERT-based classifier model, and the hidden layer vector H_n of each character is output through the model, and the vector category H_cls of the hidden layer vector H_n is taken as the sentence category of the entire question information; finally, the classification result of the sentence category (including the multi-condition joint query question and the knowledge graph question answering question) is obtained through the MLP layer, and then the first attribute classification result is obtained; wherein the BERT-based classifier model is a pre-trained language representation model, which can adapt to various natural language tasks, since the BERT-based classifier model is prior art, and the fine-tuning of the model by adding the MLP layer on the basis of BERT is also prior art, therefore the specific structure of the BERT model and the MLP layer is not limited in the embodiment of the application.
[0063] (2.2) The dependency syntax analyzer is used to classify and process the question information to obtain the second attribute classification result, that is, if the subject is a name or a quantifier, and the comparison word or the limiting word appears in the sliding window with a length of x on the left side of the subject, then the question information is determined to be a multi-condition joint query question, otherwise the question information is determined to be a knowledge graph question answering question.
[0064] (2.3) The first attribute classification result and the second attribute classification result are weighted by using appropriate weight values to obtain the question category; wherein the weight values of the first attribute classification result and the second attribute classification result are set according to the actual situation, and the embodiment of the application does not limit this.
[0065] (3) The question information is intent questioned based on the question category and the dialogue history state information to obtain the current state answer;
[0066] Specifically, the process of intent questioning the question information based on the question category and the dialogue history state information is as follows:
[0067] (3.1) The entity or the condition word is obtained based on the question information;
[0068] For the entity of the knowledge graph question answering question, the entity plays a very important role, and only after the entity is determined can the triple be obtained according to the entity, and then the final question and answer result is obtained through the triple; for the question information, the entity string in the question information is recognized by using the BERT and CRF-based entity recognition model, please refer to Figure 3 , Figure 3The schematic diagram of the entity recognition model based on BERT and CRT is shown in the figure. First, the question information is input into the model in word granularity W_n, and the semantic vectors H_1 to H_9 of each word are obtained through the BERT model, and then a semantic sequence is obtained. Then, the semantic sequence is input into the CRT model, and the optimal sequence expression of the question information is obtained based on the prediction of the CRT model, that is, the semantic sequence corresponding to H_3 to H_6 is "B-I-I-I", so that the optimal sequence expression of the question information is "F_1, F_2, F_3, F_4". The overall entity string recognition adopts "BIO" sequence labeling for model training and prediction. The entity recognition model based on BERT and CRF is also prior art, so the specific structure of the entity recognition model based on BERT and CRF is not limited.
[0069] For determining the condition words of the multi-condition joint query question, a combination of a neural network model and a dependency syntax analyzer is used to determine the condition words, that is, first, the condition word string is obtained through the neural network model, and then the part-of-speech tagging and special part-of-speech (institution name, organization name, company name, numeral, measure word, etc.) corresponding word extraction are performed through the dependency syntax analyzer to obtain the condition words.
[0070] (3.2) If the entity or condition word cannot be obtained based on step (3.1), the current question information potential entity and condition word need to be determined in combination with the dialogue history state information, that is, the entity and triple in the dialogue history state information are matched with the current question information to determine the potential entity or condition word corresponding to the current question information according to the matching score.
[0071] (3.3) If the question category of the question information is a knowledge graph question:
[0072] Question classification: The question information is classified into two categories, single-hop question (question involving one triple) and multi-hop question (question involving multiple triples), that is, the pre-trained BERT-based classifier model is used to classify the question information into single-hop question and multi-hop question.
[0073] Entity linking: The entity obtained in step (3.1) is linked to the knowledge graph; that is, the entity is matched with all candidate entities in the knowledge graph, and the multi-feature integration method is used to realize the entity linking, and the label corresponding to the recognized entity is used as a feature, and the special part-of-speech (institution name, organization name, company name, numeral, measure word, etc.) corresponding word extraction of the entity string is performed to complete the entity linking.
[0074] After obtaining the entity corresponding to the question information through entity linking, according to the knowledge graph question and answer question binary classification result, the entity is searched in the knowledge graph to find the corresponding single-hop triple or multi-hop triple. That is, through the pre-trained BERT-based semantic similarity model, please refer to Figure 4 , Figure 4 The schematic diagram of the BERT-based semantic similarity model is shown in FIG. 1. The question information Q_1 to Q_n and the triple T_1 to T_n are combined into a sentence through a separator, and after vectorization (E_cls, QE_1…QE_n, E_sep, Te_1…Te_m), the BERT-based semantic similarity model is input. H_cls is taken as the model hidden layer output through the MLP layer and the Softmax layer. The semantic similarity between the question information and the triple is calculated, and the triple with the highest similarity is selected as the answer triple. Since the BERT-based classifier model is prior art, and the fine-tuning of the model by adding the MLP layer and the Softmax layer based on BERT is also prior art, the specific structure of the BERT model, the MLP layer and the Softmax layer is not limited in the embodiment of the present application.
[0075] Simple query: after obtaining the answer triple, a graph database query statement is constructed, and a simple query of the graph database is performed based on the answer triple to obtain the current state answer.
[0076] (3.4) If the question information is a knowledge graph question and answer question:
[0077] Syntactic analysis: according to the question information, a dependency syntactic analyzer is used for syntactic analysis to obtain the part-of-speech tagging result corresponding to the question, and the conditional words obtained in step (3.1) are combined.
[0078] Conditional division: according to the conditional words and the part-of-speech tagging result, the multi-condition joint query question is divided into single-condition questions, that is, the multi-condition joint query question is divided into multiple single-condition short sentences according to the conditional words. Specifically, after syntactic analysis and part-of-speech tagging of the question information, when the subject is a quantifier or a noun (noun attribute word), it is taken as the conditional word of the question, and a sliding window with a length of x is used to slide to the left of the conditional word to obtain the short sentence of the conditional word, thereby completing the division of the question.
[0079] Relation / attribute extraction: according to the part-of-speech tagging result of the question information, the conditional words and the relation / attribute words (verbs, noun verbs, etc. in part-of-speech tagging) are extracted for each single-condition short sentence, and the conditional words and the relation / attribute words corresponding to all single-condition questions are combined to obtain all conditional words and relation / attribute words of the question information.
[0080] Joint query: combine all condition words and relationship / attribute words in the question information to construct a graph database query statement, and query the final answer based on the built graph database to obtain the current state answer.
[0081] (4) Strategy processing is performed on the current state answer to obtain the question and answer result of the multi-round dialogue.
[0082] Specifically, the process of strategy processing on the current state answer is as follows:
[0083] (4.1) The current state answer is checked, if there is an entity or condition word in the question information, but no answer, the question containing the entity or condition word is returned; if there is an answer, the current state answer is directly returned as the question and answer result of the multi-round dialogue;
[0084] (4.2) State backtracking is performed based on the question and answer result of the multi-round dialogue to maintain the dialogue history state information management, that is, the answer and its information (entity and condition word, triple information, etc.) of the current round of dialogue are stored in the dialogue history state information to maintain the dialogue state management.
[0085] The embodiment of the application adopts the mode of deep learning and syntax analysis, performs intent recognition and intent question and answer on the question information based on the knowledge graph, accurately answers the file information of different question categories, and realizes the association between multi-round dialogues through state tracking and state backtracking in the process of intent recognition and intent question and answer, solving the problem that the prior art cannot realize the association between multi-round dialogues, cannot accurately process different intents of users, and the answer is not accurate.
[0086] In the embodiment of the application, the above process is illustrated by examples, and the specific process is as follows:
[0087] ① The question information "Heller Military Industrial Company belongs to which country?" input by the user is obtained through step (1).
[0088] ② The question information is subjected to question intent recognition through step (2), and the question category is obtained as a simple knowledge graph question and answer question.
[0089] ③ After obtaining the question category, the entity corresponding to the question is determined as "Heller Military Industrial Company" through step (3.1), and the answer to the question is obtained as "Greece" through step (3.3).
[0090] ④ The first round of question and answer result is obtained as "Greece" through step (4) in combination with the answer.
[0091] ⑤ The second round of question and answer is performed, and the question information "What weapons does it produce?" input by the user is obtained.
[0092] ⑥The second round of question information is subjected to question intention recognition through step (2), and it is obtained that the question category belongs to a simple knowledge graph question.
[0093] ⑦The question information is subjected to step (3.1) and (3.2) to obtain the entity corresponding to the question as "Greece", and then subjected to step (3.3) to obtain the answer of the question as "A-7 attack aircraft".
[0094] ⑧The answer is combined through step (4), and the second round of question and answer result is obtained as "A-7 attack aircraft".
[0095] ⑨The third round of question and answer is performed, and the question information "A-7 attack aircraft when is the first flight time?" input by the user is obtained.
[0096] ⑩The third round of question information is subjected to question intention recognition through step (2), and it is obtained that the question category belongs to a simple knowledge graph question.
[0097] The question information is subjected to step (3.1) "A-7 attack aircraft", and then subjected to step (3.3) to obtain the answer of the question as "1965".
[0098] The answer is combined through step (4), and the third round of question and answer result is obtained as "1965".
[0099] The fourth round of question and answer is performed, and the question information "which aircraft has a first flight time greater than this time?" input by the user is obtained.
[0100] The fourth round of question information is subjected to question intention recognition through step (2), and it is obtained that the question category belongs to a multi-condition joint query question.
[0101] The question information is subjected to step (3.1) and (3.2) to obtain the entity corresponding to the question as "1965", and then subjected to step (3.4) to obtain the answer "Jiuer type reconnaissance aircraft".
[0102] The answer is combined through step (4), and the fourth round of question and answer result is obtained as "Jiuer type reconnaissance".
[0103] The multi-round dialogue is ended.
[0104] Embodiment 2
[0105] The application provides a multi-round dialogue system based on a knowledge graph, please refer to Figure 5 , Figure 5A structural diagram of the system, which corresponds to the method of embodiment 1, comprises:
[0106] An interrogative sentence acquisition unit is configured to acquire interrogative sentence information and query dialogue history state information according to the interrogative sentence information;
[0107] An interrogative sentence classification unit is configured to perform intent recognition on the interrogative sentence information by using deep learning and syntax analysis to acquire an interrogative sentence category;
[0108] A classified question and answer unit is configured to perform intent question and answer on the interrogative sentence information based on the interrogative sentence category and state tracking of the dialogue history state information to acquire a current state answer;
[0109] A strategy processing unit is configured to perform strategy processing on the current state answer to acquire a question and answer result of a multi-round dialogue, and perform state rollback based on the question and answer result of the multi-round dialogue to update the dialogue history state.
[0110] Embodiment 3
[0111] The present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of embodiment 1 when executing the computer program.
[0112] The computer device provided in the present embodiment can implement the method of embodiment 1, and thus will not be described here again.
[0113] Embodiment 4
[0114] The present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executable on a processor to implement the method of embodiment 1.
[0115] The computer readable storage medium provided in the present embodiment can implement the method of embodiment 1, and thus will not be described here again.
[0116] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0117] The memory can be used to store the computer program and / or modules, and the processor realizes various functions of the knowledge graph-based multi-turn dialogue system in the application by running or executing the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, for example, a hard disk, a memory, a plug-in hard disk, a smart memory card, a secure digital card, a flash memory card, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory devices.
[0118] If the knowledge graph-based multi-turn dialogue system is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can also be stored in a computer-readable storage medium through a computer program. When the processor executes the computer program, the steps of the above-mentioned various method embodiments can be realized. The computer program includes computer program code, object code form, executable files or some intermediate forms, etc. The computer-readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, point carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the contents contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0119] Having described the basic concepts, it is obvious to one skilled in the art that modifications, improvements and alterations to the above-described detailed disclosure can be made without departing from the teachings of the present specification. Such modifications, improvements and alterations are intended to be, and are, covered by the appended claims, notwithstanding the fact that such modifications, improvements and alterations can not have been described in the above-described detailed disclosure.
Claims
1. A method for multi-turn dialogue based on a knowledge graph, characterized in that, The method comprises the following steps: Obtain question information, and query dialogue history state information according to the question information; An intent of the question information is recognized by using deep learning and syntax analysis to obtain a question category; The intent of the question information is recognized by using deep learning and syntax analysis as follows: The question information is classified by using a BERT-based classifier model to obtain a first attribute classification result; The question information is classified by using a dependency syntax analyzer to obtain a second attribute classification result; The first attribute classification result and the second attribute classification result are weighted by using a weight value to obtain the question category; An intent question and answer of the question information are performed based on the question category and state tracking of the dialogue history state information to obtain a current state answer; The intent question and answer of the question information are performed based on the question category and state tracking of the dialogue history state information as follows: If the question category of the question information is a knowledge graph question and answer question, the question information is classified, entity recognized, entity linked and simply queried based on state tracking of the dialogue history state information to obtain the current state answer; The question information is classified, entity recognized, entity linked and simply queried based on state tracking of the dialogue history state information as follows: The question information is binary classified by using deep learning to obtain a triple classification result; The question information or the dialogue history state information is entity recognized by using deep learning to obtain an entity; The entity is entity linked by using a knowledge graph to obtain an entity linking result; The entity linking result is similarity analyzed by using deep learning to obtain an answer triple; A simple query of a graph database is performed based on the answer triple to obtain the current state answer; If the question category of the question information is a multi-condition joint query question, the question information is syntax analyzed, condition divided, relationship / attribute extracted and jointly queried based on state tracking of the dialogue history state information to obtain the current state answer; The question information is syntax analyzed by using syntax analysis to obtain a part-of-speech tagging result, and the question information or the dialogue history state information is condition word recognized by using deep learning to obtain a condition word; The question information is single-condition question divided based on the part-of-speech tagging result and the condition word to obtain a plurality of single-condition short sentences; All the single-condition short sentences are relationship / attribute word extracted to obtain all condition words and relationship / attribute words; The current state answer is strategy processed to obtain a question and answer result of a multi-round dialogue, and state backtracking is performed based on the question and answer result of the multi-round dialogue to update the dialogue history state. The question category of the question information comprises a knowledge graph question and answer question and a multi-condition joint query question. The current state answer is strategy processed as follows: 2.The knowledge graph based multi-round dialogue method according to claim 1, characterized in that, 3.The knowledge graph based multi-round dialogue method according to claim 1, characterized in that, The current state answer is checked. If there is an entity or a conditional word in the question sentence information, but no answer, a question containing the entity or the conditional word is returned. If there is an answer, the current state answer is directly returned as the question and answer result of the multi-round dialogue; State rollback is performed based on the question and answer result of the multi-round dialogue to maintain management of the dialogue history state information.
4. A multi-turn dialogue system based on a knowledge graph, characterized in that, The system comprises: a question sentence acquisition unit, configured to acquire question sentence information and query dialogue history state information according to the question sentence information; a question sentence classification unit, configured to perform intent recognition on the question sentence information in a deep learning and syntax analysis manner to acquire a question sentence category; The process of performing intent recognition on the question sentence information in a deep learning and syntax analysis manner is as follows: a BERT-based classifier model is used to classify the question sentence information to acquire a first attribute classification result; a dependency syntax analyzer is used to classify the question sentence information to acquire a second attribute classification result; a weight value is used to weight the first attribute classification result and the second attribute classification result to acquire the question sentence category; a classification question and answer unit, configured to perform intent question and answer on the question sentence information based on the question sentence category and state tracking of the dialogue history state information to acquire a current state answer; The process of performing intent question and answer on the question sentence information based on the question sentence category and state tracking of the dialogue history state information is as follows: if the question sentence category of the question sentence information is a knowledge graph question and answer question, the question sentence information is classified, entity recognition, entity linking and simple query are performed based on state tracking of the dialogue history state information to acquire the current state answer; The process of classifying, entity recognition, entity linking and simple query of the question sentence information based on state tracking of the dialogue history state information is as follows: a deep learning manner is used to perform binary classification on the question sentence information to obtain a triple classification result; a deep learning manner is used to perform entity recognition on the question sentence information or the dialogue history state information to obtain an entity; a knowledge graph manner is used to perform entity linking on the entity to obtain an entity linking result; a deep learning manner is used to perform similarity analysis on the entity linking result to obtain an answer triple; a simple query of a graph database is performed based on the answer triple to obtain the current state answer; if the question sentence category of the question sentence information is a multi-condition joint query question, syntax analysis, condition division, relationship / attribute extraction and joint query are performed on the question sentence information based on state tracking of the dialogue history state information to acquire the current state answer; The process of performing syntax analysis, condition division, relationship / attribute extraction and joint query on the question sentence information based on state tracking of the dialogue history state information is as follows: a syntax analysis manner is used to perform syntax analysis on the question sentence information to obtain a part-of-speech tagging result, and a deep learning manner is used to perform conditional word recognition on the question sentence information or the dialogue history state information to obtain a conditional word; the question sentence information is divided into a plurality of single-condition short sentences based on the part-of-speech tagging result and the conditional word; relationship / attribute word extraction is performed on all single-condition short sentences to obtain all condition words and relationship / attribute words; joint query of the graph database is performed based on all condition words and relationship / attribute words to obtain a current state answer; a strategy processing unit is configured to perform strategy processing on the current state answer to obtain a question and answer result of the multi-round dialogue, and perform state rollback based on the question and answer result of the multi-round dialogue to update a dialogue history state.
5. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The processor implements the knowledge graph-based multi-round dialogue method in any one of claims 1-3 when executing the computer program.
6. A computer-readable storage medium, characterized in that, The computer readable storage medium stores the computer program, and the computer program is executed by the processor to implement the knowledge graph-based multi-round dialogue method in any one of claims 1-3.
Citation Information
Patent Citations
Cross-domain multi-round dialogue method based on knowledge graph and implementation system
CN112364147A
Replay generation strategy method and system of question and answer robot based on knowledge graph
CN116450855A