Question answering method and system based on knowledge graph, related equipment and program product
Through a question-answering method based on knowledge graph, semantic analysis and feedback information adjustment are used to dynamically optimize the knowledge graph, which solves the problem that traditional question-answering systems cannot be automatically updated, and achieves continuous optimization of the knowledge graph and improved accuracy of candidate answers.
Patent Information
- Application Number
- CN202410389543.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-01
- Publication Date
- 2025-10-21
AI Technical Summary
Traditional knowledge bases or question-and-answer systems are unable to achieve automatic updates and continuous optimization, resulting in poor intelligent interactivity and an inability to provide employees with rich and comprehensive enterprise-related knowledge.
The question-answering method based on knowledge graph semantically analyzes user query statements, performs knowledge matching and feedback information adjustment, dynamically optimizes the knowledge graph, and realizes automatic updating and continuous optimization.
It improves the richness and comprehensiveness of the knowledge graph, improves the accuracy of candidate answers and user satisfaction, and enhances the intelligent interactive capabilities of the question-answering system.
Smart Images

Figure CN120821791A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of natural language processing technology, and in particular to a question-answering method, system, related equipment and program product based on a knowledge graph. Background Art
[0002] Enterprises are increasingly demanding knowledge management for employee training and business processes. To facilitate employee access to relevant knowledge, they can access it through pre-built enterprise knowledge question-and-answer systems. However, traditional knowledge bases and question-and-answer systems are expensive to update and maintain, and lack the ability to automatically update and continuously optimize. This results in poor intelligent interactivity and an inability to provide employees with rich and comprehensive enterprise knowledge. Summary of the Invention
[0003] In view of this, the purpose of this application is to propose a question-answering method, system, related equipment and program product based on knowledge graph to solve the problem that the knowledge question-answering system cannot be automatically updated and continuously optimized.
[0004] Based on the above objectives, the first aspect of this application provides a question-answering method based on a knowledge graph, comprising:
[0005] In response to receiving a first query statement input by a user, performing semantic parsing on the first query statement to obtain a query entity;
[0006] Perform knowledge matching in a pre-built knowledge graph based on the query entity to obtain at least one candidate answer;
[0007] displaying at least one candidate answer and receiving feedback information from the user regarding the candidate answer;
[0008] The elements in the knowledge graph are adjusted according to the feedback information.
[0009] Optionally, the feedback information includes a second query statement and evaluation information for at least one candidate answer; and adjusting the elements in the knowledge graph according to the feedback information includes:
[0010] Performing semantic analysis on the first query statement and the second query statement, and adjusting elements in the knowledge graph according to the semantic analysis results;
[0011] The weights of the elements in the knowledge graph included in the candidate answer during knowledge matching are adjusted according to the evaluation information.
[0012] Optionally, adjusting the elements in the knowledge graph according to the semantic analysis results includes:
[0013] In response to the semantic analysis result including new information, adding new entities and / or relationships in the knowledge graph according to the new information;
[0014] In response to the semantic analysis result including difference information, the entities and / or relationships in the knowledge graph are corrected according to the difference information.
[0015] Optionally, adjusting the weights of elements in the knowledge graph included in the candidate answer during knowledge matching according to the evaluation information includes:
[0016] In response to the evaluation information being positive evaluation information, increasing the weight of the elements in the knowledge graph included in the candidate answer during knowledge matching;
[0017] In response to the evaluation information being negative evaluation information, the weight of the elements in the knowledge graph included in the candidate answer during knowledge matching is reduced.
[0018] Optionally, the method for constructing the knowledge graph includes:
[0019] Collect text data from target knowledge sources;
[0020] Extracting structured data from the text data using a pre-trained language model;
[0021] Performing entity recognition and relationship extraction on the structured data to establish entity-relationship triples;
[0022] Knowledge fusion is performed on the entity relationship triples to construct the knowledge graph.
[0023] The second aspect of the present application further provides a question-answering system based on a knowledge graph, wherein the system architecture of the question-answering system includes, from top to bottom:
[0024] An interactive interface layer, configured to receive a first inquiry statement and feedback information input by a user, and to display at least one candidate answer corresponding to the first inquiry statement; wherein the feedback information is input by the user based on the at least one candidate answer;
[0025] The knowledge learning layer is used to analyze the feedback information and adjust the elements in the knowledge graph according to the feedback information;
[0026] An application service layer, configured to perform semantic parsing on the first query statement to obtain a query entity, and perform knowledge matching in a pre-built knowledge graph based on the query entity to obtain at least one candidate answer;
[0027] The knowledge processing layer is used to perform entity recognition and relationship extraction on structured data, establish entity-relationship triples, perform knowledge fusion on the entity-relationship triples, and construct the knowledge graph;
[0028] The knowledge acquisition layer is used to collect text data from the target knowledge source and extract the structured data from the text data using a pre-trained language model;
[0029] The basic layer is used to provide the infrastructure for the question-answering system.
[0030] Optionally, the application service layer is further configured to sort at least one candidate answer according to a preset rule.
[0031] Optionally, the feedback information includes a second query statement and evaluation information for at least one candidate answer; and adjusting the elements in the knowledge graph according to the feedback information includes:
[0032] Performing semantic analysis on the first query statement and the second query statement, and adjusting elements in the knowledge graph according to the semantic analysis results;
[0033] The weights of the elements in the knowledge graph included in the candidate answer during knowledge matching are adjusted according to the evaluation information.
[0034] Optionally, adjusting the elements in the knowledge graph according to the semantic analysis results includes:
[0035] In response to the semantic analysis result including new information, adding new entities and / or relationships in the knowledge graph according to the new information;
[0036] In response to the semantic analysis result including difference information, the entities and / or relationships in the knowledge graph are corrected according to the difference information.
[0037] Optionally, adjusting the weights of elements in the knowledge graph included in the candidate answer during knowledge matching according to the evaluation information includes:
[0038] In response to the evaluation information being positive evaluation information, increasing the weight of the elements in the knowledge graph included in the candidate answer during knowledge matching;
[0039] In response to the evaluation information being negative evaluation information, the weight of the elements in the knowledge graph included in the candidate answer during knowledge matching is reduced.
[0040] Optionally, the base layer includes a pre-trained language model server, and the pre-trained language model server is used to load the pre-trained language model.
[0041] Optionally, the system architecture of the question-answering system is a microservice architecture.
[0042] The third aspect of the present application further provides a question-answering device based on a knowledge graph, comprising:
[0043] a parsing module configured to, in response to receiving a first query statement input by a user, perform semantic parsing on the first query statement to obtain a query entity;
[0044] A matching module is configured to perform knowledge matching in a pre-built knowledge graph according to the query entity to obtain at least one candidate answer;
[0045] a display module configured to display at least one candidate answer and receive feedback information from the user regarding the candidate answer;
[0046] An adjustment module is configured to adjust the elements in the knowledge graph according to the feedback information.
[0047] The fourth aspect of the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable by the processor, wherein the processor implements the method described in the first aspect when executing the computer program.
[0048] The fifth aspect of the present application further provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the method described in the first aspect.
[0049] The sixth aspect of the present application further provides a computer program product, comprising computer program instructions, which, when executed on a computer, cause the computer to execute the method as described in the first aspect.
[0050] As can be seen from the above, the question-answering method, system, related equipment and program product based on the knowledge graph provided by the present application include: in response to receiving a first query statement input by a user, performing semantic parsing on the first query statement, determining the user's query intention and extracting keywords through semantic parsing to obtain the query entity. According to the query entity, knowledge matching is performed in a pre-constructed knowledge graph, and the knowledge graph elements related to or similar to the query entity are queried through the knowledge graph to obtain at least one candidate answer. At least one candidate answer is displayed, and feedback information from the user on the candidate answer is received. The user can further conduct question-answering interactions based on the displayed candidate answer, and obtain a candidate answer with higher satisfaction through multiple rounds of question-answering. According to the feedback information, the elements in the knowledge graph are adjusted. The feedback information can reflect the user's satisfaction with the candidate answer or the accuracy of the candidate answer. According to the feedback information, the elements in the knowledge graph are adjusted in a timely manner, which can achieve the optimization of the knowledge graph. By continuously correcting the knowledge graph during the interaction process, the richness and comprehensiveness of the knowledge graph are improved, thereby improving the accuracy of the candidate answer recommendation. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in this application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are merely embodiments of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0052] Figure 1 Schematic diagram of the process of the question-answering method based on the knowledge graph according to an embodiment of the present application;
[0053] Figure 2 This is a schematic diagram of the knowledge graph-based question-answering system architecture of an embodiment of the present application;
[0054] Figure 3 This is a schematic diagram of the structure of a question-answering device based on a knowledge graph according to an embodiment of the present application;
[0055] Figure 4 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the objectives, technical solutions and advantages of this application more clear, this application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0057] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should have the usual meanings understood by people with ordinary skills in the field to which this application belongs. The "first", "second" and similar words used in the embodiments of the present application do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0058] As described in the background technology, in order to facilitate employees to understand enterprise-related knowledge, building an enterprise knowledge question-and-answer system can help employees quickly acquire enterprise-related knowledge. However, traditional knowledge bases or question-and-answer systems cannot be automatically updated. If there is an update to the knowledge base, a large amount of manpower is required to upgrade and maintain the question-and-answer system, resulting in high maintenance costs. At the same time, traditional question-and-answer systems have weak intelligent interaction capabilities and are unable to adjust recommended answers in real time based on user feedback, resulting in low user satisfaction with recommended answers, and in turn, low knowledge utilization. In view of this, the present application proposes a question-and-answer method, system, related equipment and program product based on a knowledge graph, which uses user feedback information on recommended answers to supplement and correct the knowledge graph in a timely manner, so as to provide users with recommended answers with higher accuracy and improve user satisfaction. The question-and-answer system based on the knowledge graph adopts a microservice architecture to realize the automatic extraction of knowledge, so that the knowledge graph can continue to evolve and improve the richness and comprehensiveness of the knowledge graph.
[0059] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0060] This application proposes a question-answering method based on knowledge graph, which is applied to the client. Figure 1 A flow chart of the question-answering method based on knowledge graph is shown in FIG. Figure 1 As shown in Figure 2, the question answering method based on knowledge graph includes the following steps:
[0061] Step 102: In response to receiving a first query statement input by a user, semantically parse the first query statement to obtain a query entity.
[0062] Specifically, the first query statement is a natural language statement, and the first query statement includes the content that the user needs to inquire about. The user can input the first query statement in voice mode or in text mode on the client. After the client receives the first query statement, it parses the first query statement through a semantic parsing method, and performs feature extraction and classification on the first query statement during the parsing process to obtain a query entity. The query entity can be an entity word in the first query statement, or an entity word that is synonymous with the entity in the first query statement. The query entity is a keyword corresponding to the user's query intention obtained after the user's query intention is determined based on semantic parsing. Semantic parsing can be combined with deep learning methods. The deep semantic parsing method can accurately determine the user's query intention and then determine the accurate query entity.
[0063] Step 104: Perform knowledge matching in a pre-built knowledge graph based on the query entity to obtain at least one candidate answer.
[0064] Specifically, the knowledge graph in this embodiment is pre-constructed based on a knowledge source, which may be an enterprise knowledge source, such as an employee manual, business process documents, etc. After the query entity is determined, knowledge matching is performed in the knowledge graph based on the query entity, and entities or relationships similar to the query entity are queried in the knowledge graph. The queried entities or relationships are organized into natural language sentences and recommended to the user as candidate answers. There can be one or more candidate answers, which are determined based on the queried entities or relationships. Before recommending at least one candidate answer to the user, the candidate answers can also be sorted according to the similarity between the entity, relationship and the query entity, and the candidate answers with higher similarity are recommended to the user to improve the user's satisfaction with the candidate answers.
[0065] Step 106: Display at least one candidate answer, and receive feedback information from the user regarding the candidate answer.
[0066] Specifically, at least one candidate answer is displayed on a client's human-computer interaction interface. The user reviews the candidate answer and enters feedback based on the candidate answer. For example, the feedback information may include the user's evaluation of the at least one candidate answer, where the user may rate the candidate answer based on its accuracy. The feedback information may also include a second query statement from the user regarding the at least one candidate answer. The second query statement is a further inquiry based on the first query statement, and may be a refinement of the first query statement in some respect. If the candidate answer is incorrect, the query method may be adjusted and the query content may be redefined to obtain the second query statement.
[0067] Step 108: Adjust the elements in the knowledge graph according to the feedback information.
[0068] Specifically, after receiving user feedback, the elements in the knowledge graph can be adjusted based on the feedback, such as supplementing or correcting entities or relationships in the knowledge graph, to further improve the content included in the knowledge graph, enhance the richness and comprehensiveness of the knowledge graph, and help improve the accuracy of candidate answer determination. This embodiment continuously optimizes the knowledge graph through multiple rounds of questions and answers with users, thereby achieving continuous updating of the knowledge graph.
[0069] Based on the above steps 102 to 108, it can be seen that this embodiment provides a question-answering method based on a knowledge graph, which includes, in response to receiving a first query statement input by a user, performing semantic parsing on the first query statement, and determining the user's query intention and extracting keywords through semantic parsing to obtain a query entity. According to the query entity, knowledge matching is performed in a pre-constructed knowledge graph, and knowledge graph elements related to or similar to the query entity are queried through the knowledge graph to obtain at least one candidate answer. At least one candidate answer is displayed, and feedback information from the user regarding the candidate answer is received. The user can further interact with the displayed candidate answer, and obtain a candidate answer with higher satisfaction through multiple rounds of question and answer. According to the feedback information, the elements in the knowledge graph are adjusted. The feedback information can reflect the user's satisfaction with the candidate answer or the accuracy of the candidate answer. The elements in the knowledge graph are adjusted in a timely manner according to the feedback information, so as to achieve optimization of the knowledge graph. By continuously correcting the knowledge graph during the interaction process, the accuracy of the candidate answer recommendation can be improved.
[0070] By optimizing the knowledge graph through user feedback information, the expressive ability of the knowledge graph and the effect of question-answer matching can be continuously improved. The following describes the optimization method of the knowledge graph through specific examples.
[0071] In some embodiments, the feedback information includes a second query statement and evaluation information for at least one candidate answer; and adjusting the elements in the knowledge graph according to the feedback information includes:
[0072] Performing semantic analysis on the first query statement and the second query statement, and adjusting elements in the knowledge graph according to the semantic analysis results;
[0073] The weights of the elements in the knowledge graph included in the candidate answer during knowledge matching are adjusted according to the evaluation information.
[0074] Specifically, the feedback information includes a second query statement and / or evaluation information. The second query statement is a further query statement input by the user based on the candidate answer. It can be a refinement of the first query statement or a correction statement of the first query statement. The evaluation information is the user's evaluation of the candidate answer, including positive evaluation information and negative evaluation information. If it is positive evaluation information, it means that the user is highly satisfied with the candidate answer. If it is negative evaluation information, it means that the user is less satisfied with the candidate answer. For different feedback information, different adjustments need to be made to the elements in the knowledge graph.
[0075] When the feedback information includes a second query statement, the difference information between the first query statement and the second query statement is analyzed, and the elements in the knowledge graph are adjusted according to the difference information, that is, the entities or relationships in the knowledge graph are adjusted, such as adding or deleting entities or relationships, or correcting entities or relationships, so as to improve and enrich the knowledge graph and enhance the richness and comprehensiveness of the knowledge graph.
[0076] When the feedback information contains evaluation information, the weights of the elements in the knowledge graph during knowledge matching are adjusted based on the evaluation information. During the knowledge matching process, the query entity and the elements in the knowledge graph are converted into feature vectors respectively, and the elements of the knowledge graph that match the query entity are determined by calculating the similarity between the feature vectors. The query entity may have a high degree of matching with the elements of multiple knowledge graphs. At this time, it is necessary to determine which element to select as the element that matches the query entity based on the weights corresponding to the elements of the knowledge graph. Normally, the element with the largest weight is used as the element that matches the query entity, or all elements with weights exceeding a certain preset threshold are used as elements that match the query entity. The determination of the element weight is adjusted based on the evaluation information. If the evaluation information reflects that the user's satisfaction is high, the element weight is increased. If the evaluation information reflects that the user's satisfaction is low, the element weight is reduced. By adjusting the weights of the elements in the knowledge graph based on the feedback information, the question-answer matching effect of the knowledge graph can be further improved.
[0077] The following describes a method for adjusting elements in a knowledge graph based on semantic analysis results through a specific embodiment.
[0078] In some embodiments, adjusting the elements in the knowledge graph according to the semantic analysis results includes:
[0079] In response to the semantic analysis result including new information, adding new entities and / or relationships in the knowledge graph according to the new information;
[0080] In response to the semantic analysis result including difference information, the entities and / or relationships in the knowledge graph are corrected according to the difference information.
[0081] Specifically, when the feedback information includes a second query statement, a semantic analysis is performed on the first query statement and the second query statement to determine the difference between the second query statement and the first query statement, and a semantic analysis result is obtained. If the semantic analysis result contains new information, it means that the second query statement contains content that is not included in the first query statement. Then, it is determined whether the entity or relationship contained in the new information exists in the knowledge graph. If not, a new entity or relationship can be added to the knowledge graph based on the new information to supplement and improve the knowledge graph. If the semantic analysis result contains difference information, it means that the second query statement contains the entity in the first query statement, but the relationship between the entities is different and there is a difference. Then, it is determined whether the relationship corresponding to the entity in the knowledge graph is the same as the relationship corresponding to the entity in the difference information. If different, the entities and / or relationships in the knowledge graph are corrected according to the difference information, such as correcting the wrong relationship between entities, or deleting some entities or the relationship between entities. In the question-answering interaction method of this embodiment, the current knowledge graph can be optimized by the information carried in the multiple rounds of query statements provided by the user, thereby improving the accuracy and comprehensiveness of the knowledge graph and making the question-answering process more intelligent.
[0082] The following describes a method for adjusting the weights of elements in a knowledge graph based on evaluation information through an embodiment.
[0083] In some embodiments, adjusting the weight of elements in the knowledge graph included in the candidate answer during knowledge matching according to the evaluation information includes:
[0084] In response to the evaluation information being positive evaluation information, increasing the weight of the elements in the knowledge graph included in the candidate answer during knowledge matching;
[0085] In response to the evaluation information being negative evaluation information, the weight of the elements in the knowledge graph included in the candidate answer during knowledge matching is reduced.
[0086] Specifically, when the knowledge graph is used for knowledge matching for the first time, the weight of each element in the knowledge graph can be initialized to the same value. Afterwards, the weight of each element is continuously revised based on the evaluation information fed back by the user each time. When the evaluation information is positive evaluation information, it means that the user is highly satisfied with the candidate answer, and the corresponding weight of the element of the knowledge graph contained in the candidate answer is increased; when the evaluation information is negative evaluation information, it means that the user is less satisfied with the candidate answer, and the corresponding weight of the element of the knowledge graph contained in the candidate answer is reduced. In the subsequent knowledge matching process, elements with higher weights will be matched first to form candidate answers to provide to users. By continuously adjusting the weights of the elements in the knowledge graph in this embodiment, the knowledge matching process can be made more in line with the needs of users, in line with the user's inquiry intentions, and provide users with candidate answers with higher satisfaction.
[0087] The knowledge graph in this application is pre-constructed, and the specific construction method is described below through examples.
[0088] In some embodiments, the method for constructing the knowledge graph includes:
[0089] Collect text data from target knowledge sources;
[0090] Extracting structured data from the text data using a pre-trained language model;
[0091] Performing entity recognition and relationship extraction on the structured data to establish entity-relationship triples;
[0092] Knowledge fusion is performed on the entity relationship triples to construct the knowledge graph.
[0093] Specifically, the target knowledge source can be an enterprise knowledge source, including employee manuals, business FAQs or business process documents. Specifically, various customized knowledge sources can be collected through crawlers or integrated enterprise content management systems. After collecting text data from the target knowledge source, the text data is preprocessed. The preprocessing includes using natural language processing technology to clean the text, extract sentences and segment words, etc., to convert unstructured text into structured text, which facilitates the construction of the knowledge graph. Furthermore, the extraction of structured data can be achieved through a pre-trained language model. Structured knowledge extraction is to convert unstructured text data into structured knowledge representation, which enables people to more easily understand, search and utilize the information in the text. The basis of structured knowledge extraction is language processing and natural language processing technology, including lexical analysis, grammatical analysis, named entity recognition, etc. These technologies can convert text data into a form that can be processed by computers, providing a basis for subsequent knowledge extraction. Exemplarily, the pre-trained language model can be a BERT (Bidirectional Encoder Representations from Transformers) model.
[0094] After obtaining structured data, entity recognition and relationship extraction are performed on the structured data. Entity recognition refers to identifying named entities with specific meanings from text, such as people, places, and organizations. Relationship extraction refers to discovering relationships between entities in text, such as X produces Y, X is located in Y, and so on. By using machine learning algorithms and automatic annotation technology, entities and their relationships can be extracted from structured data to establish entity-relationship triples. Knowledge fusion is performed based on entity-relationship triples, and triplets extracted from different knowledge sources are unified and connected in the same knowledge graph. Entities and relationships are modeled through the knowledge graph's link network. A knowledge graph is a graphical data structure used to represent entities, relationships, and attributes. It can clearly display the associations and hierarchical relationships between entities. By constructing a knowledge graph, knowledge can be better organized and queried.
[0095] It should be noted that after constructing the knowledge graph based on entity-relationship triples, reasoning and expansion can be performed based on the structured knowledge of the knowledge graph to obtain more derivative knowledge. The reasoning of the knowledge graph mainly revolves around the reasoning of relationships, that is, inferring unknown facts or relationships based on existing facts or relationships in the graph, generally focusing on the characteristic information of entities, relationships, and graph structure. Specifically, knowledge graph reasoning can mainly assist in the reasoning of new facts, new relationships, new axioms, and new rules. Through knowledge graph reasoning, the comprehensiveness of the knowledge graph can be further improved and the coverage of knowledge can be expanded.
[0096] This application also provides a question-answering system based on knowledge graph. Figure 2 The following diagram shows the architecture of a knowledge graph-based question-answering system. The system utilizes a microservices architecture and modular design, making it customizable, scalable, and maintainable. Modules communicate using an API (Application Programming Interface). A microservices architecture is a distributed architecture that decomposes functionality into discrete services, reducing system coupling and providing more flexible service support. The system architecture of the question-answering system, from top to bottom, includes:
[0097] An interactive interface layer, configured to receive a first inquiry statement and feedback information input by a user, and to display at least one candidate answer corresponding to the first inquiry statement; wherein the feedback information is input by the user based on the at least one candidate answer;
[0098] The knowledge learning layer is used to analyze the feedback information and adjust the elements in the knowledge graph according to the feedback information;
[0099] An application service layer, configured to perform semantic parsing on the first query statement to obtain a query entity, and perform knowledge matching in a pre-built knowledge graph based on the query entity to obtain at least one candidate answer;
[0100] The knowledge processing layer is used to perform entity recognition and relationship extraction on structured data, establish entity-relationship triples, perform knowledge fusion on the entity-relationship triples, and construct the knowledge graph;
[0101] The knowledge acquisition layer is used to collect text data from the target knowledge source and extract the structured data from the text data using a pre-trained language model;
[0102] The basic layer is used to provide the infrastructure for the question-answering system.
[0103] like Figure 2 As shown, the question-answering system includes, from top to bottom, an interactive interface layer, a knowledge learning layer, an application service layer, a knowledge processing layer, a knowledge acquisition layer, and a basic layer. The interactive interface layer is used to provide an interactive interface for users, through which users conduct multiple rounds of question-answering interactions with the question-answering system. The interactive interface layer includes a natural language input module and an answer display module. The natural language input module receives the first query statement and feedback information input by the user, and the answer display module displays at least one candidate answer corresponding to the first query statement. The first query statement is a natural language statement, and the first query statement includes the content that the user needs to inquire about. The user inputs the first query statement through the interactive interface, and the input method can be voice input or text input. The feedback information is input by the user based on the at least one candidate answer. The feedback information may include the user's evaluation feedback on the at least one candidate answer. The user may score the candidate answer based on whether it is accurate to form evaluation feedback; the feedback information may also include the user's second inquiry statement for the at least one candidate answer. The second inquiry statement is a further inquiry based on the first inquiry statement. It may be a refinement of the first inquiry statement in a certain aspect, or when the candidate answer is wrong, the inquiry method may be adjusted and the inquiry content may be re-determined to obtain the second inquiry statement.
[0104] The knowledge learning layer includes a user feedback analysis module and a knowledge graph optimization module. The user feedback analysis module analyzes feedback information, and the knowledge graph optimization module adjusts elements in the knowledge graph based on the analysis results of the user feedback analysis module. For example, entities or relationships in the knowledge graph can be supplemented or modified to further improve the content included in the knowledge graph, enhance the richness and comprehensiveness of the knowledge graph, and help improve the accuracy of candidate answer selection.
[0105] The application service layer includes a semantic parsing module, a knowledge matching module and a dialogue management module. The semantic parsing module is used to perform semantic parsing on the first query statement to obtain a query entity, and the knowledge matching module is used to perform knowledge matching in a pre-built knowledge graph based on the query entity to obtain at least one candidate answer. The dialogue management module manages the entire question-and-answer dialogue process, including multiple rounds of interaction, answer sorting and optimization, etc. Before recommending at least one candidate answer to the user, the candidate answers can also be sorted according to the similarity between the entity relationship and the query entity, and candidate answers with higher similarity can be recommended to the user to improve the user's satisfaction with the candidate answers. The dialogue management module can also be used to access external business knowledge bases to enhance the logic of question and answer.
[0106] The knowledge processing layer includes a knowledge identification module and a knowledge fusion module. The knowledge identification module is used to perform entity recognition and relationship extraction on structured data. The knowledge fusion module is used to establish entity relationship triples based on the identified entities and relationships, perform knowledge fusion on the entity relationship triples, and construct the knowledge graph.
[0107] The knowledge acquisition layer includes a knowledge extraction module, a knowledge source management module, and a knowledge import system docking module. The knowledge import system docking module is used to collect text data from the target knowledge source. The target knowledge source can be an enterprise knowledge source, including an employee manual, business FAQs, or business process documents. The knowledge extraction module is used to call a pre-trained language model to extract the structured data from the text data, wherein the text data is unstructured data. Through knowledge extraction, the enterprise's amorphous knowledge can be continuously acquired to form a customized enterprise knowledge graph to provide support for subsequent knowledge questions and answers. The knowledge source management module is used to manage various business knowledge sources, including maintenance, classification, and statistics of knowledge sources.
[0108] The basic layer is used to provide infrastructure for the question-answering system, and each infrastructure includes network connection devices, network storage devices, central processing units (CPUs), graphics processing units (GPUs), and the like. Furthermore, the basic layer includes a pre-trained language model server, which is used to load the pre-trained language model, and the pre-trained language model is used to extract structured data from unstructured knowledge. The pre-trained language model can be deployed based on TensorFlow Serving, which is a high-performance open source library for machine learning model services. It can deploy the trained machine learning model online and use an interface to accept external calls.
[0109] The knowledge graph-based question-and-answer system provided in this embodiment utilizes an open microservices architecture. Through customized knowledge collection and representation, it can continuously acquire internal enterprise knowledge, construct a customized knowledge graph tailored to the enterprise, and expand knowledge coverage. It provides users with a question-and-answer interactive interface. Through multiple rounds of question-and-answer and user feedback mechanisms, it implements a knowledge optimization cycle, continuously improves knowledge representation and question-and-answer quality, and enhances the intelligence of the question-and-answer system. Furthermore, different functional modules can be designed based on enterprise needs to better serve internal knowledge management and improve the efficiency of internal knowledge utilization.
[0110] In some embodiments, the feedback information includes a second query statement and evaluation information for at least one candidate answer; the knowledge graph optimization module is also used to perform semantic analysis on the first query statement and the second query statement, and adjust the elements in the knowledge graph according to the semantic analysis results; and adjust the weights of the elements in the knowledge graph contained in the candidate answer during knowledge matching according to the evaluation information.
[0111] Specifically, the feedback information includes a second query statement and evaluation information. The second query statement is a further query statement entered by the user based on the candidate answer. It can be a refinement of the first query statement or a correction statement of the first query statement. The evaluation information is the user's evaluation of the candidate answer, including positive evaluation information and negative evaluation information. If it is positive evaluation information, it means that the user is highly satisfied with the candidate answer. If it is negative evaluation information, it means that the user is less satisfied with the candidate answer. Different feedback information requires different adjustments to the elements in the knowledge graph.
[0112] When the feedback information includes a second query statement, the difference information between the first query statement and the second query statement is analyzed, and the elements in the knowledge graph are adjusted according to the difference information, that is, the entities or relationships in the knowledge graph are adjusted, such as adding or deleting entities or relationships, or correcting entities or relationships, so as to improve and enrich the knowledge graph and enhance the richness and comprehensiveness of the knowledge graph.
[0113] When the feedback information contains evaluation information, the weights of the elements in the knowledge graph during knowledge matching are adjusted based on the evaluation information. During the knowledge matching process, the query entity and the elements in the knowledge graph are converted into feature vectors respectively, and the elements of the knowledge graph that match the query entity are determined by calculating the similarity between the feature vectors. The query entity may have a high degree of matching with multiple knowledge graph elements. At this time, it is necessary to determine which element to select as the element that matches the query entity based on the weights corresponding to the elements of the knowledge graph. Normally, the element with the largest weight is used as the element that matches the query entity, or all elements with weights exceeding a certain preset threshold are used as elements that match the query entity. The determination of the element weight is adjusted based on the evaluation information. If the evaluation information reflects that the user's satisfaction is high, the element weight is increased. If the evaluation information reflects that the user's satisfaction is low, the element weight is reduced. By adjusting the weights of the elements in the knowledge graph based on the feedback information, the question-answer matching effect of the knowledge graph can be further improved.
[0114] In some embodiments, the knowledge graph optimization module is also used to, in response to the semantic analysis results including new information, add new entities and / or relationships in the knowledge graph according to the new information; in response to the semantic analysis results including difference information, correct the entities and / or relationships in the knowledge graph according to the difference information.
[0115] Specifically, when the feedback information includes a second query statement, a semantic analysis is performed on the first query statement and the second query statement to determine the difference between the second query statement and the first query statement, and a semantic analysis result is obtained. If the semantic analysis result contains new information, it means that the second query statement contains content that is not included in the first query statement. Then, it is determined whether the entity or relationship contained in the new information exists in the knowledge graph. If not, a new entity or relationship can be added to the knowledge graph based on the new information to supplement and improve the knowledge graph. If the semantic analysis result contains difference information, it means that the second query statement contains the entity in the first query statement, but the relationship between the entities is different and there is a difference. Then, it is determined whether the relationship corresponding to the entity in the knowledge graph is the same as the relationship corresponding to the entity in the difference information. If different, the entities and / or relationships in the knowledge graph are corrected according to the difference information, such as correcting the wrong relationship between entities, or deleting some entities or the relationship between entities. Through the interactive method in this embodiment, the current knowledge graph can be optimized through the information carried in the multiple rounds of query statements provided by the user, thereby improving the accuracy and comprehensiveness of the knowledge graph and making the question-answering process more intelligent.
[0116] In some embodiments, the knowledge graph optimization module is also used to increase the weight of the elements of the knowledge graph contained in the candidate answer during knowledge matching in response to the evaluation information being positive evaluation information; and to reduce the weight of the elements of the knowledge graph contained in the candidate answer during knowledge matching in response to the evaluation information being negative evaluation information.
[0117] Specifically, when the knowledge graph is used for knowledge matching for the first time, the weight of each element in the knowledge graph can be initialized to the same value. Afterwards, the weight of each element is continuously revised based on the evaluation information fed back by the user each time. When the evaluation information is positive evaluation information, it means that the user is highly satisfied with the candidate answer, and the corresponding weight of the knowledge graph element contained in the candidate answer is increased; when the evaluation information is negative evaluation information, it means that the user is less satisfied with the candidate answer, and the corresponding weight of the knowledge graph element contained in the candidate answer is reduced. In the subsequent knowledge matching process, elements with higher weights will be matched first to form candidate answers to provide to users. By continuously adjusting the weights of the elements in the knowledge graph in this embodiment, the knowledge matching process can be made more in line with the needs of users, in line with the user's inquiry intentions, and provide users with candidate answers with higher satisfaction.
[0118] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied in a distributed scenario and performed by multiple devices working together. In such a distributed scenario, one of the multiple devices may only perform one or more steps of the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the method.
[0119] It should be noted that the above description is limited to some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0120] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a question-answering device based on a knowledge graph.
[0121] refer to Figure 3 , the question-answering device based on knowledge graph includes:
[0122] The parsing module 302 is configured to, in response to receiving a first query statement input by a user, perform semantic parsing on the first query statement to obtain a query entity;
[0123] A matching module 304 is configured to perform knowledge matching in a pre-built knowledge graph according to the query entity to obtain at least one candidate answer;
[0124] A display module 306 is configured to display at least one candidate answer and receive feedback information from the user regarding the candidate answer;
[0125] The adjustment module 308 is configured to adjust the elements in the knowledge graph according to the feedback information.
[0126] In some embodiments, the feedback information includes a second query statement and evaluation information for at least one candidate answer; the adjustment module 308 is also configured to perform semantic analysis on the first query statement and the second query statement, and adjust the elements in the knowledge graph according to the semantic analysis results; and adjust the weight of the elements in the knowledge graph contained in the candidate answer during knowledge matching according to the evaluation information.
[0127] In some embodiments, the adjustment module 308 is further configured to, in response to the semantic analysis result including new information, add new entities and / or relationships in the knowledge graph according to the new information;
[0128] In response to the semantic analysis result including difference information, the entities and / or relationships in the knowledge graph are corrected according to the difference information.
[0129] In some embodiments, the adjustment module 308 is further configured to, in response to the evaluation information being positive evaluation information, increase the weight of the elements of the knowledge graph contained in the candidate answer during knowledge matching; and in response to the evaluation information being negative evaluation information, reduce the weight of the elements of the knowledge graph contained in the candidate answer during knowledge matching.
[0130] In some embodiments, a construction module is also included, which is configured to collect text data from a target knowledge source; extract structured data from the text data using a pre-trained language model; perform entity recognition and relationship extraction on the structured data to establish entity-relationship triples; and perform knowledge fusion on the entity-relationship triples to construct the knowledge graph.
[0131] For the convenience of description, the above devices are described as being divided into various modules according to their functions. Of course, when implementing this application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0132] The device of the above embodiment is used to implement the corresponding knowledge graph-based question-answering method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0133] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the program, the knowledge graph-based question-answering method described in any of the above embodiments is implemented.
[0134] Figure 4 10 is a schematic diagram showing a more specific hardware structure of an electronic device provided in this embodiment. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other within the device via the bus 1050.
[0135] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0136] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage devices, dynamic storage devices, etc. The memory 1020 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0137] The input / output interface 1030 is used to connect input / output modules to implement information input and output. The input / output modules can be configured as components within the device (not shown in the figure) or can be externally connected to the device to provide corresponding functions. Input devices may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and output devices may include a display, speaker, vibrator, indicator light, etc.
[0138] The communication interface 1040 is used to connect to a communication module (not shown) to enable communication between the device and other devices. The communication module can communicate via a wired method (such as USB, network cable, etc.) or a wireless method (such as mobile network, WiFi, Bluetooth, etc.).
[0139] The bus 1050 comprises a path for transmitting information between the various components of the device (eg, the processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 ).
[0140] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, it will be understood by those skilled in the art that the above device may only include the components necessary to implement the embodiments of this specification, and does not necessarily include all the components shown in the figure.
[0141] The electronic device of the above embodiment is used to implement the corresponding knowledge graph-based question-answering method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0142] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the knowledge graph-based question-answering method as described in any of the above embodiments.
[0143] The computer-readable media of this embodiment include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0144] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the knowledge graph-based question-answering method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0145] Based on the same concept, corresponding to any of the above-mentioned embodiments, the present application also provides a computer program product, including computer program instructions. When the computer program instructions are run on a computer, the computer executes the method described in any of the above embodiments, which has the beneficial effects of the corresponding method embodiments and will not be repeated here.
[0146] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. Within the scope of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0147] In addition, for simplicity of description and discussion, and in order not to make the embodiment of the application difficult to understand, the known power supply / ground connection with integrated circuit (IC) chip and other components may or may not be shown in the accompanying drawings provided. In addition, the device can be shown in the form of a block diagram to avoid making the embodiment of the application difficult to understand, and this also takes into account the following fact, that is, the details of the embodiment of these block diagram devices are highly dependent on the platform to be implemented in the embodiment of the application (that is, these details should be fully within the scope of understanding of those skilled in the art). When specific details (for example, circuit) are set forth to describe exemplary embodiments of the application, it will be apparent to those skilled in the art that the embodiment of the application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.
[0148] Although the present invention has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those skilled in the art based on the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may utilize the embodiments discussed.
[0149] The embodiments of the present application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of this application.
Claims
1. A question-answering method based on knowledge graph, characterized in that: include: In response to receiving a first query statement input by a user, performing semantic parsing on the first query statement to obtain a query entity; Perform knowledge matching in a pre-built knowledge graph based on the query entity to obtain at least one candidate answer; displaying at least one candidate answer and receiving feedback information from the user regarding the candidate answer; The elements in the knowledge graph are adjusted according to the feedback information.
2. The method according to claim 1, characterized in that The feedback information includes the second query statement and evaluation information for at least one candidate answer; and adjusting the elements in the knowledge graph according to the feedback information includes: Performing semantic analysis on the first query statement and the second query statement, and adjusting elements in the knowledge graph according to the semantic analysis results; The weights of the elements in the knowledge graph included in the candidate answer during knowledge matching are adjusted according to the evaluation information.
3. The method according to claim 2, characterized in that The adjusting of the elements in the knowledge graph according to the semantic analysis results includes: In response to the semantic analysis result including new information, adding new entities and / or relationships in the knowledge graph according to the new information; In response to the semantic analysis result including difference information, the entities and / or relationships in the knowledge graph are corrected according to the difference information.
4. The method according to claim 2, characterized in that The step of adjusting the weight of the elements in the knowledge graph included in the candidate answer during knowledge matching according to the evaluation information includes: In response to the evaluation information being positive evaluation information, increasing the weight of the elements in the knowledge graph included in the candidate answer during knowledge matching; In response to the evaluation information being negative evaluation information, the weight of the elements in the knowledge graph included in the candidate answer during knowledge matching is reduced.
5. The method according to claim 1, wherein The method for constructing the knowledge graph includes: Collect text data from target knowledge sources; Extracting structured data from the text data using a pre-trained language model; Performing entity recognition and relationship extraction on the structured data to establish entity-relationship triples; Knowledge fusion is performed on the entity relationship triples to construct the knowledge graph.
6. A question-answering system based on knowledge graph, characterized in that: The system architecture of the question-answering system includes the following from top to bottom: An interactive interface layer, configured to receive a first inquiry statement and feedback information input by a user, and to display at least one candidate answer corresponding to the first inquiry statement; wherein the feedback information is input by the user based on the at least one candidate answer; The knowledge learning layer is used to analyze the feedback information and adjust the elements in the knowledge graph according to the feedback information; An application service layer, configured to perform semantic parsing on the first query statement to obtain a query entity, and perform knowledge matching in a pre-built knowledge graph based on the query entity to obtain at least one candidate answer; The knowledge processing layer is used to perform entity recognition and relationship extraction on structured data, establish entity-relationship triples, perform knowledge fusion on the entity-relationship triples, and construct the knowledge graph; The knowledge acquisition layer is used to collect text data from the target knowledge source and extract the structured data from the text data using a pre-trained language model; The basic layer is used to provide the infrastructure for the question-answering system.
7. The system according to claim 6, characterized in that The application service layer is further configured to sort at least one candidate answer according to a preset rule.
8. The system according to claim 6, wherein: The feedback information includes the second query statement and evaluation information for at least one candidate answer; and adjusting the elements in the knowledge graph according to the feedback information includes: Performing semantic analysis on the first query statement and the second query statement, and adjusting elements in the knowledge graph according to the semantic analysis results; The weights of the elements in the knowledge graph included in the candidate answer during knowledge matching are adjusted according to the evaluation information.
9. The system according to claim 8, characterized in that The adjusting of the elements in the knowledge graph according to the semantic analysis results includes: In response to the semantic analysis result including new information, adding new entities and / or relationships in the knowledge graph according to the new information; In response to the semantic analysis result including difference information, the entities and / or relationships in the knowledge graph are corrected according to the difference information.
10. The system according to claim 8, wherein: The step of adjusting the weight of the elements in the knowledge graph included in the candidate answer during knowledge matching according to the evaluation information includes: In response to the evaluation information being positive evaluation information, increasing the weight of the elements in the knowledge graph included in the candidate answer during knowledge matching; In response to the evaluation information being negative evaluation information, the weight of the elements in the knowledge graph included in the candidate answer during knowledge matching is reduced.
11. The system according to claim 6, wherein: The basic layer includes a pre-trained language model server, and the pre-trained language model server is used to load the pre-trained language model.
12. The system according to claim 6, wherein: The system architecture of the question-answering system is a microservice architecture.
13. A question-answering device based on knowledge graph, characterized in that: include: a parsing module configured to, in response to receiving a first query statement input by a user, perform semantic parsing on the first query statement to obtain a query entity; A matching module is configured to perform knowledge matching in a pre-built knowledge graph according to the query entity to obtain at least one candidate answer; a display module configured to display at least one candidate answer and receive feedback information from the user regarding the candidate answer; An adjustment module is configured to adjust the elements in the knowledge graph according to the feedback information.
14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 5 is implemented.
15. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 5.
16. A computer program product comprising computer program instructions, characterized in that When the computer program instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Multi-round conversation interaction processing method, device, electronic equipment and storage medium
CN109616108A
Teaching field question-answering method based on knowledge graph
CN111143539A
Keyword Search Queries on Online Social Networks
US20160063093A1
Generating Answers to Questions Using Information Posted By Users on Online Social Networks
US20170206271A1