An industry knowledge question answering method, device, equipment and medium
Patent Information
- Application Number
- CN202610838133.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-10
- Publication Date
- 2026-10-16
AI Technical Summary
[0003]本发明提供一种行业知识问答方法、装置、设备及介质,以解决行业问题解答的准确性低的技术问题
[0008]The aforementioned industry knowledge question-answering method, device, equipment, and medium achieve the following: Industry questions in natural language form are acquired; dense semantic encoding is performed on the industry questions to obtain question semantic vectors; and sparse terminology encoding is performed on the industry questions to obtain question terminology vectors. Based on the first similarity between the question semantic vector and the entity semantic vector, and the second similarity between the question terminology vector and the entity terminology vector, candidate entities matching the industry questions are selected from the knowledge graph. The entity semantic vector is obtained from the entity text information in the knowledge graph through dense semantic encoding, and the entity terminology vector is obtained from the set of industry terms associated with the entities in the knowledge graph through sparse terminology encoding. Using each candidate entity as the center, path exploration is performed in the knowledge graph to obtain candidate paths corresponding to each candidate entity. Each candidate path is converted into natural language text, and then dense semantic encoding is performed on the natural language text to obtain the path semantic vector corresponding to each candidate path. Based on the third similarity between the path semantic vector and the question semantic vector, the target path corresponding to the industry question is determined from the candidate paths. Entity relationship information in the target path is extracted, and combined with the industry question, a large model is used for reasoning to generate the answer corresponding to the industry question. This invention effectively addresses the shortcomings of existing technologies in adapting to domain terms and synonyms by performing dense semantic encoding and sparse terminology encoding in parallel, and combining two similarity methods for candidate entity screening. This enables more comprehensive and accurate recall of candidate entities related to the question, avoiding entity omissions due to terminology mismatch or semantic comprehension bias. Converting candidate paths into natural language text and performing dense semantic encoding, then calculating the similarity between the path semantic vector and the question semantic vector to determine the target path, effectively improves the efficiency and accuracy of multi-hop path search, efficiently focusing on knowledge paths highly relevant to the question's semantics. By extracting entity relationship information from the target path and combining it with industry-specific questions using a large model for reasoning, answers corresponding to the industry-specific questions are generated. By providing refined entity relationship information, the large model is guided to perform targeted reasoning, ensuring the reliability and accuracy of the answers. Ultimately, this effectively improves the accuracy of answering industry-specific questions.
Smart Images

Figure CN122925538A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence technology and natural language processing technology, and in particular to an industry knowledge question answering method, device, equipment and medium. Background Technology
[0002] In vertical domain knowledge base question answering systems, existing technologies face multiple challenges. The entity recognition stage suffers from significant limitations in adapting to specialized terminology and synonyms. General named entity recognition models struggle to effectively handle specific vocabulary in fields like insurance, such as the difference between "critical illness insurance" and "major disease insurance," leading to missed key entities or the introduction of irrelevant noise, impacting the accuracy of subsequent processing. During multi-hop path search, knowledge graph traversal easily triggers path space explosion. When queries involve relationships with more than three hops, the number of candidate paths grows exponentially, drastically increasing system computational resource consumption and significantly reducing response latency, making it difficult to meet real-time application requirements. In the answer generation stage, directly concatenating multiple candidate paths into a large language model often results in information redundancy, conflicts, or noise interference, causing the model to generate fictitious content or logical contradictions. This is particularly problematic in high-reliability domains like insurance, where answers lack interpretability and factual basis, severely undermining user trust. These issues collectively limit the accuracy of knowledge base question answering systems in specialized scenarios. Summary of the Invention
[0003] This invention provides an industry knowledge question-and-answer method, apparatus, equipment, and medium to solve the technical problem of low accuracy in answering industry questions.
[0004] Firstly, it provides an industry knowledge question-and-answer method, including: The system obtains industry-specific questions in natural language form, performs dense semantic encoding on the industry-specific questions to obtain a question semantic vector, and performs sparse term encoding on the industry-specific questions to obtain a question term vector. Based on the first similarity between the question semantic vector and the entity semantic vector, and the second similarity between the question term vector and the entity term vector, candidate entities matching industry questions are selected from the knowledge graph. The entity semantic vector is obtained by dense semantic encoding of the entity text information in the knowledge graph, and the entity term vector is obtained by sparse term encoding of the set of industry terms associated with the entity in the knowledge graph. Centered on each candidate entity, path exploration is carried out in the knowledge graph to obtain the candidate path corresponding to each candidate entity. Each candidate path is converted into natural language text, and then dense semantic encoding is performed on the natural language text to obtain the path semantic vector corresponding to each candidate path. Based on the third similarity between the path semantic vector and the question semantic vector, the target path for the corresponding industry question is determined from the candidate paths; Extract entity relationship information from the target path, and combine it with industry-specific questions to use a large model for reasoning, generating answers to the industry-specific questions.
[0005] Secondly, an industry knowledge question-and-answer device is provided, including: The acquisition module is used to acquire industry questions in natural language form, perform dense semantic encoding on the industry questions to obtain question semantic vectors, and perform sparse term encoding on the industry questions to obtain question term vectors. The entity matching module is used to filter candidate entities that match industry questions from the knowledge graph based on the first similarity between the question semantic vector and the entity semantic vector, and the second similarity between the question term vector and the entity term vector. The entity semantic vector is obtained by dense semantic encoding of the entity text information in the knowledge graph, and the entity term vector is obtained by sparse term encoding of the set of industry terms associated with the entity in the knowledge graph. The path exploration module is used to explore paths in the knowledge graph with each candidate entity as the center, obtain the candidate paths corresponding to each candidate entity, convert each candidate path into natural language text, and then perform dense semantic encoding on the natural language text to obtain the path semantic vector corresponding to each candidate path. The path determination module is used to determine the target path for the corresponding industry problem from the candidate paths based on the third similarity between the path semantic vector and the problem semantic vector. The answer generation module is used to extract entity relationship information in the target path and combine it with industry-specific questions to perform reasoning using a large model, generating answers corresponding to the industry-specific questions.
[0006] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the aforementioned industry knowledge question-and-answer method.
[0007] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the aforementioned industry knowledge question-and-answer method.
[0008] The aforementioned industry knowledge question-answering method, device, equipment, and medium achieve the following: Industry questions in natural language form are acquired; dense semantic encoding is performed on the industry questions to obtain question semantic vectors; and sparse terminology encoding is performed on the industry questions to obtain question terminology vectors. Based on the first similarity between the question semantic vector and the entity semantic vector, and the second similarity between the question terminology vector and the entity terminology vector, candidate entities matching the industry questions are selected from the knowledge graph. The entity semantic vector is obtained from the entity text information in the knowledge graph through dense semantic encoding, and the entity terminology vector is obtained from the set of industry terms associated with the entities in the knowledge graph through sparse terminology encoding. Using each candidate entity as the center, path exploration is performed in the knowledge graph to obtain candidate paths corresponding to each candidate entity. Each candidate path is converted into natural language text, and then dense semantic encoding is performed on the natural language text to obtain the path semantic vector corresponding to each candidate path. Based on the third similarity between the path semantic vector and the question semantic vector, the target path corresponding to the industry question is determined from the candidate paths. Entity relationship information in the target path is extracted, and combined with the industry question, a large model is used for reasoning to generate the answer corresponding to the industry question. This invention effectively addresses the shortcomings of existing technologies in adapting to domain terms and synonyms by performing dense semantic encoding and sparse terminology encoding in parallel, and combining two similarity methods for candidate entity screening. This enables more comprehensive and accurate recall of candidate entities related to the question, avoiding entity omissions due to terminology mismatch or semantic comprehension bias. Converting candidate paths into natural language text and performing dense semantic encoding, then calculating the similarity between the path semantic vector and the question semantic vector to determine the target path, effectively improves the efficiency and accuracy of multi-hop path search, efficiently focusing on knowledge paths highly relevant to the question's semantics. By extracting entity relationship information from the target path and combining it with industry-specific questions using a large model for reasoning, answers corresponding to the industry-specific questions are generated. By providing refined entity relationship information, the large model is guided to perform targeted reasoning, ensuring the reliability and accuracy of the answers. Ultimately, this effectively improves the accuracy of answering industry-specific questions. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a schematic diagram of an application environment for an industry knowledge question-and-answer method according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating an industry knowledge question-and-answer method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of an industry knowledge question-and-answer device according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 5 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation
[0011] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0012] The industry knowledge question-and-answer method provided in this invention can be applied to, for example... Figure 1 In this application environment, the client communicates with the server via a network. The server can obtain industry questions in natural language form from the client, perform dense semantic encoding on the industry questions to obtain a question semantic vector, and perform sparse terminology encoding on the industry questions to obtain a question terminology vector. Based on the first similarity between the question semantic vector and the entity semantic vector, and the second similarity between the question terminology vector and the entity terminology vector, candidate entities matching the industry questions are selected from the knowledge graph. The entity semantic vector is obtained by dense semantic encoding of the entity text information in the knowledge graph, and the entity terminology vector is obtained by sparse terminology encoding of the set of industry terms associated with the entity in the knowledge graph. Centered on each candidate entity, path exploration is performed in the knowledge graph to obtain the candidate paths corresponding to each candidate entity. Each candidate path is converted into natural language text, and then dense semantic encoding is performed on the natural language text to obtain the path semantic vector corresponding to each candidate path. Based on the third similarity between the path semantic vector and the question semantic vector, the target path corresponding to the industry questions is determined from the candidate paths. The entity relationship information in the target path is extracted, and combined with the industry questions, a large model is used for reasoning to generate the answer corresponding to the industry questions and push it to the client. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will now be described in detail through specific embodiments.
[0013] Please see Figure 2 As shown, Figure 2 A flowchart illustrating the industry knowledge question-answering method provided in this embodiment of the invention includes the following steps: S10: Obtain industry questions in natural language form, perform dense semantic encoding on the industry questions to obtain a question semantic vector, and perform sparse term encoding on the industry questions to obtain a question term vector.
[0014] Industry-specific questions in natural language refer to inquiries from users, expressed in everyday spoken or written language, that relate to a specific industry sector (such as insurance, finance, healthcare, etc.). These questions typically contain industry-specific terminology or concepts.
[0015] Dense semantic encoding refers to the process of converting textual information into a fixed-length, low-dimensional, dense vector representation using a deep learning model. This vector can capture the deep semantic information of the text, making semantically similar texts appear closer together in the vector space.
[0016] A question semantic vector is a vector representation obtained by densely semantically encoding an industry question in natural language form. This vector reflects the overall semantic content of the question.
[0017] Sparse terminology encoding refers to the process of converting textual information into a high-dimensional sparse vector representation through lexical activation or weighting mechanisms. This vector can explicitly highlight key terms and words in the text and has a high sensitivity to technical terms.
[0018] A problem term vector is a vector representation obtained by sparsely encoding industry-specific terms into a natural language form of a problem. This vector highlights the industry-specific terms contained in the problem.
[0019] To gain a deeper understanding of the industry problem, it undergoes two types of encoding processes in parallel. One approach is dense semantic encoding, resulting in a semantic vector. This encoding process can employ pre-trained deep learning models, such as those based on the Transformer architecture, to capture contextual semantic information by mapping words in the problem to a continuous vector space. The other approach is sparse terminology encoding, resulting in a terminology vector. This encoding process can use term frequency-inverse document frequency (TF-IDF) based models or specially designed sparse encoding models, activating dimensions corresponding to key terms in the problem to highlight its specialized vocabulary features. These two encoding methods represent the user's problem at both the semantic and terminology levels, providing multi-dimensional information for subsequent matching and filtering.
[0020] S20: Based on the first similarity between the question semantic vector and the entity semantic vector, and the second similarity between the question term vector and the entity term vector, candidate entities matching industry questions are selected from the knowledge graph. The entity semantic vector is obtained by dense semantic encoding of the entity text information in the knowledge graph, and the entity term vector is obtained by sparse term encoding of the set of industry terms associated with the entities in the knowledge graph.
[0021] An entity semantic vector is a vector representation of the textual information of an entity in a knowledge graph (such as entity name, description, etc.) after dense semantic encoding. This vector reflects the semantic connotation of the entity.
[0022] An entity term vector is a vector representation of the set of industry terms associated with entities in a knowledge graph, obtained through sparse terminology encoding. This vector highlights the specialized terminology represented by the entity.
[0023] A knowledge graph is a database that stores knowledge in a graph structure, containing entities (nodes) and the relationships between entities (edges). This graph can represent complex industry knowledge systems.
[0024] Candidate entities refer to the set of entities that are initially selected based on the similarity matching between the user's industry question and entities in the knowledge graph.
[0025] During the knowledge graph construction phase, the entity text information (such as entity names, aliases, descriptions, etc.) in the knowledge graph is pre-encoded with dense semantics to obtain entity semantic vectors. Simultaneously, the set of industry terms associated with the entities in the knowledge graph is also sparsely encoded to obtain entity term vectors. During the matching process, the cosine similarity between the question semantic vector and each entity semantic vector can be calculated as the first similarity, and the dot product similarity between the question term vector and each entity term vector can be calculated as the second similarity. Subsequently, the first and second similarities can be combined for candidate entity selection. Specifically, a weighted composite score of the first and second similarities can be calculated. When the weighted composite score exceeds a preset score threshold, the corresponding entity is selected as a candidate entity; or, when the first similarity exceeds a first preset threshold or the second similarity exceeds a second preset threshold, the corresponding entity is selected as a candidate entity.
[0026] S30: Centered on each candidate entity, explore paths in the knowledge graph to obtain candidate paths corresponding to each candidate entity, convert each candidate path into natural language text, and then perform dense semantic encoding on the natural language text to obtain the path semantic vector corresponding to each candidate path.
[0027] Path exploration refers to the process of traversing along relational edges in a knowledge graph, starting from or centering on a specific entity, in order to discover connections between different entities or sequences of specific information.
[0028] Candidate paths refer to the set of paths that may contain answers to questions, obtained through path exploration in a knowledge graph.
[0029] A path semantic vector is a vector representation obtained by converting a candidate path into natural language text and then performing dense semantic encoding on that natural language text. This vector reflects the semantic content of the path.
[0030] This path exploration can employ graph traversal algorithms such as breadth-first search or depth-first search. For example, starting from each candidate entity, a one-way traversal can be performed along the relation edges in the knowledge graph to explore all paths within a fixed number of hops (e.g., two hops). Each explored path can be represented as an alternating sequence of entities and relations. Subsequently, each candidate path is converted into natural language text. This conversion process can concatenate the entities and relations in the path into a readable sentence, for example, converting a triple (entity A, relation R, entity B) into "There is a relation R between entity A and entity B". Then, dense semantic encoding is performed on this natural language text to obtain the path semantic vector corresponding to each candidate path. This encoding process can reuse the model used for dense semantic encoding of industry problems, ensuring the consistency of the semantic vector space.
[0031] S40: Based on the third similarity between the path semantic vector and the question semantic vector, determine the target path for the corresponding industry question from the candidate paths.
[0032] The target path refers to the path that is highly relevant to the industry problem and can be used to generate answers, which is finally determined from the candidate paths after further screening.
[0033] This third similarity can be calculated using cosine similarity to measure the semantic relevance between the path text and the question text. For example, a similarity threshold can be set, and a path is only considered a target path if the cosine similarity between the path semantic vector and the question semantic vector exceeds this threshold. This step can filter out the path that best matches the semantics of the user's question from a large number of candidate paths, thereby improving the accuracy of answer generation.
[0034] S50: Extract entity relationship information from the target path, and combine it with industry-specific questions to use a large model for reasoning, generating answers corresponding to the industry-specific questions.
[0035] Entity relationship information refers to the entities contained in the target path and the relationships between them. This information usually exists in the form of triples (head entity, relation, tail entity).
[0036] Large models refer to deep learning models with a large number of parameters, usually large language models (LLMs), which have powerful natural language understanding, generation, and reasoning capabilities.
[0037] Reasoning refers to the process by which a large model draws conclusions or generates answers based on given information (such as entity relationship information and industry issues) through logical analysis and association.
[0038] The answer refers to a solution generated in natural language by the large model for the user's industry-specific question based on the reasoning result.
[0039] The entity-relationship information can be directly parsed from the target path. For example, if the target path is "Entity A - Relationship R1 - Entity B - Relationship R2 - Entity C", the extracted entity-relationship information includes (Entity A, Relationship R1, Entity B) and (Entity B, Relationship R2, Entity C). The extracted entity-relationship information can be directly used as input and provided together with the original industry-specific question to a pre-trained large model. Relying on its powerful language understanding and generation capabilities, the large model analyzes and integrates these pieces of information to directly generate an answer in the form of natural language.
[0040] The above technical solution will be further described in depth below through a more specific example.
[0041] User A poses an industry-specific question: "What is the coverage scope of Ping An Fu?" First, the system obtains the industry-specific question in the form of natural language. The question is then subjected to dense semantic encoding and sparse term encoding in parallel. In the dense semantic encoding stage, a pre-trained semantic model encodes "What is the coverage scope of Ping An Fu?" into a question semantic vector, which captures the overall semantics of the question related to "coverage scope". In the sparse term encoding stage, another term model encodes the question into a question term vector, which highlights key terms such as "Ping An Fu" and "coverage scope".
[0042] Next, the system uses these vectors to filter candidate entities from the knowledge graph. A large number of insurance entities and their corresponding entity semantic vectors and entity term vectors are pre-stored in the knowledge graph. The system calculates a first similarity between the question semantic vector and all entity semantic vectors in the knowledge graph, and a second similarity between the question term vector and all entity term vectors. For example, for the entity "Ping An Fu", the first similarity between its entity semantic vector and the question semantic vector is relatively high, and the second similarity between its entity term vector and the question term vector is also relatively high. If only the first similarity (e.g., 0.85) exceeds a preset threshold (e.g., 0.7), the "Ping An Fu" entity will be filtered out as a candidate entity.
[0043] Subsequently, centered on the "Ping An Fu" entity, the system explores paths within the knowledge graph. For example, starting from the "Ping An Fu" entity, the system can perform a one-way breadth-first search to explore all paths within two hops. One path is: "Ping An Fu - Includes - Critical Illness Coverage". Another path is: "Ping An Fu - Includes - Death Benefit". After these paths are extracted, they are converted into natural language text, such as "Ping An Fu includes Critical Illness Coverage" and "Ping An Fu includes Death Benefit". Then, these natural language texts undergo dense semantic encoding to obtain corresponding path semantic vectors.
[0044] The system then calculates a third similarity between these path semantic vectors and the previously generated question semantic vectors. For example, the third similarity between the path semantic vector for the path "Ping An Fu includes critical illness coverage" and the question semantic vector for the question "What is the coverage scope of Ping An Fu?" is 0.92. The third similarity between the path semantic vector for the path "Ping An Fu includes death benefits" and the question semantic vector is 0.88. If the preset similarity threshold is 0.85, then both paths will be identified as target paths because their similarity is higher than this threshold.
[0045] Finally, the system extracts entity relationship information from these target paths. For example, it extracts (Ping An Fu, includes, critical illness coverage) from "Ping An Fu includes critical illness coverage" and (Ping An Fu, includes, death benefit) from "Ping An Fu includes death benefit". This entity relationship information, along with the original industry question "What is the coverage scope of Ping An Fu?", is input into a large model. The large model performs reasoning based on this information; for example, it identifies that the question is about "coverage scope", and the extracted relationship information directly provides the specific coverage content "included" by "Ping An Fu". Thus, the large model generates a natural language answer: "The coverage scope of Ping An Fu includes critical illness coverage and death benefit". As can be seen, the above scheme effectively solves the problem of insufficient adaptability to domain terms and synonyms in existing technologies by performing dense semantic encoding and sparse terminology encoding in parallel and combining two similarity methods for candidate entity screening. This enables a more comprehensive and accurate recall of candidate entities related to the question, avoiding entity omissions due to terminology mismatch or semantic comprehension bias. Converting candidate paths into natural language text and performing dense semantic encoding, then calculating the similarity between the path semantic vector and the question semantic vector to determine the target path, effectively improves the efficiency and accuracy of multi-hop path search, efficiently focusing on knowledge paths highly relevant to the question's semantics. By extracting entity relationship information from the target path and combining it with industry-specific questions using a large model for reasoning, the scheme generates answers corresponding to the industry-specific questions. By providing refined entity relationship information, the scheme guides the large model to perform targeted reasoning, ensuring the reliability and accuracy of the answers. Ultimately, this effectively improves the accuracy of answering industry-specific questions.
[0046] In some of the embodiments described above in this application, a method is proposed to determine the target path and extract entity relationship information from a knowledge graph, and then use a large model to reason about the industry problem to generate an answer. However, directly inputting the extracted entity relationship information into the large model for reasoning may lead to problems such as information redundancy, unclear structure, or low reasoning efficiency, thereby affecting the accuracy and relevance of the final answer.
[0047] In response, this application further proposes to extract entity relationship information from the target path and use a large model to reason about the industry problem, generating the answer corresponding to the industry problem. This includes: extracting entity relationship information from the target path and generating a structured knowledge summary; inputting the structured knowledge summary into the large model, enabling the large model to generate a logical reasoning chain based on the structured knowledge summary; and generating an answer in natural language form based on the logical reasoning chain and the industry problem.
[0048] The first step, extracting entity relationship information from the target path and generating a structured knowledge summary, refines and organizes the raw entity relationship information obtained from the target path, transforming it into a structured form that is easier for large models to understand and process. The raw entity relationship information may exist as triples (entity-relationship-entity) or more complex graph structures; directly inputting it into a large model may lead to information overload or the model's inability to effectively capture key information. Specifically, predefined templates or rules can be used to convert the extracted entity relationship information into structured text fragments, such as "Entity A and entity B have a relationship C." Furthermore, natural language processing techniques, such as information extraction or knowledge graph embedding, can be used to encode entity relationship information into vector representations, forming a concise structured representation.
[0049] The structured knowledge summary is input into a large model, enabling the model to generate logical reasoning chains based on it. This step leverages the model's powerful language understanding and generation capabilities, using the structured knowledge summary as input to guide the model in deep logical analysis and reasoning. The purpose of generating logical reasoning chains is to connect the discrete information in the structured knowledge summary into a coherent and interpretable reasoning process, providing support for the generation of the final answer. Specifically, this can be achieved by designing specific prompts, embedding the structured knowledge summary into them, and requiring the large model to output its reasoning process. Alternatively, the large model can be fine-tuned to automatically generate logical reasoning chains that conform to a specific format or logic after receiving the structured knowledge summary.
[0050] Based on the logical reasoning chain and combined with the industry question, the final answer generation step involves generating an answer in natural language. This step integrates the logical reasoning chain generated by the large model with the original industry question to ensure that the generated answer is both logically supported and directly addresses the user's question. Specifically, the logical reasoning chain and the industry question can be used as input to the large model, which is then required to answer the industry question directly in natural language based on the content of the logical reasoning chain. Alternatively, the logical reasoning chain can be used as an intermediate result, integrated with the industry question through another large model or post-processing module to generate a more readable and fluent natural language answer.
[0051] The following is a concrete example to illustrate this. Suppose the industry question is "What are the commonly used drugs for treating hypertension?". Based on the aforementioned industry knowledge question-answering method, the system has already identified the target path related to "hypertension" from the knowledge graph and extracted entity relationship information from it. For example, "hypertension" and "treatment drugs" have the relationship of "diuretics," "beta-blockers," and "angiotensin-converting enzyme inhibitors," etc. This application further proposes to extract entity relationship information from the target path to generate a structured knowledge summary. For example, the extracted entity relationship information can be refined and integrated into a structured knowledge summary: "Commonly used drugs for treating hypertension include diuretics, beta-blockers, and angiotensin-converting enzyme inhibitors." Then, the structured knowledge summary is input into a large model, enabling the large model to generate a logical reasoning chain based on the structured knowledge summary. For example, a large model might generate the following logical reasoning chain: "1. Identify the core question: The user is asking about commonly used medications for hypertension. 2. Retrieve knowledge summary: The structured knowledge summary clearly identifies the categories of medications for hypertension. 3. Synthesize information: Use these medication categories as key components of the answer." Finally, based on the logical reasoning chain and combined with the industry question, an answer in natural language format is generated. For example, the large model could generate the answer: "Commonly used medications for treating hypertension include diuretics, beta-blockers, and angiotensin-converting enzyme inhibitors, etc." By extracting entity relationship information from the target path into a structured knowledge summary, this method effectively reduces the difficulty for large models to process raw, complex knowledge graph information and improves information utilization efficiency. Furthermore, by guiding the large model to generate logical reasoning chains based on the structured knowledge summary, the reasoning process of the large model becomes more controllable, thereby significantly improving the accuracy and reliability of the generated answers. Finally, by combining the logical reasoning chains with industry-specific questions to generate answers in natural language, this ensures that the answers are not only logically rigorous but also accurately respond to user questions, greatly improving the accuracy of industry-specific knowledge-based question answering.
[0052] In some of the embodiments described above in this application, a path exploration is proposed in the knowledge graph centered on each candidate entity to obtain the candidate path corresponding to each candidate entity. However, in its implementation, if only one-way path exploration is performed, key information related to the candidate entity but in the opposite direction may be missed, resulting in an incomplete candidate path and thus affecting the accuracy of subsequent answer generation.
[0053] In response, this application further proposes to explore paths in the knowledge graph with each candidate entity as the center to obtain the candidate paths corresponding to each candidate entity, including: taking the candidate entities as head entities and tail entities respectively, and exploring paths in both directions in the knowledge graph to obtain the candidate paths corresponding to each candidate entity.
[0054] Specifically, "treating candidate entities as both head and tail entities" means that during path exploration, for each selected candidate entity, the system considers both its role as the subject (head entity) and object (tail entity) of the relation. This means that in the knowledge graph, it not only searches for other entities that the entity points to, but also searches for other entities that point to the entity. For example, during path exploration, two independent exploration processes can be initiated for each candidate entity: one process expands the relation triple with the entity as the head entity, and the other process expands it with the entity as the tail entity. Alternatively, when traversing the knowledge graph, the role of the candidate entity in the relation can be dynamically adjusted according to the context of the current path.
[0055] The following is a concrete example to illustrate this. Suppose that in a medical knowledge graph, for the industry question "Which drugs can treat hypertension?", the system identifies "hypertension" as a candidate entity. During path exploration, if only a one-way exploration is performed, only a path like "hypertension -> treatment method -> drug A" will be found. However, using the bidirectional path exploration method of this application, the system will explore "hypertension" simultaneously as both a head and tail entity. As a head entity, paths such as "hypertension -> symptoms -> dizziness" and "hypertension -> complications -> heart disease" can be explored. As a tail entity, the system will explore paths such as "drug B -> treatment -> hypertension" and "lifestyle habit C -> causes -> hypertension". For example, an improved breadth-first search algorithm can be used, starting with the "hypertension" entity, simultaneously expanding one layer of relationships outward (as a head entity) and inward (as a tail entity). When expanding outward, it is found that "hypertension" and "drug A" are connected through the "treatment method" relationship; when expanding inward, it is found that "drug B" and "hypertension" are connected through the "treatment" relationship. In this way, even if the problem focuses on drugs for treating "hypertension," and these drugs exist in the knowledge graph as "drug treatment for hypertension," bidirectional exploration can ensure that these key pathways are discovered, thereby obtaining a more comprehensive range of candidate pathways.
[0056] By employing the aforementioned technical solution, bidirectional path exploration of candidate entities enables a more comprehensive capture of knowledge graph information associated with them, avoiding the omission of important context or relationships due to unidirectional exploration. This results in a more complete and accurate set of candidate paths, providing richer and more precise knowledge support for subsequent target path selection and final answer generation, significantly improving the accuracy and reliability of industry-specific question answering.
[0057] In the aforementioned path exploration process, if the path exploration depth (i.e., the number of retrieval hops) is set to a fixed value, it cannot adequately accommodate candidate entities with varying degrees of matching. For example, for entities that highly match the question terms, excessively deep exploration will waste resources; while for entities with high semantic matching but low terminology matching, excessively shallow exploration will miss important deep-level related information, thus affecting the efficiency and accuracy of path retrieval.
[0058] To address this, this application further proposes a path exploration method centered on each candidate entity within the knowledge graph to obtain candidate paths corresponding to each entity. This includes determining the retrieval hop count for candidate paths in the knowledge graph based on the first similarity between the question semantic vector and the entity semantic vector, and the second similarity between the question term vector and the entity term vector. Specifically, when the second similarity meets a preset matching condition, the first hop count is used for path retrieval; when only the first similarity meets the preset matching condition, the second hop count is used for path retrieval, with the first hop count being less than the second hop count.
[0059] Determining the hop count for candidate paths in the knowledge graph refers to dynamically setting the maximum depth of path exploration within the knowledge graph, starting from a candidate entity, based on the strength and type of association between the question and the candidate entity. Its purpose is to optimize the scope of path exploration, avoid blind exploration, and thus improve retrieval efficiency and result accuracy. One implementation approach is to predefine a hop count range and determine the specific hop count based on similarity calculations using table lookups or function mappings. Another approach is to use a machine learning model, inputting similarity values and other relevant features, to predict the most suitable hop count.
[0060] When the second similarity meets the preset matching condition, path retrieval is performed using the first hop count. The second similarity reflects the degree of precise matching between the question and the entity at the terminology level. When this precise matching reaches the preset condition, it indicates that the entity is highly related to the question in terms of core concepts. In this case, using a smaller first hop count for path retrieval can quickly locate the core knowledge that is highly related to the terminology, reducing unnecessary deep exploration. For example, the preset matching condition can be a similarity threshold; when the second similarity is higher than this threshold, the condition is met.
[0061] When only the first similarity meets the preset matching condition, the second hop count is used for path retrieval. The first similarity reflects the degree of semantic generalization between the question and the entity. When only the semantic matching degree is high but the terminology matching degree is low, it means that the entity has a potential connection with the question, but its core information needs to be explored more deeply to be discovered. In this case, using a larger second hop count for path retrieval can expand the scope of exploration and uncover deeper potential connections. For example, the preset matching condition can be a similarity threshold. When the first similarity is higher than this threshold and the second similarity does not meet its preset matching condition, the condition of "only the first similarity meets the preset matching condition" is met.
[0062] The requirement that the first hop count be less than the second hop count reflects the priority and efficiency of the retrieval strategy. When the term matching degree is high, the search tends to be more precise and shorter; when only the semantic matching degree is high, the search tends to be broader and deeper to compensate for the information loss caused by insufficient term matching. The requirement that the first hop count be less than the second hop count ensures that relevant information can be converged more quickly when the term matching is precise, while sufficient depth can be used to discover potential associations when the semantic generalization matching is generalized.
[0063] The following is a concrete example to illustrate this. After acquiring the industry question and performing dense semantic encoding to obtain a question semantic vector, and sparse terminology encoding to obtain a question terminology vector, the system calculates the first and second similarities between these vectors and the entity semantic vectors and entity terminology vectors of each entity in the knowledge graph, thereby filtering out candidate entities. For example, suppose an industry question is "treatment options for hypertension," and the system filters "hypertension" as a candidate entity. When exploring paths for the "hypertension" entity, the system first evaluates its first similarity (semantics) and second similarity (terminology) with the question. If "hypertension" and the question are highly matched in terms (e.g., the second similarity reaches 0.9 or higher), the system can set a first hop count (e.g., 1 hop) for path retrieval to quickly find treatment option entities or relationships directly associated with "hypertension." If "hypertension" has a high semantic match with the question (e.g., a first similarity of 0.8 or higher), but a low terminology match (e.g., a second similarity of less than 0.5), the system can be configured to use a second number of hops (e.g., 2 or 3 hops) for path retrieval to explore deeper associations such as complications of "hypertension" and side effects of related medications, thereby comprehensively constructing candidate paths. The first number of hops is usually less than the second number of hops; for example, the first number of hops can be set to 1, and the second number of hops can be set to 2 or 3.
[0064] Through the above technical solution, this application can dynamically adjust the depth of path exploration in the knowledge graph based on the different degrees of matching between industry problems and candidate entities at the semantic and terminological levels. When the problem and entity are highly related in terms, using a smaller number of retrieval hops can quickly and efficiently obtain core related information, avoiding unnecessary deep exploration and thus significantly improving the efficiency of path exploration. When only the semantic matching degree is high, using a larger number of retrieval hops can expand the exploration scope, uncover deeper potential related knowledge, effectively compensate for information omissions that may be caused by insufficient terminological matching, and ensure the comprehensiveness of path exploration. This adaptive hop count determination mechanism makes the path exploration process more intelligent and accurate, avoiding the problems of insufficient or excessive exploration caused by a fixed hop count strategy, thereby improving the accuracy of subsequent target path determination.
[0065] In some of the embodiments described above in this application, entity relationship information is extracted from the target path and combined with industry-specific questions to use a large model for reasoning to generate answers corresponding to the industry-specific questions. However, in practical applications, when multiple target paths are identified for an industry-specific question, directly inputting the entity relationship information from all paths indiscriminately into subsequent processing stages may lead to information redundancy, increase the processing burden of the large model, and may even introduce duplicate or suboptimal reasoning paths, thereby affecting the efficiency and quality of the final answer generation.
[0066] In response, this application further proposes to extract entity relationship information from the target path and generate a structured knowledge summary, including: if there are multiple target paths, extract entity relationship information from all target paths, and perform deduplication on the entity relationship information to obtain deduplicated entity relationship information, and generate a structured knowledge summary based on the deduplicated entity relationship information.
[0067] When exploring paths in a knowledge graph, for a specific industry problem, there may be multiple paths related to that problem, all of which are identified as target paths. These multiple target paths may contain identical entity relationships, or they may contain partially overlapping or completely different entity relationships. The step of extracting entity relationship information from all target paths identifies and extracts the entities contained within them and the relationships between them from all identified target paths. For example, a path may consist of "entity A - relation R - entity B," then the extracted entity relationship information is "there is a relation R between entity A and entity B." This extraction process can traverse each target path, collecting information in the form of triples (head entity, relation, tail entity) one by one. The deduplication operation on entity relationship information refers to eliminating duplicate information after extracting entity relationship information from all target paths. For example, if multiple target paths all contain the entity relationship "entity A - relation R - entity B," deduplication will retain only one instance of this entity relationship. Deduplication can be achieved by storing the extracted entity relationship information in a collection data structure, or by sorting the list and then iterating through it to delete adjacent duplicates.
[0068] The following example illustrates this. Suppose that for an industry problem, the system identifies three target paths: Target Path 1: "Drug A - Treatment - Disease B"; Target Path 2: "Drug A - Treatment - Disease B"; Target Path 3: "Drug A - Acts on - Target C". First, the system extracts entity relationship information from all target paths. From Target Path 1, it extracts the entity relationship "Drug A treats Disease B"; from Target Path 2, it extracts the entity relationship "Drug A treats Disease B" again; and from Target Path 3, it extracts the entity relationship "Drug A acts on Target C". At this point, the extracted entity relationship information set is {"Drug A treats Disease B", "Drug A treats Disease B", "Drug A acts on Target C"}. Next, this entity relationship information is deduplicated. The deduplication operation identifies that the entity relationship "Drug A treats Disease B" appears twice and merges it into one. Finally, the deduplicated entity relationship information set is {"Drug A treats Disease B", "Drug A acts on Target C"}. This deduplicated set will then be used to generate a structured knowledge summary, which will be fed into a large model for inference.
[0069] The above technical solution effectively integrates and simplifies entity relationship information extracted from multiple target paths when an industry problem corresponds to these paths. This deduplication process significantly reduces information redundancy input into the large model, thereby reducing its computational load and improving its processing efficiency. Simultaneously, due to the refinement and accuracy of the input information, the large model avoids confusion or inefficient reasoning caused by duplicate information, thus contributing to the generation of more accurate, concise, and high-quality answers to industry problems.
[0070] In some other embodiments, this application proposes an industry knowledge question-answering method. In the embodiments described above, this application proposes extracting entity relationship information from target paths and deduplicating the entity relationship information across multiple target paths to generate a structured knowledge summary. However, the deduplicated entity relationship information may still contain redundant or low-value details. Directly inputting this as a structured knowledge summary into a large model for reasoning increases the processing burden on the large model, reduces reasoning efficiency and answer accuracy, and makes it difficult to efficiently extract core knowledge points.
[0071] In response, this application further proposes to generate structured knowledge summaries based on deduplicated entity relationship information, including: using a lightweight large model to extract and fuse information from the deduplicated entity relationship information to obtain structured knowledge summaries.
[0072] Lightweight large models refer to models optimized through techniques such as pruning, quantization, and knowledge distillation, compared to general-purpose, large-parameter basic models, or models designed with efficiency and resource consumption in mind, while still possessing a certain level of understanding, generation, and reasoning capabilities. Their purpose is to reduce computational resource consumption and increase processing speed while ensuring processing performance, making them more suitable for deployment and operation in specific tasks or resource-constrained environments. For example, a lightweight large model could be a pre-trained language model based on the Transformer architecture but with a smaller number of parameters, such as BERT-tiny or DistilBERT, or a small LLaMA variant fine-tuned for a specific domain. Alternatively, it could be a model employing a hybrid expert (MoE) architecture, but activating only some experts during inference to achieve lightweight operation. Information extraction and fusion processing can identify key facts, concepts, and relationships from the original, deduplicated entity relationship information and integrate and organize them into a higher-level, more generalized knowledge representation. For example, natural language processing (NLP) techniques, such as named entity recognition (NER), relation extraction (RE), and event extraction, can be used to identify core entities and their relationships from text and then summarize them. Alternatively, graph neural networks (GNNs) can be used to analyze the deduplicated entity relationship graph, and through operations such as node embedding and graph convolution, potential knowledge and higher-order relationships can be discovered and integrated into a structured knowledge summary.
[0073] The following is a concrete example to illustrate this. Suppose that the deduplicated entity relationship information includes: "Drug A treats disease X", "Drug A has side effects Y", "The symptoms of disease X are Z", and "A doctor recommends drug A for treating disease X". As a specific implementation, a DistilBERT model fine-tuned with medical domain knowledge can be used as a lightweight, large model. This DistilBERT model receives the deduplicated entity relationship information mentioned above. The model first identifies core entities such as "Drug A", "Drug X", "Side effects Y", "Symptoms Z", and "Doctor". Then, it analyzes the relationships between these entities, such as "treat", "have", "is", and "recommend". Through its semantic understanding capabilities gained from pre-training and fine-tuning, the model can integrate this discrete information. For example, it can extract a structured summary such as "Drug A is a recommended drug for treating disease X, but attention should be paid to side effects Y, and the typical symptoms of disease X are Z". This summary not only contains the original information but also forms a more coherent, easier-to-understand, and more easily reasoned knowledge fragment through semantic association and generalization.
[0074] By employing a lightweight large model to refine and integrate the deduplicated entity relationship information, this application can effectively extract core, high-value knowledge points from the potentially redundant deduplicated information and organize them into a concise, structured knowledge summary. This reduces the complexity of subsequent knowledge processing by the large model and improves the efficiency and accuracy of the large model in generating logical reasoning chains.
[0075] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0076] In one embodiment, an industry knowledge question-and-answer device is provided, which corresponds one-to-one with the industry knowledge question-and-answer methods described in the above embodiments. For example... Figure 3 As shown, the industry knowledge Q&A device includes an acquisition module 101, an entity matching module 102, a path exploration module 103, a path determination module 104, and an answer generation module 105. Detailed descriptions of each functional module are as follows: The acquisition module 101 is used to acquire industry questions in natural language form, perform dense semantic encoding on the industry questions to obtain a question semantic vector, and perform sparse term encoding on the industry questions to obtain a question term vector; The entity matching module 102 is used to filter out candidate entities that match industry questions from the knowledge graph based on the first similarity between the question semantic vector and the entity semantic vector, and the second similarity between the question term vector and the entity term vector. The entity semantic vector is obtained by dense semantic encoding of the entity text information in the knowledge graph, and the entity term vector is obtained by sparse term encoding of the set of industry terms associated with the entity in the knowledge graph. The path exploration module 103 is used to explore paths in the knowledge graph with each candidate entity as the center, obtain the candidate paths corresponding to each candidate entity, convert each candidate path into natural language text, and then perform dense semantic encoding on the natural language text to obtain the path semantic vector corresponding to each candidate path. The path determination module 104 is used to determine the target path for the corresponding industry problem from the candidate paths based on the third similarity between the path semantic vector and the problem semantic vector. The answer generation module 105 is used to extract entity relationship information in the target path and combine it with the industry problem to use a large model for reasoning to generate the answer corresponding to the industry problem.
[0077] In one embodiment, the answer generation module 105 is specifically used for: Extract entity relationship information from the target path and generate a structured knowledge summary; Input the structured knowledge summary into the large model, and the large model will generate a logical reasoning chain based on the structured knowledge summary; Based on logical reasoning chains and combined with industry-specific questions, answers are generated in natural language format.
[0078] In one embodiment, the path exploration module 103 is specifically used for: By treating the candidate entities as head and tail entities respectively, bidirectional path exploration is conducted in the knowledge graph to obtain the candidate paths corresponding to each candidate entity.
[0079] In one embodiment, the path exploration module 103 is further configured to: The retrieval hop count for candidate paths in the knowledge graph is determined based on the first similarity between the question semantic vector and the entity semantic vector, and the second similarity between the question term vector and the entity term vector.
[0080] In one embodiment, the retrieval hop count of candidate paths in the knowledge graph is determined based on a first similarity between the question semantic vector and the entity semantic vector, and a second similarity between the question term vector and the entity term vector. Specifically, this includes: When the second similarity meets the preset matching conditions, the first hop count is used for path retrieval; when only the first similarity meets the preset matching conditions, the second hop count is used for path retrieval, and the first hop count is less than the second hop count.
[0081] In one embodiment, entity relationship information in the target path is extracted to generate a structured knowledge summary, specifically including: If there are multiple target paths, extract the entity relationship information from all target paths, and perform deduplication on the entity relationship information to obtain deduplicated entity relationship information. Generate a structured knowledge summary based on the deduplicated entity relationship information.
[0082] In one embodiment, generating a structured knowledge summary based on the deduplicated entity relationship information includes: A lightweight large model is used to extract and fuse information from the deduplicated entity relationship information to obtain a structured knowledge summary.
[0083] This invention provides an industry-specific knowledge question-answering device. By performing dense semantic encoding and sparse terminology encoding in parallel, and combining two similarity methods for candidate entity screening, it effectively solves the problem of insufficient adaptability to domain terms and synonyms in existing technologies. This allows for a more comprehensive and accurate recall of candidate entities related to the question, avoiding entity omissions due to terminology mismatch or semantic comprehension bias. The device converts candidate paths into natural language text and performs dense semantic encoding, then calculates the similarity between the path semantic vector and the question semantic vector to determine the target path. This effectively improves the efficiency and accuracy of multi-hop path search, efficiently focusing on knowledge paths highly relevant to the question's semantics. By extracting entity relationship information from the target path and combining it with industry-specific questions using a large model for reasoning, the device generates answers corresponding to the industry-specific questions. By providing refined entity relationship information, it guides the large model to perform targeted reasoning, ensuring the reliability and accuracy of the answers. Ultimately, this effectively improves the accuracy of answering industry-specific questions.
[0084] Specific limitations regarding the industry knowledge Q&A device can be found in the limitations of the industry knowledge Q&A method described above, and will not be repeated here. Each module in the aforementioned industry knowledge Q&A device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0085] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of an industry knowledge question-answering method server-side.
[0086] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements the functions or steps of a client-side industry knowledge question-and-answer method. In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: The system obtains industry-specific questions in natural language form, performs dense semantic encoding on the industry-specific questions to obtain a question semantic vector, and performs sparse term encoding on the industry-specific questions to obtain a question term vector. Based on the first similarity between the question semantic vector and the entity semantic vector, and the second similarity between the question term vector and the entity term vector, candidate entities matching industry questions are selected from the knowledge graph. The entity semantic vector is obtained by dense semantic encoding of the entity text information in the knowledge graph, and the entity term vector is obtained by sparse term encoding of the set of industry terms associated with the entity in the knowledge graph. Centered on each candidate entity, path exploration is carried out in the knowledge graph to obtain the candidate path corresponding to each candidate entity. Each candidate path is converted into natural language text, and then dense semantic encoding is performed on the natural language text to obtain the path semantic vector corresponding to each candidate path. Based on the third similarity between the path semantic vector and the question semantic vector, the target path for the corresponding industry question is determined from the candidate paths; Extract entity relationship information from the target path, and combine it with industry-specific questions to use a large model for reasoning, generating answers to the industry-specific questions.
[0087] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: The system obtains industry-specific questions in natural language form, performs dense semantic encoding on the industry-specific questions to obtain a question semantic vector, and performs sparse term encoding on the industry-specific questions to obtain a question term vector. Based on the first similarity between the question semantic vector and the entity semantic vector, and the second similarity between the question term vector and the entity term vector, candidate entities matching industry questions are selected from the knowledge graph. The entity semantic vector is obtained by dense semantic encoding of the entity text information in the knowledge graph, and the entity term vector is obtained by sparse term encoding of the set of industry terms associated with the entity in the knowledge graph. Centered on each candidate entity, path exploration is carried out in the knowledge graph to obtain the candidate path corresponding to each candidate entity. Each candidate path is converted into natural language text, and then dense semantic encoding is performed on the natural language text to obtain the path semantic vector corresponding to each candidate path. Based on the third similarity between the path semantic vector and the question semantic vector, the target path for the corresponding industry question is determined from the candidate paths; Extract entity relationship information from the target path, and combine it with industry-specific questions to use a large model for reasoning, generating answers to the industry-specific questions.
[0088] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0089] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0090] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0091] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.
[0092] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for answering industry-specific questions, characterized in that, include: The process involves obtaining industry-specific questions in natural language form, performing dense semantic encoding on the industry-specific questions to obtain a question semantic vector, and performing sparse term encoding on the industry-specific questions to obtain a question term vector. Based on the first similarity between the question semantic vector and the entity semantic vector, and the second similarity between the question term vector and the entity term vector, candidate entities matching the industry question are selected from the knowledge graph. The entity semantic vector is obtained by dense semantic encoding of the entity text information in the knowledge graph, and the entity term vector is obtained by sparse term encoding of the set of industry terms associated with the entity in the knowledge graph. Centered on each candidate entity, path exploration is performed in the knowledge graph to obtain the candidate path corresponding to each candidate entity. Each candidate path is converted into natural language text, and then dense semantic encoding is performed on the natural language text to obtain the path semantic vector corresponding to each candidate path. Based on the third similarity between the path semantic vector and the question semantic vector, the target path corresponding to the industry question is determined from the candidate paths; Extract entity relationship information from the target path, and combine it with the industry question to perform reasoning using a large model to generate the answer corresponding to the industry question.
2. The industry knowledge question-and-answer method according to claim 1, characterized in that, The step of extracting entity relationship information from the target path and combining it with the industry question to perform reasoning using a large model to generate the answer corresponding to the industry question includes: Extract entity relationship information from the target path and generate a structured knowledge summary; The structured knowledge summary is input into the large model, enabling the large model to generate a logical reasoning chain based on the structured knowledge summary; Based on the aforementioned logical reasoning chain and the industry-specific questions, an answer in natural language format is generated.
3. The industry knowledge question-and-answer method according to claim 1, characterized in that, The process of exploring paths within the knowledge graph, centered on each candidate entity, to obtain candidate paths corresponding to each candidate entity includes: The candidate entities are treated as head entities and tail entities, respectively, and bidirectional path exploration is performed in the knowledge graph to obtain the candidate paths corresponding to each candidate entity.
4. The industry knowledge question-and-answer method according to claim 1, characterized in that, The process of exploring paths within the knowledge graph, centered on each candidate entity, to obtain candidate paths corresponding to each candidate entity includes: The retrieval hop count of candidate paths in the knowledge graph is determined based on the first similarity between the question semantic vector and the entity semantic vector, and the second similarity between the question term vector and the entity term vector.
5. The industry knowledge question-and-answer method according to claim 4, characterized in that, The step of determining the retrieval hop count of candidate paths in the knowledge graph based on the first similarity between the question semantic vector and the entity semantic vector, and the second similarity between the question term vector and the entity term vector, includes: When the second similarity meets the preset matching conditions, the first hop count is used for path retrieval; When only the first similarity satisfies the preset matching condition, the second hop count is used for path retrieval, where the first hop count is less than the second hop count.
6. The industry knowledge question-and-answer method according to claim 2, characterized in that, Extract entity relationship information from the target path and generate a structured knowledge summary, including: If there are multiple target paths, the entity relationship information in all target paths is extracted, and the entity relationship information is deduplicated to obtain deduplicated entity relationship information. A structured knowledge summary is generated based on the deduplicated entity relationship information.
7. The industry knowledge question-and-answer method according to claim 6, characterized in that, The generation of structured knowledge summaries based on the deduplicated entity relationship information includes: A lightweight large model is used to extract and fuse the deduplicated entity relationship information to obtain the structured knowledge summary.
8. An industry knowledge question-and-answer device, characterized in that, include: The acquisition module is used to acquire industry questions in natural language form, perform dense semantic encoding on the industry questions to obtain a question semantic vector, and perform sparse term encoding on the industry questions to obtain a question term vector; The entity matching module is used to filter candidate entities that match the industry problem from the knowledge graph based on the first similarity between the question semantic vector and the entity semantic vector, and the second similarity between the question term vector and the entity term vector. The entity semantic vector is obtained by dense semantic encoding of entity text information in the knowledge graph, and the entity term vector is obtained by sparse term encoding of the set of industry terms associated with the entity in the knowledge graph. The path exploration module is used to explore paths in the knowledge graph with each candidate entity as the center, obtain the candidate paths corresponding to each candidate entity, convert each candidate path into natural language text, and then perform dense semantic encoding on the natural language text to obtain the path semantic vector corresponding to each candidate path. The path determination module is used to determine the target path corresponding to the industry problem from the candidate paths based on the third similarity between the path semantic vector and the problem semantic vector; The answer generation module is used to extract entity relationship information in the target path, and combine it with the industry question to perform reasoning using a large model to generate the answer corresponding to the industry question.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the industry knowledge question-answering method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the industry knowledge question-answering method as described in any one of claims 1 to 7.