Intelligent question answering method and system based on knowledge graph
By structuring the knowledge graph data and building a community hierarchy, combined with the global search strategy of the GRAPHRAG algorithm, the problem that intelligent customer service system is difficult to efficiently handle complex queries is solved, and the effect of rapid response and efficient information integration is achieved.
Patent Information
- Application Number
- CN202411987607.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-08
AI Technical Summary
Existing intelligent customer service systems are difficult to efficiently handle complex queries and provide accurate information replies, and the index construction of knowledge graphs and global search strategies have problems such as time consumption and inefficiency.
By structuring the knowledge graph data, a node keyword list and entity keyword list are generated, and a community hierarchy is constructed. Combined with the global search strategy of the GRAPHRAG algorithm, a description of community key points is generated, and a personalized reply is finally generated based on user questions.
It significantly shortens the response time, improves user experience and system efficiency, and enhances the processing capabilities of complex information and the deep integration of multi-source information.
Smart Images

Figure CN119783830A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing technology, and in particular to an intelligent question-answering method and system based on a knowledge graph. Background Art
[0002] With the improvement of information technology, intelligent customer service systems play an increasingly important role in handling user inquiries. Existing intelligent customer service systems mostly rely on preset reply templates or simple keyword matching technology, which makes it difficult to handle complex queries or provide accurate information responses.
[0003] GRAPHRAG (Graph Retrieval-Augmented Generation) is an innovative framework that combines knowledge graphs and retrieval-augmented generation (RAG) technology. By introducing graph structure data processing technology, the model's ability to process complex information and relationships is significantly enhanced. This technology enables the generated text to better reflect the structural characteristics of the data, and is particularly suitable for scenarios that require deep understanding and integration of multi-source information.
[0004] However, during the index construction phase, the existing GRAPHRAG system must extract nodes, entities and their relationships from the text, and build a knowledge graph and form a community structure based on them. This is not only a time-consuming process, but also due to the openness and unrestricted nature of the knowledge graph, its scope of application is limited and cannot be widely promoted and used.
[0005] In addition, in the global search strategy it uses, the map phase needs to traverse each community at a specified level to generate an intermediate response; then in the reduce phase (the reduce phase is to aggregate and process the intermediate results output by the map phase to finally generate the required output results), the system must filter and aggregate the key elements in the intermediate response. This processing flow is not only time-consuming, but also in customer service systems that require extremely high response speeds, it may seriously affect user experience and system efficiency.
[0006] Therefore, it is necessary to design an intelligent question-answering method and system based on knowledge graph to solve the above technical problems. Summary of the invention
[0007] The present invention provides an intelligent question-answering method and system based on knowledge graph, which are used to solve the technical problems mentioned in the background technology.
[0008] To solve the above problems, the present invention provides the following technical solution: an intelligent question answering method based on knowledge graph, comprising the following steps: S1, obtain knowledge graph data from product database or knowledge management system, including dimension indicators, descriptive text blocks and hierarchical relationship data; S2, structures the knowledge graph data into node keyword lists and entity keyword lists; S3, sorting the structured node keyword list and entity keyword list to generate a relationship result table and a text result table; S4, based on the knowledge graph data, generates a community hierarchy, including community title, community summary, impact severity score, and score explanation; S5, combining knowledge graph data and community hierarchy, adopts the global search strategy of GRAPHRAG algorithm to generate descriptions of community key points; S6, extracting and classifying key information based on the questions input by the user; S7, retrieve relevant vectorized data from the relational result table and the text result table according to the user question, including nodes, community reports, text blocks, and Map results generated by the GRAPHRAG algorithm; S8, based on the Reduce phase of the GRAPHRAG algorithm, generates the final response in combination with the prompt word template.
[0009] Furthermore, in step S1, it includes: S101, obtain dimensional indicators, including product parameters, functional features and applicable scenarios; S102, extracting descriptive text blocks and recording the explanatory content of each dimension indicator; S103, obtaining hierarchical relationship data for defining the hierarchical relationship between nodes in the knowledge graph.
[0010] Furthermore, in step S2, it includes: S201, construct a node keyword list, extract dimension indicators in the knowledge graph as node keywords, and calculate the degree value of the node association; S202, constructing an entity keyword list, extracting entity keywords contained in the nodes, generating a unique identifier for each entity and classifying them by "place", "product", and "organization".
[0011] Furthermore, in step S3, it includes: S301, constructing a relationship result table, and adjusting the description content to an expression form suitable for the customer service system according to the node keyword list and the input dimension indicator definition; S302, constructing a text result table, extracting text content of all levels, and constructing a unified text result table; the text result table is organized by subject and level to facilitate rapid retrieval and association.
[0012] Furthermore, in step S4, it includes: S401: Generate community titles, extract titles based on core keywords and entity relationships in the community; S402: Generate a community summary to describe the overall structural information of the community; S403: Generate an impact severity score, giving a score from 0 to 10 based on the importance and relevance of nodes in the community; S404: Generate a scoring explanation to describe the basis of the scoring; S405: Extract key insights within the community and generate detailed discovery points.
[0013] Furthermore, in step S5, it includes: S501. Describe the key points of the community and generate a comprehensive description of each key point in the community to ensure that the content is accurate and detailed.
[0014] S502. Provide data support. Provide relevant data support for the key points listed, and attach cited reports or evidence as references.
[0015] S503. Give the importance scores of the key points, assigning an integer score between 0 and 100 to each key point.
[0016] Furthermore, in step S6, it includes: S601: Identify the user's emotional state and generate an emotional score, with the emotional range being 0 to 10; S602: extract consulting products involved in the user's question; S603: Classify the questions into chat and question-and-answer categories; S604: Identify the product category involved in the user's question; S605: Extract key content in the question context and generate a summary.
[0017] Furthermore, in step S8, it includes: S801: construct a data structure in SearchResult format to unify answer generation data; S802: Configure a fixed response strategy, including a preset script for answers without data; S803: Call the big model to generate a personalized reply, and adjust the tone and answer content according to the user's emotional state.
[0018] The present invention also provides an intelligent question-answering system based on knowledge graph, comprising the following modules: The knowledge acquisition module is used to obtain knowledge graph data from the product database or knowledge management system, including dimension indicators, descriptive text blocks, and hierarchical relationship data; A data structuring module, connected to the knowledge acquisition module, for structuring the knowledge graph data into a node keyword list and an entity keyword list; A data sorting module, connected to the data structuring module, is used to sort the structured node keyword list and entity keyword list to generate a relationship result table and a text result table; A community hierarchy generation module, connected to the data sorting module, for generating a community hierarchy structure based on the knowledge graph data, including a community title, a community summary, an impact severity score, and a score explanation; A community key point description module, connected to the community hierarchy generation module, is used to combine the knowledge graph data and the community hierarchy structure and adopt the global search strategy of the GRAPHRAG algorithm to generate a description of the community key points; User question processing module, used to receive questions input by users and extract key information for classification; A data retrieval module, connected to the user question processing module, is used to retrieve relevant vectorized data from the relationship result table and the text result table according to the user question, including nodes, community reports, text blocks and Map results generated by the GRAPHRAG algorithm; The reply generation module is connected to the data retrieval module and is used to generate a final reply based on the Reduce phase of the GRAPHRAG algorithm and in combination with the prompt word template.
[0019] Compared with the prior art, the present invention has at least the following beneficial effects: The present invention organizes the knowledge graph data into a clear keyword list through structured processing of nodes and entities, avoiding the cumbersome relationship extraction and community identification process in the traditional knowledge graph index construction; By constructing a community hierarchy, complex knowledge can be hierarchically summarized and key insights extracted, reducing the computational overhead of global search and significantly shortening the response time. By combining global search with the Reduce stage, we can achieve deep integration and comprehensive analysis of multi-source information, improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 is a flowchart of the steps of the intelligent question answering method based on the knowledge graph in an embodiment of the present invention; Figure 2 It is a structural diagram of an intelligent question-answering system based on a knowledge graph in an embodiment of the present invention. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the protection scope of the present invention. It is understood that the drawings are only provided for reference and explanation, and are not used to limit the present invention.
[0023] The present invention discloses an intelligent question-answering method based on a knowledge graph, which aims to solve the technical bottleneck of the existing intelligent customer service system that is difficult to efficiently process complex queries and accurately generate replies. Through the efficient construction of the knowledge graph, the organization of the community hierarchy, and the generation capability of a large model, the efficiency and accuracy of the intelligent question-answering system are significantly improved. The implementation method of the present invention is described in detail below in conjunction with specific embodiments.
[0024] Data vectorization stage: The main goal of the data vectorization stage is to convert the structured data in the knowledge graph into vectorized data of nodes, entities and their associations for subsequent processing, and to build a result table that supports the question-answering system, providing a basis for question retrieval and answer generation. The specific steps are as follows: See also Figure 1 , Step S1: Acquisition of knowledge graph data Based on the knowledge graph of existing products or systems, hierarchical data is obtained as input, including: Dimensional indicators in the knowledge graph (such as product parameters, usage scenarios, user reviews, etc.); A descriptive text block corresponding to each dimension indicator; Hierarchical relationship data is used to define the hierarchical relationship between nodes.
[0025] The input data is presented in a table or graph structure to ensure the integrity and clarity of the data.
[0026] Step S2: Text data structuring The knowledge graph data is further structured into node keyword lists and entity keyword lists for subsequent processing.
[0027] S201, build node keyword list Take the dimension indicators with text descriptions as nodes and generate a node keyword list; Add a "degree" column to each node to indicate the node's relevance. The degree value is calculated by counting the number of edges connecting the node. The more edges there are, the more important the node is. For example, the "core function" node of a product may be associated with multiple scenarios, and its degree value is higher, indicating that it is more important in the knowledge graph.
[0028] S202, build entity keyword list Extract entities based on the node list and generate an entity keyword list; Use the MD5 algorithm to generate a unique identification ID for each entity for subsequent retrieval and matching; Identify the specific type of entity, including but not limited to "place", "person", "organization" and other categories. For example, "Beijing" is marked as a "place" and "Zhang San" is marked as a "person".
[0029] Through the above steps, the structuring process from knowledge graph data to nodes and entities is preliminarily completed.
[0030] Step S3, result table construction The structured node keyword list and entity keyword list are further organized into relationship result table and text result table to facilitate subsequent retrieval and answer generation.
[0031] S301, build relationship result table According to the node keyword list and the input dimension indicator definition, adjust the description content to an expression form suitable for the customer service system. For example, adjust "applicable scenarios of product X" to "customer service provides customers with suggestions on applicable scenarios of product X"; Add a "Data Source" field to each record, fixed as "Customer Service" to highlight the source and credibility of the knowledge point; The relationship result table reflects the connections between nodes and their applicability to customer service scenarios.
[0032] S302, constructing a text result table Extract text content at all levels and build a unified text result table; The text result table is organized by topic and level for quick retrieval and association.
[0033] Step S4: Community hierarchy establishment Based on the knowledge graph data, a large language model (such as GPT) is used to generate a community hierarchy, including the community's title, summary, influence score, and key insights. The specific steps are as follows: S401. Generate community title Generate a short and specific title for each community. The title should contain representative named entities of the key entities of the community. For example, the title of a community could be "Performance and applicable scenarios of product X".
[0034] S402. Generate community summary Analyze the entity relationships in the community and generate a structural summary of the community as a whole; The summary includes the relationships between entities within the community, a functional description of the community, and the extraction of important information.
[0035] S403. Generate impact severity score According to the importance of entities in the community and their relationships, a floating point score between 0 and 10 is generated to indicate the importance and influence of the community; For example, a score of 9.5 indicates that the community involves multiple key entities and has a significant impact on the accuracy of the system's answers.
[0036] S404. Generate score explanation Generate a single sentence explanation of the impact severity score for easy subsequent reference; For example, “Rating 9.5: The community contains multiple highly connected nodes, involves core product functions, and has a wide range of influence.” S405. Combined detailed findings Distill 5 to 10 key insights from the community, each including a brief summary and detailed explanation; Detailed explanations are based on relationships between entities, data support, and contextual descriptions to ensure that the content is comprehensive and in-depth.
[0037] S5. Retrieval and data distribution Combining the node data and community hierarchy of the knowledge graph, the global search decision of the GRAPHRAG algorithm is used to determine the relevance of each community to the document or graph node in the map phase, and generate an answer containing a list of key points. The specific steps are as follows: S501. Describe the key points of the community Generate a comprehensive description of every key point in the community, ensuring that the content is accurate and detailed.
[0038] S502. Provide data support Provide relevant data to support the key points listed, and attach cited reports or evidence as references.
[0039] S503. Give the importance score of key points Assign an integer score between 0 and 100 to each key point to indicate its importance in answering the user's question. For example, a response of type "Key points lack relevant information" would be scored 0.
[0040] Question answer retrieval stage S6. Get user questions Analyze user questions, extract key information, and provide a basis for subsequent retrieval. Specifically include: S601. Customer emotion recognition Analyze the customer’s emotional state based on the content of the user’s question; The emotion rating ranges from 0 to 10, where 0 indicates extremely negative emotion, 5 indicates neutral emotion, and 10 indicates extremely positive emotion; If customer sentiment change values exist, analyze sentiment change trends based on the change values.
[0041] S602. Consultation product extraction Based on the question content and the preset product list, identify the specific products that the customer is currently inquiring about.
[0042] S603. Problem Classification According to the content of the questions, the questions are divided into two categories: Small talk: general conversations not related to the product; Question and answer category: involving specific issues such as product parameters, accessories, gifts, etc.
[0043] S604. Product category identification Determine the product category of the customer's inquiry based on the question content and contextual information.
[0044] S605. Contextual summary Extract key content from questions and contexts and generate summary information for background knowledge prompts.
[0045] S7. Vectorized data acquisition According to the information extracted from the user's question, the vectorized data of the corresponding community is retrieved from the result table, including nodes, community reports, text blocks, and Map stage results.
[0046] S8. Reply Generation Based on the Reduce phase of the GRAPHRAG algorithm, the final response is generated in combination with the prompt word template. Specifically, it includes: S801. Data construction SearchResult format The data obtained in step S7 is reorganized according to the format specified by SearchResult to ensure that the data can be directly used to generate answers.
[0047] S802. Configure fixed reply options Set the configuration items "NO_DATA_ANSWER" and "GENERAL_KNOWLEDGE_INSTRUCTION". NO_DATA_ANSWER is used to provide fixed words when the answer is not found in the knowledge graph; GENERAL_KNOWLEDGE_INSTRUCTION is used to supplement the answer content online. For intelligent customer service systems, usually only NO_DATA_ANSWER is enabled.
[0048] S803. Generate personalized responses Input customer questions, emotional states, background knowledge and scripts into prompt word templates, and call the big model to generate personalized, high-quality responses; Adjust your tone based on customer sentiment to ensure a friendly user experience.
[0049] The following is a specific example: Scene background: The question asked by the customer is: "Is product X suitable for use in high humidity environments?" Step S1: Acquisition of knowledge graph data Assume that there is a product knowledge graph containing the following data: Dimensional indicators: Core functions: waterproof performance, high humidity resistance Application scenarios: high humidity, outdoor, industrial environment Descriptive text block: Waterproof performance description: "Product X supports IP68 waterproof capability." High humidity resistance performance description: "Suitable for environments with humidity above 90%." Hierarchical relationship data: Node relationship: core function → usage scenario → high humidity.
[0050] Step S2: Text data structuring The nodes include "waterproof performance", "high humidity resistance", "high humidity", etc., and the following keyword list is generated, as shown in Table 1: Node Name degree describe Waterproof 2 Support IP68 waterproof capability High humidity resistance 3 Suitable for environments with humidity above 90% High humidity 1 Applicable scenarios S202 Build entity keyword list The entity extraction results are shown in Table 2: Entity Name Unique ID (MD5) type High humidity 1a79a4d60de6718e8 Scenario Waterproof 9b74c9897bac770f9 Function Product X 8f14e45fceea167a5 product Step S3, result table construction S301 constructs a relationship result table, as shown in Table 3: Node 1 Node 2 Relationship Description source Waterproof High humidity Waterproof performance supports use in high humidity scenarios customer service High humidity resistance High humidity High humidity resistance performance can adapt to humidity environments above 90% customer service S302 constructs a text result table, as shown in Table 4 below: theme Tiers Text content Waterproof Core Features IP68 waterproof capability High humidity resistance Core Features Adapt to environments with humidity above 90% High humidity Usage scenarios Suitable for high humidity environment applications Step S4: Community hierarchy establishment S401 Generate community title Community title: "Environmental adaptability of product X" S402 Generate community summary Summary: The community contains the nodes "Waterproof performance" and "High humidity resistance performance", which describe the applicability of product X in high humidity and harsh environments.
[0051] S403 Generate Impact Severity Score Rating: 9.0 Explanation: The community involves multiple high-connectivity nodes (waterproof performance, high humidity resistance), which have an important influence on users' questions.
[0052] S404, generating score explanation Generate a single-sentence explanation for the community rating: “Rating 9.0: The community contains two important nodes: waterproof performance and high humidity resistance. Both are high-connectivity nodes with a wide range of influence, and can directly answer customers’ questions about high humidity scenarios.” S405 extracts key insights, as shown in Table 5 below: Insight Number Short summary Detailed explanation 1 Product X supports high humidity environments Product X's high humidity resistance is suitable for humidity above 90% and has IP68 waterproof capability 2 Suitable for harsh environments Product X is designed for outdoor and industrial environments and has a high degree of protection Step S5, retrieval and data distribution Combining the node data and community hierarchy of the knowledge graph, the global search decision of the GRAPHRAG algorithm is adopted to determine the relevance of the community and the node in the Map stage, and generate an answer containing a list of key points.
[0053] S501, describe key points of the community Generate a comprehensive description of each key point in the community, as shown in Table 6 below: Key point name describe Waterproof Product X supports IP68 waterproof capability and is suitable for use in high humidity environments. High humidity resistance Product X is suitable for humidity above 90% and has stable and reliable performance. High humidity scene adaptability Product X performs well in high humidity scenarios and is suitable for industrial applications. S502 provides data support Provide reference data support for key points and attach report sources, as shown in Table 7 below: Key point name Data Source Waterproof Product Technical Manual High humidity resistance Environmental adaptability test report High humidity scene adaptability Customer feedback and cases S503 gives the importance score of key points Assign importance scores to each key point as shown in Table 8 below: Key point name Importance score Waterproof 95 High humidity resistance 90 High humidity scene adaptability 85 Step S6: Get user questions S601 Customer Emotion Recognition The content of the customer's question is relatively neutral, with a sentiment score of 5.
[0054] S602 Consulting Product Extraction Extract content: "Product X".
[0055] S603 Problem Classification Category: Question and answer.
[0056] S604 Product Category Identification Category: Environmental adaptability.
[0057] S605 Contextual Summary Summary: "Customer inquired whether product X is suitable for high humidity environments.
[0058] Step S7, vectorized data acquisition Retrieve relevant community data from the results table: Community title: Environmental adaptability of product X Community summary: Product X's high humidity resistance performance description: suitable for environments with humidity above 90%.
[0059] Key insights: Insight 1, Insight 2.
[0060] Step S8, reply generation The final response is generated through the Reduce phase of the GRAPHRAG algorithm: S801, data is constructed into SearchResult format, and the data is reorganized according to the following logic: 1. Use the community title and summary extracted from the knowledge graph as the core part of the answer.
[0061] 2. Combine the retrieved key insights (such as "high humidity resistance" and "waterproof performance") with the corresponding detailed explanations to form a detailed answer.
[0062] 3. Integrate the above data into result objects according to a standard format to ensure that high-quality responses can be generated directly.
[0063] The organized data structure is as follows: Community title: Environmental adaptability of product X Community summary: Product X's high humidity resistance performance description: suitable for environments with humidity above 90%.
[0064] Key insights: Product X supports high humidity environments: its high humidity resistance is suitable for humidity above 90%, and it has IP68 waterproof capability.
[0065] Suitable for harsh environments: Designed for outdoor and industrial environments with a high degree of protection.
[0066] S802, Configure fixed reply options NO_DATA_ANSWER: If the knowledge graph does not find the answer, provide a fixed response: "Sorry, we can't find relevant information at the moment." GENERAL_KNOWLEDGE_INSTRUCTION: Supplement the answer in online mode.
[0067] S803, generate personalized reply and final reply content: Hello! Product X is very suitable for use in high humidity environments. According to the product's high humidity resistance performance description, Product X is suitable for environments with humidity above 90% and has IP68 waterproof capability. In addition, the product is also designed for outdoor and industrial environments and has a high level of protection. If you have other questions, please feel free to consult! Compared with the traditional GRAPHRAG algorithm, the present invention significantly improves efficiency through the following optimizations: The structured processing of nodes and entities organizes the knowledge graph data into a clear keyword list, avoiding the tedious relationship extraction and community identification process in the traditional knowledge graph index construction; The construction of community hierarchy to hierarchically summarize complex knowledge and extract key insights; The global search is combined with the Reduce stage to achieve deep integration and comprehensive analysis of multi-source information.
[0068] The present invention overcomes the shortcomings of the traditional GRAPHRAG system in retrieval efficiency by structuring the knowledge graph data and optimizing the search strategy.
[0069] The improved GRAPHRAG system demonstrates the following core advantages in intelligent customer service application scenarios: Efficiency: Reduce the time consumption of index building and retrieval process; Accuracy: The generated answers are more targeted and informative; Scalability: The application scope of knowledge graphs has been significantly expanded; Personalization: answers can dynamically adapt to user emotions and needs; Easy to maintain: Modular design reduces maintenance and expansion costs.
[0070] like Figure 2 As shown, the present invention also discloses an intelligent question-answering system based on knowledge graph, comprising the following modules: The knowledge acquisition module 11 is used to acquire knowledge graph data from a product database or a knowledge management system, including dimension indicators, descriptive text blocks, and hierarchical relationship data; A data structuring module 12, connected to the knowledge acquisition module, for structuring the knowledge graph data into a node keyword list and an entity keyword list; A data sorting module 13, connected to the data structuring module, is used to sort the structured node keyword list and entity keyword list to generate a relationship result table and a text result table; A community hierarchy generation module 14, connected to the data sorting module, is used to generate a community hierarchy structure based on the knowledge graph data, including a community title, a community summary, an impact severity score, and a score explanation; A community key point description module 15, connected to the community hierarchy generation module, is used to combine the knowledge graph data and the community hierarchy structure and adopt the global search strategy of the GRAPHRAG algorithm to generate a description of the community key points; User question processing module 16, for receiving questions input by users and extracting key information for classification; A data retrieval module 17, connected to the user question processing module, is used to retrieve relevant vectorized data from the relationship result table and the text result table according to the user question, including nodes, community reports, text blocks and Map results generated by the GRAPHRAG algorithm; The reply generation module 18 is connected to the data retrieval module and is used to generate a final reply based on the Reduce phase of the GRAPHRAG algorithm and the prompt word template.
[0071] In the specification and claims of the present application, the words "include / comprise" and the words "have / include" and their variations are used to specify the existence of stated features, values, steps or components, but do not exclude the existence or addition of one or more other features, values, steps, components or combinations thereof.
[0072] Some features of the present invention are described in different embodiments for clarity of description, however, these features may also be described in combination in a single embodiment. Conversely, some features of the present invention are described in only a single embodiment for brevity, however, these features may also be described in different embodiments alone or in any suitable combination.
[0073] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An intelligent question-answering method based on knowledge graph, characterized in that: The following steps are involved: S1, obtain knowledge graph data from product database or knowledge management system, including dimension indicators, descriptive text blocks and hierarchical relationship data; S2, structures the knowledge graph data into node keyword lists and entity keyword lists; S3, sorting the structured node keyword list and entity keyword list to generate a relationship result table and a text result table; S4, based on the knowledge graph data, generates a community hierarchy, including community title, community summary, impact severity score, and score explanation; S5, combining knowledge graph data and community hierarchy, adopts the global search strategy of GRAPHRAG algorithm to generate descriptions of community key points; S6, extracting and classifying key information based on the questions input by the user; S7, retrieve relevant vectorized data from the relational result table and the text result table according to the user question, including nodes, community reports, text blocks, and Map results generated by the GRAPHRAG algorithm; S8, based on the Reduce phase of the GRAPHRAG algorithm, generates the final response in combination with the prompt word template.
2. The intelligent question-answering method based on knowledge graph according to claim 1, characterized in that: In step S1, it includes: S101, obtain dimensional indicators, including product parameters, functional features and applicable scenarios; S102, extracting descriptive text blocks and recording the explanatory content of each dimension indicator; S103, obtaining hierarchical relationship data for defining the hierarchical relationship between nodes in the knowledge graph.
3. The intelligent question-answering method based on knowledge graph according to claim 2, characterized in that: In step S2, it includes: S201, construct a node keyword list, extract dimension indicators in the knowledge graph as node keywords, and calculate the degree value of the node association; S202, construct an entity keyword list, extract entity keywords contained in the node, generate a unique identifier for each entity and classify them by "place", "product", and "organization".
4. The intelligent question-answering method based on knowledge graph according to claim 3 is characterized in that: In step S3, it includes: S301, constructing a relationship result table, and adjusting the description content to an expression form suitable for the customer service system according to the node keyword list and the input dimension indicator definition; S302, constructing a text result table, extracting text content of all levels, and constructing a unified text result table; the text result table is organized by subject and level to facilitate rapid retrieval and association.
5. The intelligent question-answering method based on knowledge graph according to claim 4, characterized in that: In step S4, it includes: S401: Generate community titles, extract titles based on core keywords and entity relationships in the community; S402: Generate a community summary to describe the overall structural information of the community; S403: Generate an impact severity score, giving a score from 0 to 10 based on the importance and relevance of nodes in the community; S404: Generate a scoring explanation to describe the basis of the scoring; S405: Extract key insights within the community and generate detailed discovery points.
6. The intelligent question-answering method based on knowledge graph according to claim 5, characterized in that: In step S5, it includes: S501. Describe the key points of the community and generate a comprehensive description of each key point in the community to ensure that the content is accurate and detailed; S502. Provide data support, provide relevant data support for the key points listed, and attach cited reports or evidence as references; S503. Give the importance scores of the key points, assigning an integer score between 0 and 100 to each key point.
7. The intelligent question-answering method based on knowledge graph according to claim 6, characterized in that: In step S6, it includes: S601: Identify the user's emotional state and generate an emotional score, with the emotional range being 0 to 10; S602: extract consulting products involved in the user's question; S603: Classify the questions into chat and question-and-answer categories; S604: Identify the product category involved in the user's question; S605: Extract key content in the question context and generate a summary.
8. The intelligent question-answering method based on knowledge graph according to claim 7, characterized in that: In step S8, it includes: S801: construct a data structure in SearchResult format to unify answer generation data; S802: Configure a fixed response strategy, including a preset script for answers without data; S803: Call the big model to generate a personalized reply, and adjust the tone and answer content according to the user's emotional state.
9. An intelligent question-answering system based on knowledge graph, characterized in that: Includes the following modules: The knowledge acquisition module is used to obtain knowledge graph data from the product database or knowledge management system, including dimension indicators, descriptive text blocks, and hierarchical relationship data; A data structuring module, connected to the knowledge acquisition module, for structuring the knowledge graph data into a node keyword list and an entity keyword list; A data sorting module, connected to the data structuring module, is used to sort the structured node keyword list and entity keyword list to generate a relationship result table and a text result table; A community hierarchy generation module, connected to the data sorting module, for generating a community hierarchy structure based on the knowledge graph data, including a community title, a community summary, an impact severity score, and a score explanation; A community key point description module, connected to the community hierarchy generation module, is used to combine the knowledge graph data and the community hierarchy structure and adopt the global search strategy of the GRAPHRAG algorithm to generate a description of the community key points; User question processing module, used to receive questions input by users and extract key information for classification; A data retrieval module, connected to the user question processing module, is used to retrieve relevant vectorized data from the relationship result table and the text result table according to the user question, including nodes, community reports, text blocks and Map results generated by the GRAPHRAG algorithm; The reply generation module is connected to the data retrieval module and is used to generate a final reply based on the Reduce phase of the GRAPHRAG algorithm and in combination with the prompt word template.
Citation Information
Cited By
Education question and answer method based on multi-modal knowledge graph and multiple agents and related device
CN121880514A