An intelligent question-answering system combining conflict and dispute knowledge graph

By combining the knowledge map of conflicts and disputes with a large language model, the problem of insufficient knowledge coverage and answer accuracy of the intelligent question and answer system in the field of conflicts and disputes is solved, accurate and natural answers are achieved, and the user experience is improved.

CN118586505BActive Publication Date: 2024-10-18DATA SPACE RES INST
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411069975.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-10-18
Estimated Expiration
2044-08-06

AI Technical Summary

Technical Problem

When dealing with conflicts and disputes, existing intelligent question-and-answer systems have limited knowledge coverage, insufficient answer accuracy and relevance, and lack of deep semantic understanding and reasoning capabilities, making it difficult to provide accurate and natural solutions.

Method used

Combining the conflict dispute knowledge graph and a large language model, through intent recognition and entity recognition, targeted query operations are triggered, information is retrieved in the knowledge graph, and the query results are converted into responses in the form of natural language.

Benefits of technology

It improves the user experience, can accurately understand user intentions and key information, provides accurate answers and natural and smooth answers, and enhances the accuracy and relevance of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118586505B_ABST
    Figure CN118586505B_ABST
Patent Text Reader

Abstract

The present invention discloses an intelligent question-answering system combined with a contradiction and dispute knowledge graph, including a reading module for reading input questions and historical question-answering data; a contradiction and dispute knowledge graph module for storing structured contradiction and dispute data; a general question answering module for answering general questions that do not require querying the contradiction and dispute knowledge graph; a graph query recognition module for determining whether the input question needs to query the contradiction and dispute knowledge graph; an intention recognition module for determining which information in the contradiction and dispute knowledge graph needs to be queried for the input question; an entity recognition module for obtaining the query subject of the input question; a trigger action module for storing trigger actions corresponding to different intentions; and a graph query result optimization module for converting the structured contradiction and dispute knowledge graph query results into the form of natural language as output. The present invention provides users with accurate answers and solutions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent question answering technology, and in particular to an intelligent question answering system combined with a conflict and dispute knowledge graph. Background Art

[0002] With the development and progress of society, the frequency and complexity of conflicts and disputes are increasing, and traditional manual processing methods can no longer meet the needs of efficiency and accuracy. In the existing technology, the handling of conflicts and disputes mainly relies on the experience and knowledge of manual mediators. This method is not only time-consuming and labor-intensive, but also requires extremely high professional quality and work experience of mediators. When dealing with complex conflicts and disputes, manual mediators often need to consult a large amount of case materials and laws and regulations, analyze the statements of the conflicting parties, and formulate mediation plans. This process is time-consuming and inefficient. In addition, due to the limitations of the mediator's personal knowledge and experience, the accuracy and fairness of the processing results are difficult to guarantee.

[0003] With the development of artificial intelligence technology, intelligent question-answering systems have been widely used in various fields. However, existing intelligent question-answering systems still have many shortcomings when dealing with problems in the field of conflicts and disputes. First, most existing systems are based on general knowledge bases, lack in-depth understanding of professional knowledge in the field of conflicts and disputes, and find it difficult to provide accurate answers. Second, when dealing with complex and open-ended questions, existing question-answering systems often find it difficult to accurately understand the user's intentions, resulting in low relevance and accuracy of answers. In addition, the answers of existing systems are mostly based on simple retrieval and matching, lack deep semantic understanding and reasoning capabilities, and find it difficult to provide targeted solutions.

[0004] In response to the above problems, some improvement plans have been proposed in the prior art. For example, some intelligent question-answering systems have begun to introduce domain knowledge graphs, which store knowledge in the field in a structured way to improve the accuracy and authority of the system's answers. However, these systems still have some shortcomings. First, the construction and maintenance of knowledge graphs require a lot of manpower and time costs, and the coverage and depth of knowledge graphs also have certain limitations. Secondly, when using knowledge graphs for question and answer, existing systems often rely on simple queries and retrievals, and lack a deep understanding and reasoning ability of user questions. In addition, existing systems also have certain shortcomings in answer generation. The naturalness and fluency of the answers need to be improved, and it is difficult to meet user needs.

[0005] In summary, when dealing with issues in the field of conflicts and disputes, the intelligent question-answering systems in the prior art have the defects of limited knowledge coverage, insufficient answer accuracy and relevance, and lack of deep semantic understanding and reasoning capabilities. Summary of the invention

[0006] One purpose of the present invention is to propose an intelligent question-answering system combined with a knowledge graph of contradictions and disputes. The present invention understands user questions through natural language processing technology, and combines relevant information in the knowledge graph to provide users with accurate answers and solutions.

[0007] An intelligent question-answering system combined with a conflict and dispute knowledge graph according to an embodiment of the present invention includes:

[0008] The reading module is used to read the input questions and historical question and answer data;

[0009] The conflict and dispute knowledge graph module is used to store structured conflict and dispute data. The conflict and dispute knowledge graph contains information about the people and institutions involved in the conflict and dispute.

[0010] The general question answering module is used to answer general questions that do not require querying the conflict and dispute knowledge graph;

[0011] The graph query recognition module is used to determine whether the input question needs to query the conflict and dispute knowledge graph;

[0012] Intent recognition module, used to determine what information in the conflict and dispute knowledge graph needs to be queried for the input question;

[0013] Entity recognition module, used to obtain the query body of the input question;

[0014] The trigger action module is used to store the trigger actions corresponding to different intentions. When a trigger action is activated, the corresponding query statement will be executed to query the conflict and dispute knowledge graph;

[0015] The graph query result optimization module is used to convert the structured conflict and dispute knowledge graph query results into natural language as output.

[0016] Optionally, modules can be connected via the following methods:

[0017] S1. Collect and clean question-and-answer data in the field of conflicts and disputes;

[0018] S2. Based on the contradiction and dispute knowledge graph and related application scenarios, determine the types of contradiction and dispute knowledge graph query intents, and implement the contradiction and dispute knowledge graph query actions corresponding to each intent type;

[0019] S3, constructing a total training data set based on the collected question-answering data in the field of conflicts and disputes;

[0020] S4. Based on the constructed training data set, the large model is fine-tuned using the low-rank adaptation method. After the fine-tuning is completed, the low-rank adaptation weights of each sub-function are merged into the large model;

[0021] S5. For input questions, the graph query recognition function is used to determine whether a knowledge graph query of contradictions and disputes is required. For questions that do not require a knowledge graph query of contradictions and disputes, they will be passed to the big model for general knowledge question and answer processing. For questions that require a knowledge graph query of contradictions and disputes, the intent recognition function is used to identify the specific query intent, and then the entity recognition function is used to obtain the specific query subject. The obtained query intent is mapped to the graph query action, and the query subject is brought into the query action to complete the query of the knowledge graph of contradictions and disputes. Finally, the query results are converted into natural language responses through the big model.

[0022] Optionally, S1 includes the following specific steps:

[0023] S11. Extracting initial seed question data based on real question-answering business scenarios:

[0024] ;

[0025] in, represents the initial seed question dataset, represents the i-th seed problem, represents the answer corresponding to the i-th seed question, and n is the number of seed questions;

[0026] S12: For the collected seed question data, remove the same or similar question-answer pairs, calculate the similarity matrix of the question-answer pairs through the string matching algorithm, and use the threshold To filter:

[0027] ;

[0028] ;

[0029] in, Indicates seed problem and seed issues The similarity between them, m is the number of words in the question, is the similarity function, This is the seed question dataset after deduplication;

[0030] S13. For the deduplicated seed question data, use natural language processing technology to identify and remove irrelevant, noisy or invalid question-answer pairs:

[0031] ;

[0032] ;

[0033] in, Representation problem The validity judgment function, This is the seed problem dataset after removing invalid data;

[0034] S14. Use the GPT-4 large model to perform data enhancement on the seed question data and generate multiple extended question-answer pairs similar to the seed question:

[0035] ;

[0036] ;

[0037] in, Indicates seed-based problem The generated extended question-answer pair set, and They represent the question and answer in the extended question-answer pair, m is the number of extended question-answer pairs, This is the enhanced seed question dataset;

[0038] S15. Finalize the enhanced seed question data to form a complete question-answering dataset in the field of conflicts and disputes:

[0039] ;

[0040] in, It represents the final question-answering dataset in the field of contradictions and disputes, including the effective seed question-answer pairs after deduplication and the enhanced extended question-answer pairs.

[0041] Optionally, S2 includes the following specific steps:

[0042] S21. Extracting the type of initial query intent based on the data content of the conflict and dispute knowledge graph and the types of issues involved in relevant application scenarios;

[0043] S22. For each query intent, define a specific query action;

[0044] S23. Construct a query statement template based on the entities and relationships in the conflict and dispute knowledge graph;

[0045] S24. In actual application, according to the semantics of the input question, the corresponding query intent is matched and the corresponding query action is selected;

[0046] S25, generating a final query statement according to the matched query intent and the selected query action;

[0047] S26. Use the generated query statement to query the conflict and dispute knowledge graph to obtain the corresponding query results.

[0048] Optionally, S3 includes the following specific steps:

[0049] S31, Question-Answering Dataset Based on Conflicts and Disputes Construct the total training dataset, which includes graph query recognition training dataset, intent recognition training dataset and entity recognition training dataset:

[0050] ;

[0051] in, represents the total training data set;

[0052] S32, constructing a graph query recognition training data set for training a graph query recognition module;

[0053] ;

[0054] in, represents the graph query recognition training dataset, Indicates whether the i-th seed question requires a graph query label, 1 means yes, 0 means no;

[0055] S33, constructing an intent recognition training data set for training an intent recognition module;

[0056] ;

[0057] in, represents the intent recognition training dataset, represents the intention label of the i-th seed question, and T represents the set of all intention labels;

[0058] S34, constructing an entity recognition training data set for training an entity recognition module;

[0059] ;

[0060] in, represents the entity recognition training dataset, represents the entity label in the i-th seed question, and E represents the set of all entity labels;

[0061] S35. In the constructed training data set, all data are expressed in the form of (q, a).

[0062] Optionally, S4 includes the following specific steps:

[0063] S41. Identify training data sets based on graph query , Intent recognition training dataset and entity recognition training dataset , design and improve the LoRA method to fine-tune the large model;

[0064] S42. Introduce multiple layers of nested low-rank adaptation layers in the large model. Each nested low-rank adaptation layer includes task-specific nested low-rank adaptation matrices A and B and shared basis matrices U and V, defined as:

[0065] ;

[0066] ;

[0067] in, and is the nested low-rank adaptation matrix specific to the l-th layer task, is the task-specific weight matrix for the lth layer, is the transposed matrix of the task-specific weight matrix of the lth layer, and is the low-rank basis matrix shared by the lth layer;

[0068] S43. Encode the text of the input question in multiple levels, and each level of encoding enhances the semantic representation of word embedding:

[0069] ;

[0070] in, represents the word embedding matrix of the lth layer, X represents the embedding representation of the text sequence, represents the embedding function of the lth layer, which is used to convert the input text X into a word embedding representation;

[0071] S44. Add hierarchical position information to each word embedding so that the large model understands the multi-level position of words in the sentence:

[0072] ;

[0073] ;

[0074] Among them, pos represents the position of word embedding, i represents the dimension index, and d represents the embedding dimension. represents the word embeddings at even positions, Represent word embeddings at odd positions;

[0075] S45. Use the multi-level word embedding representation and multi-level position encoding as the input of the large model:

[0076] ;

[0077] S46. In each Transformer layer of the large model, a hierarchical attention mechanism is used to calculate the multi-level attention scores of each word embedding and other word embeddings in the sequence, and an improved nested low-rank adaptation matrix is ​​introduced and Add to the hierarchical attention module of the large model to adjust the parameters of the large model:

[0078] ;

[0079] in, , , denote the query, key, and value matrices of layer l, respectively. represents the dimension of the key vector;

[0080] S47. In the feedforward network, the parameters are fine-tuned at multiple levels using nested low-rank adaptation layers. The feedforward network is represented as follows:

[0081] ;

[0082] in, , represents the weight matrix of the l-th layer feedforward network, , Indicates bias;

[0083] S48, using adaptive multi-layer learning rate algorithm for nested low-rank matrices and Update and adaptively adjust the learning rate of each layer:

[0084] ;

[0085] ;

[0086] in, represents the task-specific adaptive learning rate of the lth layer, represents the loss function;

[0087] S49. During the training process, the original network model structure is kept unchanged, and only the nested low-rank matrix is and Perform training, initialization phase, nested low-rank matrix Initialize with random Gaussian distribution, nested low-rank matrix Initialize to an all-zero matrix;

[0088] S410: Merge the trained graph query recognition LoRA parameters, intent recognition LoRA parameters, entity recognition LoRA parameters with the large model at multiple levels, and increase the capabilities of each sub-function while keeping the basic capabilities of the large model unchanged:

[0089] ;

[0090] in, It represents the parameters of the final large model after the merger, including the basic parameters of the large model and the multi-level fine-tuning parameters of each sub-functional module. Task represents the specific sub-functional task, and l represents the level.

[0091] Optionally, the S5 specifically includes:

[0092] For an input question, the graph query recognition function is used to determine whether the input question needs to query the conflict and dispute knowledge graph. If it is determined that the input question does not need to query the knowledge graph, the input question is combined with the preset prompt words and input into the big model. The preset prompt words are used to ensure that the answer of the big model is limited to the field of conflict and dispute. The output of the big model is the answer to the input question;

[0093] If it is determined that the input question needs to query the knowledge graph, the intent recognition function is used to determine which information in the knowledge graph needs to be queried, and the entity recognition function is used to extract the query subject of the input question. Each query intent corresponds to a trigger action, which is specifically manifested as a query statement of the knowledge graph. In the query statement, the query subject part is set to a blank slot, and the query subject obtained through the entity recognition function will be filled into the blank slot to complete the query statement. The query statement is used to query the knowledge graph to obtain the contradiction and dispute information in the knowledge graph, and the large model is used to convert the structured contradiction and dispute information into natural language form as the answer to the input question.

[0094] The beneficial effects of the present invention are:

[0095] The present invention utilizes the professional knowledge graph of conflicts and disputes, introduces a large language model, performs intent recognition and entity recognition on input questions, triggers targeted query operations, retrieves required information in the knowledge graph, and inputs the query results into the language model. The model automatically generates responses in natural language form, which can not only accurately understand the user's intentions and key information and provide precise answers, but also generate natural and fluent answers to improve user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0096] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0097] Figure 1 A method flow chart of an intelligent question-answering system combined with a knowledge graph of contradictions and disputes proposed by the present invention;

[0098] Figure 2 This is a system flow chart of an intelligent question-answering system combined with a knowledge graph of contradictions and disputes proposed by the present invention. DETAILED DESCRIPTION

[0099] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.

[0100] refer to Figure 1-2 , an intelligent question-answering system combined with a knowledge graph of contradictions and disputes, including:

[0101] The reading module is used to read the input questions and historical question and answer data;

[0102] The conflict and dispute knowledge graph module is used to store structured conflict and dispute data. The conflict and dispute knowledge graph contains information about the people and institutions involved in the conflict and dispute.

[0103] The general question answering module is used to answer general questions that do not require querying the conflict and dispute knowledge graph;

[0104] The graph query recognition module is used to determine whether the input question needs to query the conflict and dispute knowledge graph;

[0105] Intent recognition module, used to determine what information in the conflict and dispute knowledge graph needs to be queried for the input question;

[0106] Entity recognition module, used to obtain the query body of the input question;

[0107] The trigger action module is used to store the trigger actions corresponding to different intentions. When a trigger action is activated, the corresponding query statement will be executed to query the conflict and dispute knowledge graph;

[0108] The graph query result optimization module is used to convert the structured conflict and dispute knowledge graph query results into natural language as output.

[0109] In this implementation, the modules are implemented by the following method:

[0110] S1. Collect and clean question-and-answer data in the field of conflicts and disputes;

[0111] S2. Based on the contradiction and dispute knowledge graph and related application scenarios, determine the types of contradiction and dispute knowledge graph query intents, and implement the contradiction and dispute knowledge graph query actions corresponding to each intent type;

[0112] S3, constructing a total training data set based on the collected question-answering data in the field of conflicts and disputes;

[0113] S4. Based on the constructed training data set, the large model is fine-tuned using the low-rank adaptation method. After the fine-tuning is completed, the low-rank adaptation weights of each sub-function are merged into the large model;

[0114] S5. For input questions, the graph query recognition function is used to determine whether a knowledge graph query of contradictions and disputes is required. For questions that do not require a knowledge graph query of contradictions and disputes, they will be passed to the big model for general knowledge question and answer processing. For questions that require a knowledge graph query of contradictions and disputes, the intent recognition function is used to identify the specific query intent, and then the entity recognition function is used to obtain the specific query subject. The obtained query intent is mapped to the graph query action, and the query subject is brought into the query action to complete the query of the knowledge graph of contradictions and disputes. Finally, the query results are converted into natural language responses through the big model.

[0115] In this implementation, S1 includes the following specific steps:

[0116] S11. Extracting initial seed question data based on real question-answering business scenarios:

[0117] ;

[0118] in, represents the initial seed question dataset, represents the i-th seed problem, represents the answer corresponding to the i-th seed question, and n is the number of seed questions;

[0119] S12: For the collected seed question data, remove the same or similar question-answer pairs, calculate the similarity matrix of the question-answer pairs through the string matching algorithm, and use the threshold To filter:

[0120] ;

[0121] ;

[0122] in, Indicates seed problem and seed issues The similarity between them, m is the number of words in the question, is the similarity function, This is the seed question dataset after deduplication;

[0123] S13. For the deduplicated seed question data, use natural language processing technology to identify and remove irrelevant, noisy or invalid question-answer pairs:

[0124] ;

[0125] ;

[0126] in, Representation problem The validity judgment function, This is the seed problem dataset after removing invalid data;

[0127] S14. Use the GPT-4 large model to perform data enhancement on the seed question data and generate multiple extended question-answer pairs similar to the seed question:

[0128] ;

[0129] ;

[0130] in, Indicates seed-based problem The generated extended question-answer pair set, and They represent the question and answer in the extended question-answer pair, m is the number of extended question-answer pairs, This is the enhanced seed question dataset;

[0131] S15. Finalize the enhanced seed question data to form a complete question-answering dataset in the field of conflicts and disputes:

[0132] ;

[0133] in, It represents the final question-answering dataset in the field of contradictions and disputes, including the effective seed question-answer pairs after deduplication and the enhanced extended question-answer pairs.

[0134] In this implementation, S2 includes the following specific steps:

[0135] S21. Extracting the type of initial query intent based on the data content of the conflict and dispute knowledge graph and the types of issues involved in relevant application scenarios;

[0136] S22. For each query intent, define a specific query action;

[0137] S23. Construct a query statement template based on the entities and relationships in the conflict and dispute knowledge graph;

[0138] S24. In actual application, according to the semantics of the input question, the corresponding query intent is matched and the corresponding query action is selected;

[0139] S25, generating a final query statement according to the matched query intent and the selected query action;

[0140] S26. Use the generated query statement to query the conflict and dispute knowledge graph to obtain the corresponding query results.

[0141] In this implementation, the conflict and dispute knowledge graph is used as the information source, specific query actions are defined for different query intentions, and the multi-level encoding of the input question is represented as a query statement through multi-level position encoding and hierarchical attention mechanism. The query path based on the knowledge graph has good interpretability and can clearly show how the system infers the answer from the knowledge base. By filling the query subject into the blank slot of the query statement, the system can accurately retrieve relevant information in the knowledge graph, greatly improving the accuracy and relevance of the answer.

[0142] In this implementation, S3 includes the following specific steps:

[0143] S31, Question-Answering Dataset Based on Conflicts and Disputes Construct the total training dataset, which includes graph query recognition training dataset, intent recognition training dataset and entity recognition training dataset:

[0144] ;

[0145] in, represents the total training data set;

[0146] S32, constructing a graph query recognition training data set for training a graph query recognition module;

[0147] ;

[0148] in, represents the graph query recognition training dataset, Indicates whether the i-th seed question requires a graph query label, 1 means yes, 0 means no;

[0149] S33, constructing an intent recognition training data set for training an intent recognition module;

[0150] ;

[0151] in, represents the intent recognition training dataset, represents the intention label of the i-th seed question, and T represents the set of all intention labels;

[0152] S34, constructing an entity recognition training data set for training an entity recognition module;

[0153] ;

[0154] in, represents the entity recognition training dataset, represents the entity label in the i-th seed question, and E represents the set of all entity labels;

[0155] S35. In the constructed training data set, all data are expressed in the form of (q, a).

[0156] In this implementation, S4 includes the following specific steps:

[0157] S41. Identify training data sets based on graph query , Intent recognition training dataset and entity recognition training dataset , design and improve the LoRA method to fine-tune the large model;

[0158] S42. Introduce multiple layers of nested low-rank adaptation layers in the large model. Each nested low-rank adaptation layer includes task-specific nested low-rank adaptation matrices A and B and shared basis matrices U and V, defined as:

[0159] ;

[0160] ;

[0161] in, and is the nested low-rank adaptation matrix specific to the l-th layer task, is the task-specific weight matrix for the lth layer, is the transposed matrix of the task-specific weight matrix of the lth layer, and is the low-rank basis matrix shared by the lth layer;

[0162] S43. Encode the text of the input question in multiple levels, and each level of encoding enhances the semantic representation of word embedding:

[0163] ;

[0164] in, represents the word embedding matrix of the lth layer, X represents the embedding representation of the text sequence, represents the embedding function of the lth layer, which is used to convert the input text X into a word embedding representation;

[0165] S44. Add hierarchical position information to each word embedding so that the large model understands the multi-level position of words in the sentence:

[0166] ;

[0167] ;

[0168] Among them, pos represents the position of word embedding, i represents the dimension index, and d represents the embedding dimension. represents the word embeddings at even positions, Represent word embeddings at odd positions;

[0169] S45. Use the multi-level word embedding representation and multi-level position encoding as the input of the large model:

[0170] ;

[0171] The present invention significantly enhances the transparency and credibility of system decisions through a query path based on a knowledge graph and a hierarchical attention mechanism. Users can clearly understand how the system identifies intent and extracts entities from input questions, and performs the entire process of querying and generating answers through the knowledge graph, thereby increasing users' trust in the system's answers.

[0172] S46. In each Transformer layer of the large model, a hierarchical attention mechanism is used to calculate the multi-level attention scores of each word embedding and other word embeddings in the sequence, and an improved nested low-rank adaptation matrix is ​​introduced and Add to the hierarchical attention module of the large model to adjust the parameters of the large model:

[0173] ;

[0174] in, , , denote the query, key, and value matrices of layer l, respectively. represents the dimension of the key vector;

[0175] Introducing an improved nested low-rank adaptation matrix in each Transformer layer of the large model enables the system to generate natural language answers based on the query results. The combination of multi-level word embedding representation and multi-level position encoding enables the system to take into account the multi-level position relationship of words in a sentence when generating answers, and the generated answers are more natural and fluent. In addition, the nested low-rank matrix is ​​updated using an adaptive multi-layer learning rate algorithm to ensure that the model can maintain high-quality natural language output when generating answers, greatly improving the readability and user-friendliness of the answers.

[0176] S47. In the feedforward network, the parameters are fine-tuned at multiple levels using nested low-rank adaptation layers. The feedforward network is represented as follows:

[0177] ;

[0178] in, , represents the weight matrix of the l-th layer feedforward network, , Indicates bias;

[0179] S48, using adaptive multi-layer learning rate algorithm for nested low-rank matrices and Update and adaptively adjust the learning rate of each layer:

[0180] ;

[0181] ;

[0182] in, represents the task-specific adaptive learning rate of the lth layer, represents the loss function;

[0183] S49. During the training process, the original network model structure is kept unchanged, and only the nested low-rank matrix is and Perform training, initialization phase, nested low-rank matrix Initialize with random Gaussian distribution, nested low-rank matrix Initialize to an all-zero matrix;

[0184] S410: Merge the trained graph query recognition LoRA parameters, intent recognition LoRA parameters, entity recognition LoRA parameters with the large model at multiple levels, and increase the capabilities of each sub-function while keeping the basic capabilities of the large model unchanged:

[0185] ;

[0186] in, It represents the parameters of the final large model after the merger, including the basic parameters of the large model and the multi-level fine-tuning parameters of each sub-functional module. Task represents the specific sub-functional task, and l represents the level.

[0187] In this implementation, a large language model is fine-tuned using a low-rank adaptation method, and is trained specifically for data in the field of conflicts and disputes. By constructing a graph query recognition training data set, an intent recognition training data set, and an entity recognition training data set, and introducing a multi-layer nested low-rank adaptation layer in the large model, each nested layer includes a task-specific adaptation matrix and a shared base matrix, so that the system can accurately identify the intent and key information of the user's input question, which not only improves the system's ability to understand complex and open-ended questions, but also can quickly locate relevant knowledge graph content through the entity recognition function, avoiding the retrieval of invalid data.

[0188] In this implementation, S5 specifically includes:

[0189] For an input question, the graph query recognition function is used to determine whether the input question needs to query the conflict and dispute knowledge graph. If it is determined that the input question does not need to query the knowledge graph, the input question is combined with the preset prompt words and input into the big model. The preset prompt words are used to ensure that the answer of the big model is limited to the field of conflict and dispute. The output of the big model is the answer to the input question;

[0190] If it is determined that the input question needs to query the knowledge graph, the intent recognition function is used to determine which information in the knowledge graph needs to be queried, and the entity recognition function is used to extract the query subject of the input question. Each query intent corresponds to a trigger action, which is specifically manifested as a query statement of the knowledge graph. In the query statement, the query subject part is set to a blank slot, and the query subject obtained through the entity recognition function will be filled into the blank slot to complete the query statement. The query statement is used to query the knowledge graph to obtain the contradiction and dispute information in the knowledge graph, and the large model is used to convert the structured contradiction and dispute information into natural language form as the answer to the input question.

[0191] Embodiment 1:

[0192] A mediation center in a certain city receives a large number of conflict and dispute cases every day. These cases cover a wide range of areas, including marriage and family, neighborhood disputes, labor disputes, etc. Due to the increasing complexity and number of cases, traditional manual mediation methods can no longer meet the needs. In order to improve the efficiency of mediation, the mediation center decided to introduce an intelligent question-and-answer system combined with the conflict and dispute knowledge graph. The system can automatically analyze the questions entered by users, identify the intent and key entities, query the conflict and dispute knowledge graph, and generate accurate and natural answers.

[0193] In this scenario, we will demonstrate how to apply the intelligent question-answering method of the present invention to handle a neighborhood dispute case.

[0194] A resident, Mr. Li, submitted a question to the mediation center: "My neighbor often makes noise in the middle of the night, affecting my rest. What should I do?" The staff of the mediation center entered this question into the intelligent question-and-answer system, and the system began to process it.

[0195] First, the system determines whether the problem requires a query of the conflict and dispute knowledge graph based on the graph query recognition function. The system recognizes that this is a noise nuisance problem related to a neighborhood dispute through the intent recognition function. Then, the system extracts the key entities "neighbors", "making noise in the middle of the night", and "affecting my rest" through the entity recognition function.

[0196] The system maps this information to the knowledge graph query action and generates a query statement: "Query noise nuisance cases and related laws and regulations in neighborhood disputes." Then, the system searches the knowledge graph of conflicts and disputes and obtains a series of relevant cases and legal provisions.

[0197] The system inputs the query results into the big model and generates a natural language response: "According to the Environmental Noise Pollution Prevention and Control Law, citizens have the right to demand that noise pollution be stopped. You can communicate with your neighbors first. If the problem cannot be solved, you can report it to the local environmental protection department or community committee. If necessary, you can resolve it through legal means."

[0198] In order to demonstrate the feasibility and effectiveness of the present invention, we demonstrated the training process of an intelligent question-answering method for a specific conflict and dispute knowledge graph.

[0199] First, collect and clean the question-answering data in the field of conflicts and disputes to form the initial seed question dataset \(D_s\). For example:

[0200] Question: What should I do if my neighbors often make noise in the middle of the night?

[0201] Answer: You can communicate with your neighbors first. If the problem cannot be solved, you can report it to the local environmental protection department or community committee. If necessary, you can resolve it through legal means.

[0202] Next, the collected seed question data is deduplicated to remove identical or similar question-answer pairs to ensure the uniqueness and validity of the data.

[0203] Then, we use natural language processing technology to enhance the data of the seed questions after deduplication to generate more high-quality question-answer pairs. We use the GPT-4 large model to generate extended question-answer pairs similar to the seed questions:

[0204] Question: My neighbor is always making loud noises at night, what should I do?

[0205] Answer: You can try to communicate with your neighbors. If the problem persists, you can file a complaint with the local environmental protection department or seek legal help.

[0206] On this basis, graph query recognition training datasets, intent recognition training datasets and entity recognition training datasets are constructed, which are used to train the system's graph query recognition module, intent recognition module and entity recognition module respectively.

[0207] For example, graph query recognition training dataset:

[0208] Question: What should I do if my neighbors often make noise in the middle of the night?

[0209] Tags: 1 (need graph query);

[0210] Intent recognition training dataset:

[0211] Question: What should I do if my neighbors often make noise in the middle of the night?

[0212] Tags: noise nuisance;

[0213] Entity recognition training dataset:

[0214] Question: What should I do if my neighbors often make noise in the middle of the night?

[0215] Tags: Neighbors, making noise in the middle of the night, disturbing my rest;

[0216] Based on these training data sets, the LoRA method is used to fine-tune the large model, and a multi-layer nested low-rank adaptation layer is introduced, so that the system can accurately identify the intention and key information of the user's input questions.

[0217] During the fine-tuning training of the large model, the hyperparameters of LoRA, such as learning rate, batch_size, number of training rounds, etc., are set, and multiple iterations of training are performed to ensure that each task objective is fully trained. All LoRA weights are merged with the large model weights through the PEFT method to form the final intelligent question-answering system.

[0218] In order to demonstrate the beneficial effects of the present invention, we conducted an experimental comparison to compare the performance of the method of the present invention and the traditional method in handling conflict and dispute issues.

[0219] The experiment was conducted in a certain city mediation center from January to June 2023, at the intelligent question-answering system laboratory of the mediation center.

[0220] The dataset includes 1,000 real conflict and dispute issues, divided into a training set and a test set, with 500 issues in each set.

[0221] Traditional method: average answer time: 15 minutes, answer accuracy: 75%, user satisfaction: 70%;

[0222] The method of the present invention: average answering time: 2 minutes, answering accuracy: 90%, user satisfaction: 85%;

[0223] Through the above comparative data, it can be seen that the method of the present invention is superior to the traditional method in terms of answering time, answering accuracy and user satisfaction, which proves the feasibility and effectiveness of the present invention in dealing with contradictions and disputes.

[0224] The present invention utilizes the professional knowledge graph of conflicts and disputes, introduces a large language model, performs intent recognition and entity recognition on input questions, triggers targeted query operations, retrieves required information in the knowledge graph, and inputs the query results into the language model. The model automatically generates responses in natural language form, which can not only accurately understand the user's intentions and key information and provide precise answers, but also generate natural and fluent answers to improve user experience.

[0225] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. An intelligent question-answering system combined with a knowledge graph of contradictions and disputes, characterized in that: include: The reading module is used to read the input questions and historical question and answer data; The conflict and dispute knowledge graph module is used to store structured conflict and dispute data. The conflict and dispute knowledge graph contains information about the people and institutions involved in the conflict and dispute. The general question answering module is used to answer general questions that do not require querying the conflict and dispute knowledge graph; The graph query recognition module is used to determine whether the input question needs to query the conflict and dispute knowledge graph; Intent recognition module, used to determine what information in the conflict and dispute knowledge graph needs to be queried for the input question; Entity recognition module, used to obtain the query body of the input question; The trigger action module is used to store the trigger actions corresponding to different intentions. When a trigger action is activated, the corresponding query statement will be executed to query the conflict and dispute knowledge graph; The graph query result optimization module is used to convert the structured conflict knowledge graph query results into natural language as output; The modules are implemented in the following ways: S1. Collect and clean question-and-answer data in the field of conflicts and disputes; S2. Based on the contradiction and dispute knowledge graph and related application scenarios, determine the types of contradiction and dispute knowledge graph query intents, and implement the contradiction and dispute knowledge graph query actions corresponding to each intent type; S3, constructing a total training data set based on the collected question-answering data in the field of conflicts and disputes; S4. Based on the constructed training data set, the large model is fine-tuned using the low-rank adaptation method. After the fine-tuning is completed, the low-rank adaptation weights of each sub-function are merged into the large model; S5. For the input questions, the graph query recognition function is used to determine whether a conflict and dispute knowledge graph query is required. For questions that do not require a conflict and dispute knowledge graph query, they will be passed to the big model for general knowledge question answering. For questions that require a conflict and dispute knowledge graph query, the intent recognition function is used to identify the specific query intent, and then the entity recognition function is used to obtain the specific query subject. The obtained query intent is mapped to the graph query action, and the query subject is brought into the query action to complete the query of the conflict and dispute knowledge graph. Finally, the query results are converted into natural language responses through the big model. The S4 comprises the following specific steps: S41. Identify training data sets based on graph query , Intent recognition training dataset and entity recognition training dataset , design and improve the LoRA method to fine-tune the large model; S42. Introduce multiple layers of nested low-rank adaptation layers in the large model. Each nested low-rank adaptation layer includes the nested low-rank adaptation matrices A and B of the task and the shared basis matrices U and V, which are defined as: ; ; in, and is the nested low-rank adaptation matrix of the l-th layer task, is the task weight matrix of the lth layer, is the transposed matrix of the l-th layer task weight matrix, and is the low-rank basis matrix shared by the lth layer; S43. Encode the text of the input question in multiple levels, and each level of encoding enhances the semantic representation of word embedding: ; in, represents the word embedding matrix of the lth layer, X represents the embedding representation of the text sequence, represents the embedding function of the lth layer, which is used to convert the input text X into a word embedding representation; S44. Add hierarchical position information to each word embedding so that the large model understands the multi-level position of words in the sentence: ; ; Among them, pos represents the position of word embedding, i represents the dimension index, and d represents the embedding dimension. represents the word embeddings at even positions, Represent word embeddings at odd positions; S45. Use the multi-level word embedding representation and multi-level position encoding as the input of the large model: ; S46. In each Transformer layer of the large model, a hierarchical attention mechanism is used to calculate the multi-level attention scores of each word embedding and other word embeddings in the sequence, and an improved nested low-rank adaptation matrix is ​​introduced and Add to the hierarchical attention module of the large model to adjust the parameters of the large model: ; in, , , denote the query, key, and value matrices of layer l, respectively. represents the dimension of the key vector; S47. In the feedforward network, the parameters are fine-tuned at multiple levels using nested low-rank adaptation layers. The feedforward network is represented as follows: ; in, , represents the weight matrix of the l-th layer feedforward network, , Indicates bias; S48, using adaptive multi-layer learning rate algorithm for nested low-rank matrices and Update and adaptively adjust the learning rate of each layer: ; ; in, represents the adaptive learning rate of the l-th layer task, represents the loss function; S49. During the training process, the original network model structure is kept unchanged, and only the nested low-rank matrix is and Perform training, initialization phase, nested low-rank matrix Initialize with random Gaussian distribution, nested low-rank matrix Initialize to an all-zero matrix; S410: Merge the trained graph query recognition LoRA parameters, intent recognition LoRA parameters, entity recognition LoRA parameters with the large model at multiple levels, and increase the capabilities of each sub-function while keeping the basic capabilities of the large model unchanged: ; in, It represents the parameters of the final large model after the merger, including the basic parameters of the large model and the multi-level fine-tuning parameters of each sub-functional module. Task represents the specific sub-functional task, and l represents the level.

2. According to claim 1, an intelligent question-answering system combined with a knowledge graph of contradictions and disputes is characterized in that: The S1 comprises the following specific steps: S11. Extracting initial seed question data based on real question-answering business scenarios: ; in, represents the initial seed question dataset, represents the i-th seed problem, represents the answer corresponding to the i-th seed question, and n is the number of seed questions; S12: For the collected seed question data, remove the same or similar question-answer pairs, calculate the similarity matrix of the question-answer pairs through the string matching algorithm, and use the threshold To filter: ; ; in, Indicates seed problem and seed issues The similarity between them, m is the number of words in the question, is the similarity function, This is the seed question dataset after deduplication; S13. For the deduplicated seed question data, use natural language processing technology to identify and remove irrelevant, noisy or invalid question-answer pairs: ; ; in, Representation problem The validity judgment function, This is the seed problem dataset after removing invalid data; S14. Use the GPT-4 large model to perform data enhancement on the seed question data and generate multiple extended question-answer pairs similar to the seed question: ; ; in, Indicates seed-based problem The generated extended question-answer pair set, and They represent the question and answer in the extended question-answer pair, m is the number of extended question-answer pairs, This is the enhanced seed question dataset; S15. Finalize the enhanced seed question data to form a complete question-answering dataset in the field of conflicts and disputes: ; in, It represents the final question-answering dataset in the field of contradictions and disputes, including the effective seed question-answer pairs after deduplication and the enhanced extended question-answer pairs.

3. According to claim 2, an intelligent question-answering system combined with a knowledge graph of contradictions and disputes is characterized in that: The S2 comprises the following specific steps: S21. Extracting the type of initial query intent based on the data content of the conflict and dispute knowledge graph and the types of issues involved in relevant application scenarios; S22. For each query intent, define a specific query action; S23. Construct a query statement template based on the entities and relationships in the conflict and dispute knowledge graph; S24. In actual application, according to the semantics of the input question, the corresponding query intent is matched and the corresponding query action is selected; S25, generating a final query statement according to the matched query intent and the selected query action; S26. Use the generated query statement to query the conflict and dispute knowledge graph to obtain the corresponding query results.

4. According to claim 3, an intelligent question-answering system combined with a knowledge graph of contradictions and disputes is characterized in that: The S3 includes the following specific steps: S31, Question-Answering Dataset Based on Conflicts and Disputes Construct the total training dataset, which includes graph query recognition training dataset, intent recognition training dataset and entity recognition training dataset: ; in, represents the total training data set; S32, constructing a graph query recognition training data set for training a graph query recognition module; ; in, represents the graph query recognition training dataset, Indicates whether the i-th seed question requires a graph query label, 1 means yes, 0 means no; S33, constructing an intent recognition training data set for training an intent recognition module; ; in, represents the intent recognition training dataset, represents the intention label of the i-th seed question, and T represents the set of all intention labels; S34, constructing an entity recognition training data set for training an entity recognition module; ; in, represents the entity recognition training dataset, represents the entity label in the i-th seed question, and E represents the set of all entity labels; S35. In the constructed training data set, all data are expressed in the form of (q, a).

5. According to claim 4, an intelligent question-answering system combined with a knowledge graph of contradictions and disputes is characterized in that: The S5 specifically includes: For an input question, the graph query recognition function is used to determine whether the input question needs to query the conflict and dispute knowledge graph. If it is determined that the input question does not need to query the knowledge graph, the input question is combined with the preset prompt words and input into the big model. The preset prompt words are used to ensure that the answer of the big model is limited to the field of conflict and dispute. The output of the big model is the answer to the input question; If it is determined that the input question needs to query the knowledge graph, the intent recognition function is used to determine which information in the knowledge graph needs to be queried, and the entity recognition function is used to extract the query subject of the input question. Each query intent corresponds to a trigger action, which is specifically manifested as a query statement of the knowledge graph. In the query statement, the query subject part is set to a blank slot, and the query subject obtained through the entity recognition function will be filled into the blank slot to complete the query statement. The query statement is used to query the knowledge graph to obtain the contradiction and dispute information in the knowledge graph, and the large model is used to convert the structured contradiction and dispute information into natural language form as the answer to the input question.

Citation Information

Patent Citations

  • Legal consultation method based on knowledge graph enhancement

    CN118093829A