Question and answer method and device based on generative large model, electronic equipment and storage medium
By combining generative large models with knowledge graphs, core entities and knowledge fragments are dynamically retrieved, solving the problem of low accuracy in generated answers and achieving efficient and accurate responses to complex questions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEFEI IFLY DIGITAL TECH CO LTD
- Filing Date
- 2025-12-04
- Publication Date
- 2026-05-12
AI Technical Summary
Existing generative large models have low accuracy in generating answers, making it difficult to meet the needs of answering complex questions.
By combining a generative large model with a pre-built target knowledge graph, the core entities and related knowledge fragments in the information to be retrieved are identified. The entity embedding vectors are used to indicate the semantics of the graph, and multi-level dynamic retrieval is performed until the answer is generated.
It improves the accuracy of generated answers by deeply integrating entity semantics with knowledge structure, enabling precise matching and efficient responses to complex questions.
Smart Images

Figure CN122019561A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a question-answering method, apparatus, electronic device, and storage medium based on a generative large model. Background Technology
[0002] With the rapid development of artificial intelligence, especially generative large language models (LLMs), the knowledge accuracy, reasoning ability, and retrieval ability of these models have become research hotspots. When using large models to generate answers to user questions, these models often need to first retrieve information related to the user's question from external databases, and then combine this relevant information to generate the results.
[0003] However, the retrieval process often focuses on text surface similarity matching, obtaining the answer through a single retrieval step, resulting in low accuracy of the generated answer and difficulty in meeting the needs of answering complex questions. Summary of the Invention
[0004] This application provides a question-answering method, apparatus, electronic device, and storage medium based on a generative large model to solve the problem of low accuracy in generating answers in the prior art.
[0005] According to a first aspect of the embodiments of this application, a question-answering method based on a generative large model is provided, comprising: Obtain the original question input by the user; The information to be retrieved is determined from the original question based on a generative large model; The following generation process is performed using the generative large model: Based on a pre-constructed target knowledge graph, the core entity most relevant to the information to be retrieved, the knowledge fragments related to the core entity, and the core entity embedding vector corresponding to the core entity are determined. The core entity embedding vector is used to indicate the graph semantics of the core entity in the target knowledge graph. Retrieval content is generated based on the information to be retrieved, the knowledge fragments, and the core entity embedding vector. The information to be retrieved is updated based on the retrieval content and the original question. Repeat the generation process until the answer to the original question is determined based on the generated search results.
[0006] Optionally, based on a pre-constructed target knowledge graph, the core entities most relevant to the information to be retrieved are determined, including: Identify the initial entity in the information to be retrieved; The entity in the target knowledge graph that has the highest relevance to the initial entity knowledge is identified as the core entity.
[0007] Optionally, the knowledge relevance includes semantic relevance and entity relevance. Determining the entity in the target knowledge graph with the highest knowledge relevance to the initial entity as the core entity includes: Generate the initial entity vector of the initial entity in the information to be retrieved; Generate the initial semantic vector of the information to be retrieved; Determine the candidate entity embedding vectors related to the initial entity vector from the entity embedding vectors of the target knowledge graph; Generate candidate semantic vectors for the candidate entities corresponding to the candidate entity embedding vectors; Based on the similarity between the initial semantic vector and each of the candidate semantic vectors, the target semantic vector that is most relevant to the initial semantic vector among the candidate semantic vectors is determined; The candidate entity corresponding to the target semantic vector is determined as the core entity.
[0008] Optionally, the information to be retrieved is determined from the original question based on a generative large model, including: Based on the generative large model, the original problem is split into at least one sub-problem; Determine the first target sub-problem to be retrieved from the at least one sub-problem; The information to be retrieved is determined from the target sub-problem.
[0009] Optionally, before obtaining the original question input by the user, the following steps are also included: Construct an initial knowledge graph for the target domain, the initial knowledge graph including entities in the target domain and the relationships between the entities; The initial knowledge graph is encoded using a graph convolutional network to obtain entity embedding vectors for each entity. The entity embedding vectors are used to represent the graph semantics of the entity in the target knowledge graph. The graph semantics include the semantic position of the entity in the target knowledge graph and its association with other entities. The target knowledge graph is determined based on the initial knowledge graph and the entity embedding vector.
[0010] Optionally, before obtaining the original question input by the user, the following steps are also included: Obtain training samples, which include sample questions and the corresponding sample true answers to the sample questions; Based on the generative large model, at least one piece of information to be retrieved is determined from the sample question, and the generation process is performed on each piece of information to be retrieved to obtain the sample generated answer corresponding to each piece of information to be retrieved. Using pre-configured reward rules, and based on the actual answers of the samples, the generation reward information for each sample's generated answer is determined; The generative large model is optimized based on the generated reward information.
[0011] Optionally, the reward rules include at least one of the following: Determine whether the sample-generated answer is generated according to the specified generation rules; Determine whether the sample-generated answer covers the core entities in the sample question; Determine whether the generated answer of the sample is consistent with the actual answer of the sample.
[0012] According to a second aspect of the embodiments of this application, a question-answering device based on a generative large model is provided, comprising: The acquisition unit is used to acquire the original question input by the user; A determining unit is used to determine the information to be retrieved from the original question based on a generative large model; The generation unit is configured to perform the following generation process through the generative large model: based on a pre-constructed target knowledge graph, determine the core entity most relevant to the information to be retrieved, the knowledge fragments related to the core entity, and the core entity embedding vector corresponding to the core entity, wherein the core entity embedding vector is used to indicate the graph semantics of the core entity in the target knowledge graph; generate retrieval content based on the information to be retrieved, the knowledge fragments, and the core entity embedding vector; update the information to be retrieved based on the retrieval content and the original question; repeat the generation process until the answer to the original question is determined based on the generated retrieval content.
[0013] According to a third aspect of the embodiments of this application, an electronic device is provided, including a memory and a processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the question-answering method based on a generative large model as described in the first aspect by running the program in the memory.
[0014] According to a fourth aspect of the embodiments of this application, a storage medium is provided, on which a computer program is stored, and when the computer program is run by a processor, it implements the question-answering method based on a generative large model as described in the first aspect.
[0015] According to a fifth aspect of the embodiments of this application, a computer program product is provided, including computer program instructions that, when executed by a processor, cause the processor to perform the question-answering method based on a generative large model as described in the first aspect.
[0016] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application obtains the original question input by the user; determines the information to be retrieved from the original question based on a generative large model; and performs the following generation process through the generative large model: based on a pre-constructed target knowledge graph, determines the core entity most relevant to the information to be retrieved, the knowledge fragments related to the core entity, and the core entity embedding vector corresponding to the core entity, the core entity embedding vector being used to indicate the graph semantics of the core entity in the target knowledge graph; generates retrieval content based on the information to be retrieved, the knowledge fragments, and the core entity embedding vector; updates the information to be retrieved based on the retrieval content and the original question; and repeats the generation process until the answer to the original question is determined based on the generated retrieval content. Thus, by using a generative large model to locate highly related core entities and knowledge fragments in the target knowledge graph based on the input information to be retrieved, and through the deep integration of entity semantics and knowledge structure, improves the accurate matching between the generated retrieval content and the input information to be retrieved, and further, through multi-level dynamic retrieval, makes the answer to the original question more accurate. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0018] Figure 1 A flowchart of a question-answering method based on a generative large model is provided for one embodiment of this application.
[0019] Figure 2 A flowchart of a question-answering method based on a generative large model is provided for another embodiment of this application.
[0020] Figure 3 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] Exemplary Implementation Environment The question-answering method based on a generative large model according to embodiments of this application can be executed by electronic devices such as terminal devices or servers. Terminal devices can be user equipment (UE), mobile devices, user terminals, terminals, cellular phones, cordless phones, personal digital assistants (PDAs), handheld devices, computing devices, in-vehicle devices, wearable devices, etc. Servers can be independent physical servers, server clusters composed of multiple physical servers, or cloud servers capable of cloud computing. This method can be implemented by a processor calling computer-readable program instructions stored in memory. This application uses the execution of a question-answering method based on a generative large model by a server as an example for explanation, but does not limit it.
[0023] Exemplary methods Please see Figure 1 In one exemplary embodiment, a question-answering method based on a generative large model is provided, including: Step 101: Obtain the original question input by the user.
[0024] In some embodiments, the original question can be input by the user through an interactive interface (such as a webpage or application), which can receive the original question input by the user. The original question can be a piece of text; for example, in a machinery maintenance application, it can be content describing a equipment malfunction.
[0025] In an optional embodiment, before obtaining the original question input by the user, the method further includes: Construct an initial knowledge graph for the target domain, the initial knowledge graph including entities in the target domain and the relationships between the entities; The initial knowledge graph is encoded using a graph convolutional network to obtain entity embedding vectors for each entity. The entity embedding vectors are used to represent the graph semantics of the entity in the target knowledge graph. The graph semantics include the semantic position of the entity in the target knowledge graph and its association with other entities. The target knowledge graph is determined based on the initial knowledge graph and the entity embedding vector.
[0026] In some embodiments, corresponding knowledge graphs can be constructed according to different domains. Discrete knowledge can be connected through the knowledge graph and edited into a logical network. When searching for the answer to the original question, related words can be expanded for searching, and information can be found more comprehensively and accurately. Especially in question-answering systems, the knowledge graph can be searched and reasoned directly based on the semantics of the user's question to provide an accurate answer.
[0027] The knowledge graph uses entities as nodes and relationships between entities as edges, forming a multi-faceted semantic relationship network. Nodes and edges in the knowledge graph can contain the following information: entity name, type, and attributes; relationships between entities, including but not limited to hierarchical relationships, causal relationships, temporal relationships, and attribute relationships. By constructing an initial knowledge graph of entities in the target domain, the model ensures high coverage and refined answering capabilities in diverse and open-ended question-answering scenarios.
[0028] After obtaining the initial knowledge graph, in order to capture the multi-level semantic relationships in the knowledge graph, this invention uses a Graph Convolutional Network (GCN) to encode the knowledge graph.
[0029] Each node in GCN carries a "relationship" (i.e., an edge). It first calculates the influence weight of each neighbor on the central node based on the connections between nodes. Then, using these weights, it merges the central node's own features with the neighbor features to obtain new features that reflect the "relationship attribute." Simply put, GCN allows nodes to update more valuable feature vectors—the entity embedding vectors mentioned above—by leveraging their connections with each other.
[0030] Entity embedding vectors generated through graph convolution enable deep semantic modeling of entities. Retrieval relies not only on surface text matching but also emphasizes the structured relationships between entities, improving retrieval accuracy. Furthermore, the retrieved data includes not only text paragraphs but also triples, attribute information, and related entities, providing multi-dimensional knowledge support for the generative model. This results in diverse retrieval results, supporting both structured and textual information, leading to superior retrieval outcomes.
[0031] When encoding the initial knowledge graph, a vector representation can be initialized for each entity node, combined with the entity's attribute word vectors and contextual information. Through a multi-layer graph convolutional network, the information of adjacent entities is aggregated to learn the higher-order semantic representation of the entities, thereby outputting entity embedding vectors to characterize the graph semantics of the entities in the global knowledge graph. The graph semantics include, but are not limited to, the semantic position of the entity in the target knowledge graph, as well as the association relationship between the entity and other entities. Other entities refer to entities in the knowledge graph other than the entity in question.
[0032] By introducing a knowledge graph convolutional neural network, explicit knowledge modeling capabilities are provided. Multi-level encoding of the knowledge graph yields high-dimensional vector representations of complex relationships between entities, enabling the model to reason using structured knowledge rather than relying solely on implicit statistical information in the corpus. High-dimensional encoding of entities and their complex relationships within the knowledge graph captures multi-level semantic and structured associations between entities, providing rich and interpretable domain knowledge support for generative large-scale models and enhancing the model's knowledge acquisition and application capabilities in domain tasks. By encoding the initial knowledge graph of the target domain into node representations of a graph convolutional neural network, capturing structured associations between entities, rich and interpretable external knowledge can be injected into the model.
[0033] The generated entity embedding vector corresponds one-to-one with the entities in the initial knowledge graph. The correspondence between the two can be stored, and the entity embedding vector can be bound to the entities in the initial knowledge graph to obtain the target knowledge graph.
[0034] The target knowledge graph can be a collection of knowledge graphs from multiple domains, or it can be a knowledge graph from a specific domain. These domains can include, but are not limited to, medicine, law, finance, and scientific research.
[0035] In an optional embodiment, before obtaining the original question input by the user, the method further includes: Obtain training samples, which include sample questions and the corresponding sample true answers to the sample questions; Based on the generative large model, at least one piece of information to be retrieved is determined from the sample question, and the generation process is performed on each piece of information to be retrieved to obtain the sample generated answer corresponding to each piece of information to be retrieved. Using pre-configured reward rules, and based on the actual answers of the samples, the generation reward information for each sample's generated answer is determined; The generative large model is optimized based on the generated reward information.
[0036] In some embodiments, to improve the accuracy of the generative large model in generating answers, it can be trained before being used to generate answers. Through a designed reinforcement learning reward mechanism, optimizations are made for the knowledge accuracy, entity consistency, and usability of the generated text, guiding the large model towards knowledge-driven training.
[0037] The training samples can include multiple sample questions and corresponding sample true answers for each sample question. The generative large model generates answers using a multi-level dynamic retrieval approach. First, it determines a sub-question from the user's input question. After obtaining the answer to the sub-question, the generative large model determines the next sub-question for which an answer needs to be generated, and generates the answer to the next sub-question, repeating this process until the answer to the user's input question is obtained. Based on this, the generative large model may have multiple dynamic retrieval paths for the same question. To ensure the generative large model inputs more accurate answers, a reward function can be set to evaluate different retrieval paths, enabling the generative large model to determine the retrieval path that generates the more accurate answer during training.
[0038] For example, the sample question is "What is the relationship between the founder of Company A and the founder of Company B?" The generative big data model can have the following retrieval paths for this question: first, search for "Who is the founder of Company A?"; second, search for "Who is the founder of Company B?"; third, search for "What is the relationship between Company A and Company B?"; and so on. After obtaining the answer to the above question, it performs another retrieval based on the answer. The final answers obtained from these three retrieval paths may differ. By calculating the reward information for the sample answers generated under each retrieval path, the generative big data model is fed back, enabling it to know how to generate highly accurate answers.
[0039] Understandably, during training, knowledge graph convolution, entity retrieval, and generative large-scale models can be integrated into a unified framework through joint training. The generative answer model simultaneously learns how to understand input, how to retrieve relevant knowledge, and how to generate text that conforms to knowledge constraints; through reinforcement learning optimization, it breaks the limitations of the traditional loose coupling of "retrieval-generation". By adopting a joint training strategy, deep integration of the entity retrieval module and the generative model in the knowledge graph and generative large-scale model is achieved, effectively improving the model's generation accuracy and robustness on professional domain problems.
[0040] The training process for generative large-scale models can employ the Policy Gradient method or an algorithm combining Reward Modeling and Proximal Policy Optimization (PPO). By training these models, the probability of generating high-quality answers can be increased based on reward signals; the tendency to generate content that conflicts with knowledge, contains entity errors, or is irrelevant can be reduced; and end-to-end training can be achieved, enabling retrieval, graph encoding, and generation models to co-evolve within the same optimization framework. This training method allows the model to not only generate fluent text but also ensure accurate knowledge, entity consistency, and usability of answers.
[0041] In one alternative embodiment, the reward rule includes at least one of the following: Determine whether the sample-generated answer is generated according to the specified generation rules; Determine whether the sample-generated answer covers the core entities in the sample question; Determine whether the generated answer of the sample is consistent with the actual answer of the sample.
[0042] In some embodiments, to optimize the knowledge accuracy and entity consistency of the generated results, the present invention designs the following reward rules, including: Rule-based reward: This determines whether the sample's generated answer follows the specified generation rules. Specifically, it determines whether the generated sample's answer strictly adheres to the prescribed thinking-retrieval-reasoning-response rules.
[0043] Entity coverage reward: This refers to determining whether the answer generated by the sample covers the core entities in the sample question.
[0044] Result reward: This refers to determining whether the answer generated by the sample is consistent with the actual answer of the sample.
[0045] The corresponding reward value is calculated based on the generated answers from the samples according to the aforementioned reward rules. Reward information is then calculated based on these reward values, and this reward information is used to optimize the generative model. Specifically, different weights can be assigned to each reward rule, and the reward information is obtained by weighted summation of the reward values.
[0046] By setting up a reinforcement learning reward mechanism, the following metrics—knowledge accuracy, entity consistency, and answer usability—are automatically evaluated and optimized from the generated results. Through reinforcement learning, these metrics are refined and optimized to guide the model to generate text that is more consistent with real knowledge and is more usable and reliable.
[0047] By employing end-to-end joint training, knowledge graph convolutional encoding, dynamic entity retrieval, generative models, and reinforcement learning reward mechanisms are integrated into a single training framework. This enables parameter sharing and gradient propagation among modules, jointly optimizing the knowledge retrieval, encoding, and generation processes, significantly improving the overall performance and generalization ability of the model. This joint optimization not only enhances the model's efficiency in utilizing domain knowledge but also simplifies the system architecture, reduces engineering complexity, and improves training and inference efficiency.
[0048] Step 102: Determine the information to be retrieved from the original question based on the generative large model.
[0049] In some embodiments, the generative large model can be, but is not limited to, a large language model (LLM). An LLM is a natural language processing system with more than 100 billion parameters and can be used in various scenarios such as content generation, text summarization, chatbots, and code writing.
[0050] When the original question input by the user is complex, the answer directly output by LLM may not be accurate enough. Therefore, it is possible to extract the information to be retrieved from the original question and perform multiple searches to obtain the corresponding answer. The information to be retrieved can be an entity identified from the original question or a sub-question identified from the original question.
[0051] In one alternative embodiment, the information to be retrieved is determined from the original question based on a generative large model, including: Based on the generative large model, the original problem is split into at least one sub-problem; Determine the first target sub-problem to be retrieved from the at least one sub-problem; The information to be retrieved is determined from the target sub-problem.
[0052] In some embodiments, the generative large model determines the information to be retrieved in various ways. For example, it can first determine the key information in the original question, and then determine the information to be retrieved first based on the determined key information; or it can directly extract the information to be retrieved from the original question. The information to be retrieved may include, but is not limited to, entities and information such as entity attributes and types. Alternatively, the generative large model can decompose the original question into at least one sub-question, select the target sub-question to be retrieved first, and determine the entities and related information from the target sub-question as the information to be retrieved.
[0053] For example, the original question is "What is the relationship between the founder of Company A and the founder of Company B?" The generative big data model breaks down this original question into the following sub-questions: confirm who the founder of Company A is, confirm who the founder of Company B is, and query whether there is any relationship between these two founders. After obtaining the above sub-questions, the generative big data model determines to first query the founder of Company A. Then, it extracts the entity as Company A and the attribute information as the founder, and uses Company A and the founder as the information to be retrieved from the target knowledge graph.
[0054] The following generation process is performed using the generative large model: Step 103: Based on the pre-constructed target knowledge graph, determine the core entity most relevant to the information to be retrieved, the knowledge fragments related to the core entity, and the core entity embedding vector corresponding to the core entity. The core entity embedding vector is used to indicate the graph semantics of the core entity in the target knowledge graph. Generate retrieval content based on the information to be retrieved, the knowledge fragments, and the core entity embedding vector. Update the information to be retrieved based on the retrieval content and the original question.
[0055] Based on the aforementioned embodiments, the target knowledge graph includes an initial knowledge graph and entity embedding information corresponding to entities within the initial knowledge graph. During the retrieval process, the generative big data model retrieves the core entities most relevant to the information to be retrieved from the target knowledge graph, retrieves knowledge fragments related to the core entities, and retrieves the core entity embedding information corresponding to the core entities. Based on the information to be retrieved, the retrieved knowledge fragments, and the core entity embedding vectors, it generates retrieval content, thereby determining the retrieval result for this retrieval. For complex problems where the answer to the original question cannot be obtained in a single retrieval, the generative big data model can reconsider based on the retrieval content and the original question after one retrieval of the information to be retrieved, determine the information to be retrieved for the next retrieval, and retrieve it again. By repeating the above operations until no more information to be retrieved is extracted from the original question, the answer to the original question is determined using the retrieved content.
[0056] By leveraging the synergy of dynamic knowledge encoding and retrieval, this method not only generates static embedding vectors for the knowledge graph but also incorporates an entity retrieval mechanism to achieve dynamic knowledge injection for different inputs, enhancing the high degree of consistency between the generated results and the input context. During training, multi-dimensional reward signals such as knowledge matching, entity consistency, factual accuracy, and usability are designed, and reinforcement learning is used to finely optimize the generated results—a capability not found in existing static embedding-based methods. Furthermore, it supports triggering entity recognition and retrieval again based on the generated intermediate text during the generation process, forming a closed-loop process of "retrieval—generation—re-retrieval," effectively improving the flexibility of knowledge utilization and generation accuracy under complex problems. Existing technologies mostly involve single-time knowledge injection and lack cyclical optimization capabilities.
[0057] In this way, not only can the model be trained to memorize knowledge, but it can also dynamically retrieve the most relevant knowledge fragments based on the input context, achieving precise knowledge utilization for specific problems. The generated search content is not only fluent, but can also point to entities or triples in specific knowledge graphs, improving the interpretability and user trust of the generated results.
[0058] In this process, after obtaining the information to be retrieved, the knowledge fragment, and the core entity embedding vector, the generative large model can generate a retrieval vector from the information to be retrieved and perform vector representation on the knowledge fragment to obtain a knowledge fragment vector. By concatenating or fusing the retrieval vector, the knowledge fragment vector, and the core entity embedding vector, the generative large model is used as input. Information interaction is achieved through a multi-head attention mechanism, the encoder captures the global dependency relationship between the input and the knowledge, and the decoder generates the retrieval content based on the comprehensive context.
[0059] By embedding the retrieved knowledge into the generative model, achieving information interaction through a multi-head attention mechanism, and performing end-to-end optimization during training rather than simply concatenating the input, the linkage effect between retrieval and generation is significantly enhanced.
[0060] It is understandable that there is at least one core entity. When there are multiple core entities, the generative big model generates search content based on the knowledge fragments corresponding to each core entity, the core entity embedding vector, and the information to be searched.
[0061] The aforementioned knowledge fragments may include, but are not limited to, triple information related to the core entity, attribute descriptions, and information about upstream and downstream related entities. The retrieved information can be structured or presented as a textual contextual prompt to obtain the aforementioned knowledge fragments.
[0062] In one optional embodiment, based on a pre-constructed target knowledge graph, the core entities most relevant to the information to be retrieved are determined, including: Identify the initial entity in the information to be retrieved; The entity in the target knowledge graph that has the highest relevance to the initial entity knowledge is identified as the core entity.
[0063] In some embodiments, when the generative large model directly determines the information to be retrieved from the original problem, the initial entity can be determined directly from the information to be retrieved based on the type of data in the information to be retrieved; when the information to be retrieved is obtained from the target sub-problem determined by the generative large model, entity recognition can be performed on the target sub-problem to obtain the initial entity.
[0064] After obtaining the initial entities, the generative large model searches the target knowledge graph to determine the core entities with the highest knowledge relevance to the initial entities. Knowledge relevance includes semantic relevance and entity relevance. Semantic relevance refers to the degree of association between entities in the target knowledge graph in terms of meaning, logic, context, and other semantic dimensions. Entity relevance refers to the degree of association between entities themselves.
[0065] The entity-centric dynamic retrieval mechanism can quickly locate core entities in the target knowledge graph based on the input context, and retrieve knowledge fragments that are highly related to the entity and its relationships, thereby achieving a deep integration of entity semantics and knowledge structure and improving the accuracy of the generated retrieval content or answer in matching the input context.
[0066] In an optional embodiment, determining the core entity as the entity in the target knowledge graph that has the highest relevance to the initial entity knowledge includes: Generate the initial entity vector of the initial entity in the information to be retrieved; Generate the initial semantic vector of the information to be retrieved; Determine the candidate entity embedding vectors related to the initial entity vector from the entity embedding vectors of the target knowledge graph; Generate candidate semantic vectors for the candidate entities corresponding to the candidate entity embedding vectors; Based on the similarity between the initial semantic vector and each of the candidate semantic vectors, the target semantic vector that is most relevant to the initial semantic vector among the candidate semantic vectors is determined; The candidate entity corresponding to the target semantic vector is determined as the core entity.
[0067] In some embodiments, an initial semantic vector can be generated from the information to be retrieved using a semantic encoder (e.g., a BGE model), and an initial entity vector can be generated from the initial entities. Since the target knowledge graph includes entity embedding vectors corresponding to each entity, after obtaining the initial entity vectors, candidate entity embedding vectors related to the initial entity vectors can be determined from the entity embedding vectors based on entity relevance. For example, the top ten entity embedding vectors with the highest entity relevance to the initial entity vectors can be selected as candidate entity embedding vectors. Furthermore, candidate entities corresponding to the candidate entity embedding vectors can be determined from the target knowledge graph. These candidate entities are then semantically encoded to obtain candidate semantic vectors. Based on semantic relevance, the target semantic vector most relevant to the initial semantic vector is selected from the candidate semantic vectors. For example, the top three candidate semantic vectors with the highest semantic relevance to the initial semantic vector are selected as the target semantic vector. Finally, the candidate entities corresponding to the target semantic vectors are determined as core entities from the target knowledge graph.
[0068] By retrieving semantic and entity relevance of the information to be retrieved in the target knowledge graph, and by using entity embedding vectors to carry the graph semantics of the entities, the generative large model combines the input context of the information to be retrieved, thereby improving the model's understanding of the domain entity collection context and enabling the subsequent generated answers to be more accurate.
[0069] Step 104: Repeat the generation process until the answer to the original question is determined based on the generated search content.
[0070] In some embodiments, by repeatedly executing the above generation process, the generative large model completes the retrieval of each entity in the original question. Then, the generative large model determines the answer to the original question based on the generated retrieval content. Since the retrieval content comes from a reliable target knowledge graph, obtaining information from these resources to determine the answer avoids errors that may occur if relying solely on the model's own knowledge reserves, reduces model "illusion" phenomena, and makes the answer more consistent with objective facts. It eliminates the need to encode all knowledge into the model's parameters; knowledge only needs to be obtained from the knowledge graph through the retrieval mechanism, saving significant training data and computational resources, and reducing the cost and difficulty of model training. For complex problems, multiple iterations of retrieval and enhancement generate more accurate and comprehensive answers.
[0071] By using the dynamic entity vectors output by the knowledge graph convolution and the entity retrieval results as input features of the generative model, and designing a reinforcement learning reward function with the knowledge accuracy, entity consistency and answer usability of the generated content as optimization objectives, an end-to-end joint training framework is constructed to achieve deep integration of knowledge graph, entity retrieval and generative large model.
[0072] This application's question-answering method based on generative large models breaks through the limitations of "pure text pre-training" in related technologies. By integrating the structured knowledge of knowledge graphs with entity retrieval capabilities, it creates a next-generation generative large model with accurate domain knowledge utilization, flexible reasoning, and guaranteed generation quality, providing more reliable intelligent generation services for various professional fields (such as medicine, law, finance, scientific research, etc.).
[0073] For example, the question-answering method for the generative large model in this application uses ontology information in the target knowledge graph, including: entity type (e.g., company, person, location, etc.), attributes (e.g., founder, establishment time, industry, headquarters location, etc. for companies; birth province, birth date, nationality, occupation, etc. for people; country, province, etc. for locations), and relationships (e.g., competitive relationship, cooperative relationship, subordinate relationship, geographical inclusion relationship, personal cooperative relationship). The generative large model is configured with the following generation rules: Whenever you receive new information, you must first... <think> and< / think> Use tags to make inferences. If you find yourself lacking knowledge, you can specify... <entity> 、 <attribute>or <relation>Use this tool to query the knowledge graph. You can query it as many times as you like. If you find that you don't need further external knowledge, you can directly... <answer> and< / answer> The answer is provided within. For example: <answer> Beijing< / answer> .
[0074] Taking the original question "What is the relationship between the founders of Company A and Company B?" as an example, the generation process of the generative large model can be as follows: Generative Large Model (LLM) obtains the original question (query): What is the relationship between the founders of Company A and Company B? The following considerations are made regarding generative large-scale models: <think> To answer this question, I need to: confirm who the founder of Company A is, confirm who the founder of Company B is, and check if there is any relationship between these two founders. I will first check the founder of Company A.< / think> <entity> Company A< / entity> <attribute> Founder< / attribute> <information> Entity ID: entity_A Name: Company A Type: Company Attribute: Founder = Zhang San Entity embedding vector: [0.120, -0.358, 0.442, 0.055,...,-0.217, 0.333, -0.098, 0.624] < / information> The generative large model cannot obtain the answer based on the above information and still requires further external knowledge; therefore, it needs to be queried again. <think> Company A's founder is Zhang San. Next, we need to find the founder of Company B.< / think> <entity> Second< / entity> <attribute> Founder< / attribute> <information> Entity ID: entity_B Name: B Type: Company Attribute: Founder = Li Si Entity embedding vector: [-0.145, 0.276, 0.501, -0.312,..., 0.189, 0.078, 0.664, -0.452] < / information> <think> The founder of B is Li Si. Now we need to determine if there is a relationship between Zhang San and Li Si.< / think> <entity> Zhang San< / entity> <entity> Li Si< / entity> <relation> All direct relationships< / relation> <information> Entity 1: Entity ID: entity_张三 Name: 张三 Type: Person Entity Embedding Vector: [-0.156, 0.289, 0.475, -0.210,..., 0.366, -0.421, 0.182, 0.094] Entity 2: Entity ID: entity_李四 Name: 李四 Type: Person[[ID=1|8]] Entity Embedding Vector: [0.188, -0.244, 0.522, -0.378, 0.144,...,-0.012, 0.217, -0.361] Relationship: Not retrieved < / information> <think> The query results show that Zhang San and Li Si have no direct relationship in the knowledge graph.< / think> <answer> There is no direct relationship.< / answer> This application proposes a question-answering method based on generative large models, which offers a holistic innovation from knowledge acquisition, knowledge encoding, retrieval mechanisms to training methods.
[0075] By using Graph Convolutional Networks (GCNs) to encode domain knowledge graphs at multiple levels, high-dimensional entity vector representations, namely entity embedding vectors, are generated. This allows entity vectors to not only contain the semantics of the entity itself, but also incorporate various relational information such as hierarchical, causal, and attribute information with other entities. This enables deep structural modeling of domain knowledge and provides a foundation for injecting accurate and interpretable knowledge information into subsequent generative models.
[0076] The system dynamically identifies core entities based on the input text and retrieves highly relevant entities and relationships from the knowledge graph through entity vector similarity search. The retrieval results are not limited to text fragments but also include structured knowledge triples, entity attribute information, and upstream and downstream entity relationships, providing more reliable knowledge for subsequent answer generation. A generative large-scale model dynamically generates knowledge graph-oriented retrieval methods: entity attribute and entity relationship retrieval, achieving a deep integration of entity semantics and knowledge structure. This improves the accuracy of matching generated content with the input context. Finally, the retrieved knowledge fragments are input into the generative model in vector or text prompt form.
[0077] See Figure 2 The model takes user input (query), entity embedding vectors (entity embeddings) output by knowledge graph convolution, and entity retrieval results (search) as input to the generative model (LLM). By fusing the input information through a multi-head attention mechanism, the model can simultaneously pay attention to the context and domain knowledge during the generation process, thereby improving the accuracy of the generated results.
[0078] Based on the ideas of search-r1, a reinforcement learning training framework for knowledge-driven text generation was designed. A multi-dimensional reward function was proposed, including knowledge matching reward, entity coverage reward, factual accuracy reward, and usability reward, to optimize the knowledge accuracy, entity consistency, and actual usability of the generated text, and to achieve end-to-end joint training of retrieval, knowledge encoding fusion and generation models.
[0079] During the generation process, the model can trigger entity recognition and knowledge retrieval again based on the generated intermediate text, forming a closed-loop optimization process of "retrieval-generation-re-retrieval". Through multiple rounds of retrieval and generation interaction, the model's flexibility in knowledge retrieval and accuracy in answering complex questions are improved.
[0080] This approach integrates knowledge graph convolutional networks, entity retrieval mechanisms, and generative large models within a unified training framework. End-to-end joint optimization enhances the overall system performance. During training, the retrieval module, knowledge graph encoding module, and generation module share gradient updates, achieving deep coupling among the three components.
[0081] Breaking through the bottlenecks of existing generative large models, such as "superficial knowledge utilization, lack of dynamic reasoning, and insufficient reliability of generated results," this paper achieves a comprehensive improvement in the generative large model in terms of domain knowledge utilization, reasoning ability, and reliability of generated content by deeply integrating knowledge graph convolution, entity retrieval mechanism, and reinforcement learning training. This provides more accurate, efficient, and interpretable intelligent generation solutions for professional fields such as medicine, law, finance, and scientific research.
[0082] Exemplary device Accordingly, embodiments of this application also provide a question-answering device based on a generative large model, including: The acquisition unit is used to acquire the original question input by the user; A determining unit is used to determine the information to be retrieved from the original question based on a generative large model; The generation unit is configured to perform the following generation process through the generative large model: based on a pre-constructed target knowledge graph, determine the core entity most relevant to the information to be retrieved, the knowledge fragments related to the core entity, and the core entity embedding vector corresponding to the core entity, wherein the core entity embedding vector is used to indicate the graph semantics of the core entity in the target knowledge graph; generate retrieval content based on the information to be retrieved, the knowledge fragments, and the core entity embedding vector; update the information to be retrieved based on the retrieval content and the original question; repeat the generation process until the answer to the original question is determined based on the generated retrieval content.
[0083] Optionally, based on a pre-constructed target knowledge graph, the core entities most relevant to the information to be retrieved are determined, including: Identify the initial entity in the information to be retrieved; The entity in the target knowledge graph that has the highest relevance to the initial entity knowledge is identified as the core entity.
[0084] Optionally, the knowledge relevance includes semantic relevance and entity relevance. Determining the entity in the target knowledge graph with the highest knowledge relevance to the initial entity as the core entity includes: Generate the initial entity vector of the initial entity in the information to be retrieved; Generate the initial semantic vector of the information to be retrieved; Determine the candidate entity embedding vectors related to the initial entity vector from the entity embedding vectors of the target knowledge graph; Generate candidate semantic vectors for the candidate entities corresponding to the candidate entity embedding vectors; Based on the similarity between the initial semantic vector and each of the candidate semantic vectors, the target semantic vector that is most relevant to the initial semantic vector among the candidate semantic vectors is determined; The candidate entity corresponding to the target semantic vector is determined as the core entity.
[0085] Optionally, the information to be retrieved is determined from the original question based on a generative large model, including: Based on the generative large model, the original problem is split into at least one sub-problem; Determine the first target sub-problem to be retrieved from the at least one sub-problem; The information to be retrieved is determined from the target sub-problem.
[0086] Optionally, a graph construction module is also included, which is used for: Construct an initial knowledge graph for the target domain, the initial knowledge graph including entities in the target domain and the relationships between the entities; The initial knowledge graph is encoded using a graph convolutional network to obtain entity embedding vectors for each entity. The entity embedding vectors are used to represent the graph semantics of the entity in the target knowledge graph. The graph semantics include the semantic position of the entity in the target knowledge graph and its association with other entities. The target knowledge graph is determined based on the initial knowledge graph and the entity embedding vector.
[0087] Optionally, a training module may also be included, which is used for: Obtain training samples, which include sample questions and the corresponding sample true answers to the sample questions; Based on the generative large model, at least one piece of information to be retrieved is determined from the sample question, and the generation process is performed on each piece of information to be retrieved to obtain the sample generated answer corresponding to each piece of information to be retrieved. Using pre-configured reward rules, and based on the actual answers of the samples, the generation reward information for each sample's generated answer is determined; The generative large model is optimized based on the generated reward information.
[0088] Optionally, the reward rules include at least one of the following: Determine whether the sample-generated answer is generated according to the specified generation rules; Determine whether the sample-generated answer covers the core entities in the sample question; Determine whether the generated answer of the sample is consistent with the actual answer of the sample.
[0089] The question-answering device based on a generative large model provided in this embodiment belongs to the same application concept as the question-answering method based on a generative large model provided in the above embodiments of this application. It can execute the method provided in any of the above embodiments of this application and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in this embodiment can be found in the specific processing content of the question-answering method based on a generative large model provided in the above embodiments of this application, and will not be repeated here.
[0090] The functions implemented by each unit in the above-mentioned generative large model-based question answering device can be implemented by the same or different processors, and this application embodiment does not limit this.
[0091] It should be understood that each unit in the above device can be implemented by a processor calling software. For example, the device includes a processor connected to a memory containing instructions. The processor calls the instructions stored in the memory to implement any of the above methods or to implement the functions of each unit in the device. The processor can be a general-purpose processor, such as a CPU or microprocessor, and the memory can be internal or external to the device. Alternatively, the units in the device can be implemented as hardware circuits. By designing the hardware circuits, some or all of the unit functions can be implemented. The hardware circuits can be understood as one or more processors. For example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are implemented by designing the logical relationships between the components within the circuit. In another implementation, the hardware circuit can be implemented using a PLD, such as an FPGA, which can include a large number of logic gates. The connection relationships between the logic gates are configured through configuration files to implement the functions of some or all of the above units. All units in the above device can be implemented entirely by a processor calling software, entirely by hardware circuits, or partially by a processor calling software with the remaining parts implemented by hardware circuits.
[0092] In this application embodiment, a processor is a circuit with signal processing capabilities. In one implementation, the processor can be a circuit with instruction reading and execution capabilities, such as a CPU, microprocessor, GPU, or DSP. In another implementation, the processor can implement certain functions through the logical relationships of hardware circuits. These logical relationships are fixed or reconfigurable. For example, the processor may be a hardware circuit implemented as an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document and configuring the hardware circuit can be understood as the processor loading instructions to implement the functions of some or all of the above units. Furthermore, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, or DPU.
[0093] As can be seen, each unit in the above device can be one or more processors (or processing circuits) configured to implement the above methods, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
[0094] Furthermore, the units in the above devices can be integrated in whole or in part, or they can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a System-on-Chip (SoC). The SoC may include at least one processor for implementing any of the above methods or implementing the functions of the units in the device. The at least one processor may be of different types, such as CPU and FPGA, CPU and artificial intelligence processor, CPU and GPU, etc.
[0095] Exemplary electronic devices Another embodiment of this application also provides an electronic device, see [link to relevant documentation] Figure 3 As shown, the device includes: Memory 300 and processor 310; The memory 300 is connected to the processor 310 and is used to store programs; The processor 310 is configured to implement the question-answering method based on a generative large model disclosed in any of the above embodiments by running the program stored in the memory 300.
[0096] Specifically, the question-answering device based on the generative large model may also include: a bus, a communication interface 320, an input device 330, and an output device 340.
[0097] The processor 310, memory 300, communication interface 320, input device 330, and output device 340 are interconnected via a bus. Among them: A bus can include a pathway for transmitting information between various components of a computer system.
[0098] The processor 310 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present invention. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0099] Processor 310 may include a main processor, as well as a baseband chip, modem, etc.
[0100] The memory 300 stores a program that executes the technical solution of this invention, and may also store an operating system and other key business functions. Specifically, the program may include program code, which includes computer operation instructions. More specifically, the memory 300 may include read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), other types of dynamic storage devices capable of storing information and instructions, disk storage, flash memory, etc.
[0101] Input device 330 may include a device for receiving user input data and information, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer, or gravity sensor.
[0102] Output device 340 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0103] The communication interface 320 may include a device that uses any transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0104] The processor 310 executes the program stored in the memory 300 and calls other devices, which can be used to implement any of the steps of the question-answering method based on a generative large model provided in the above embodiments of this application.
[0105] Exemplary computer program products and storage media In addition to the methods and devices described above, embodiments of this application may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the question-answering method based on a generative large model according to various embodiments of this application as described in any of the foregoing embodiments of this specification.
[0106] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0107] Furthermore, embodiments of this application may also be storage media storing a computer program, which is executed by a processor through the steps of the generative large model-based question-answering method according to various embodiments of this application described above. Specifically, the following steps can be implemented: Obtain the original question input by the user; The information to be retrieved is determined from the original question based on a generative large model; The following generation process is performed using the generative large model: Based on a pre-constructed target knowledge graph, the core entity most relevant to the information to be retrieved, the knowledge fragments related to the core entity, and the core entity embedding vector corresponding to the core entity are determined. The core entity embedding vector is used to indicate the graph semantics of the core entity in the target knowledge graph. Retrieval content is generated based on the information to be retrieved, the knowledge fragments, and the core entity embedding vector. The information to be retrieved is updated based on the retrieval content and the original question. Repeat the generation process until the answer to the original question is determined based on the generated search results.
[0108] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0109] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0110] The steps in the methods of the various embodiments of this application can be adjusted, merged, or deleted in order according to actual needs, and the technical features described in each embodiment can be replaced or combined.
[0111] The modules and sub-modules in the apparatus and terminal in the various embodiments of this application can be merged, divided, and deleted according to actual needs.
[0112] It should be understood that the disclosed terminals, devices, and methods can be implemented in other ways, given the several embodiments provided in this application. For example, the terminal embodiments described above are merely illustrative. For instance, the division of modules or sub-modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple sub-modules or modules may be combined or integrated into another module, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0113] The modules or submodules described as separate components may or may not be physically separate. The components that constitute a module or submodule may or may not be physical modules or submodules; that is, they may be located in one place or distributed across multiple network modules or submodules. Some or all of the modules or submodules can be selected to achieve the purpose of this embodiment's solution, depending on actual needs.
[0114] Furthermore, the functional modules or sub-modules in the various embodiments of this application can be integrated into one processing module, or each module or sub-module can exist physically separately, or two or more modules or sub-modules can be integrated into one module. The integrated modules or sub-modules described above can be implemented in hardware or in the form of software functional modules or sub-modules.
[0115] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0116] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software unit executed by a processor, or a combination of both. The software unit can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0117] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0118] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.< / relation> < / attribute> < / entity>
Claims
1. A question-answering method based on a generative large model, characterized in that, include: Obtain the original question input by the user; The information to be retrieved is determined from the original question based on a generative large model; The following generation process is performed using the generative large model: Based on a pre-constructed target knowledge graph, the core entity most relevant to the information to be retrieved, the knowledge fragments related to the core entity, and the core entity embedding vector corresponding to the core entity are determined. The core entity embedding vector is used to indicate the graph semantics of the core entity in the target knowledge graph. Retrieval content is generated based on the information to be retrieved, the knowledge fragment, and the core entity embedding vector; Based on the search content and the original question, update the information to be searched; Repeat the generation process until the answer to the original question is determined based on the generated search results.
2. The method according to claim 1, characterized in that, Based on a pre-constructed target knowledge graph, the core entities most relevant to the information to be retrieved are identified, including: Identify the initial entity in the information to be retrieved; The entity in the target knowledge graph that has the highest relevance to the initial entity knowledge is identified as the core entity.
3. The method according to claim 2, characterized in that, The knowledge relevance includes semantic relevance and entity relevance. The entity in the target knowledge graph with the highest knowledge relevance to the initial entity is determined as the core entity, including: Generate the initial entity vector of the initial entity in the information to be retrieved; Generate the initial semantic vector of the information to be retrieved; Determine the candidate entity embedding vectors related to the initial entity vector from the entity embedding vectors of the target knowledge graph; Generate candidate semantic vectors for the candidate entities corresponding to the candidate entity embedding vectors; Based on the similarity between the initial semantic vector and each of the candidate semantic vectors, the target semantic vector that is most relevant to the initial semantic vector among the candidate semantic vectors is determined; The candidate entity corresponding to the target semantic vector is determined as the core entity.
4. The method according to claim 1, characterized in that, Based on a generative large model, the information to be retrieved is determined from the original question, including: Based on the generative large model, the original problem is split into at least one sub-problem; Determine the first target sub-problem to be retrieved from the at least one sub-problem; The information to be retrieved is determined from the target sub-problem.
5. The method according to claim 1, characterized in that, Before obtaining the original question input by the user, the following steps are also included: Construct an initial knowledge graph for the target domain, the initial knowledge graph including entities in the target domain and the relationships between the entities; The initial knowledge graph is encoded using a graph convolutional network to obtain entity embedding vectors for each entity. The entity embedding vectors are used to represent the graph semantics of the entity in the target knowledge graph. The graph semantics include the semantic position of the entity in the target knowledge graph and its association with other entities. The target knowledge graph is determined based on the initial knowledge graph and the entity embedding vector.
6. The method according to claim 1, characterized in that, Before obtaining the original question input by the user, the following steps are also included: Obtain training samples, which include sample questions and the corresponding sample true answers to the sample questions; Based on the generative large model, at least one piece of information to be retrieved is determined from the sample question, and the generation process is performed on each piece of information to be retrieved to obtain the sample generated answer corresponding to each piece of information to be retrieved. Using pre-configured reward rules, and based on the actual answers of the samples, the generation reward information for each sample's generated answer is determined; The generative large model is optimized based on the generated reward information.
7. The method according to claim 6, characterized in that, The reward rules include at least one of the following: Determine whether the sample-generated answer is generated according to the specified generation rules; Determine whether the sample-generated answer covers the core entities in the sample question; Determine whether the generated answer of the sample is consistent with the actual answer of the sample.
8. A question-answering device based on a generative large model, characterized in that, include: The acquisition unit is used to acquire the original question input by the user; A determining unit is used to determine the information to be retrieved from the original question based on a generative large model; The generation unit is used to perform the following generation process through the generative large model: based on the pre-constructed target knowledge graph, determine the core entity most relevant to the information to be retrieved, the knowledge fragments related to the core entity, and the core entity embedding vector corresponding to the core entity, wherein the core entity embedding vector is used to indicate the graph semantics of the core entity in the target knowledge graph; Retrieval content is generated based on the information to be retrieved, the knowledge fragment, and the core entity embedding vector; Based on the search content and the original question, update the information to be searched; repeat the generation process until the answer to the original question is determined based on the generated search content.
9. An electronic device, characterized in that, Including memory and processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the question-answering method based on a generative large model as described in any one of claims 1 to 7 by running the program in the memory.
10. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the question-answering method based on a generative large model as described in any one of claims 1 to 7.