Retrieval method and device of question-answering system, electronic equipment and storage medium
By converting query information into triples and calculating similarity and weight values, and after filtering target elements, a multi-level reasoning process is performed using a reasoning-action collaborative big model, which solves the problem of information fragmentation in question-answering systems and achieves more accurate query result generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING SINOVOICE TECH CO LTD
- Filing Date
- 2025-11-11
- Publication Date
- 2026-04-14
AI Technical Summary
Existing question-answering systems rely excessively on surface feature matching, failing to establish deep semantic connections, resulting in information fragmentation, severely restricting multi-hop reasoning capabilities, and failing to meet citizens' complex consultation needs.
The query information is converted into triples using a pre-defined encoding conversion model. The similarity and weight values of elements in the knowledge base are calculated, the target elements with the highest relevance are selected, and multi-level reasoning is performed through a reasoning-action collaborative big model to generate query results.
The system has improved the information relevance and multi-hop reasoning capabilities of the question-and-answer system, generating more accurate and complete query results to meet the diverse consultation needs of citizens.
Smart Images

Figure CN121858686A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of question-and-answer system retrieval technology, specifically relating to a retrieval method, apparatus, electronic device, and readable storage medium for a question-and-answer system. Background Technology
[0002] Question-and-answer systems are a key component in the construction of a modern digital society. Their core objective is to use artificial intelligence technology to provide the public with accurate, authoritative, and efficient relevant information and services.
[0003] In recent years, with the rise of natural language processing technologies, including large-scale language models and retrieval-enhanced generation techniques, the intelligence level of question-answering systems has been significantly improved. Existing question-answering systems generally adopt a community-based knowledge graph construction and retrieval paradigm for implementing intelligent question-answering functions. This involves constructing a knowledge graph by extracting triples from a large-scale language model; extracting entities from the query using named entity recognition and retrieving relevant subgraphs; or generating summaries through community partitioning and matching the query with the summaries; and finally, inputting the retrieved information into a large-scale language model to generate the answer.
[0004] However, the retrieval methods of existing question-answering systems rely too heavily on surface feature matching and cannot establish deep semantic connections, resulting in fragmented returned information. This severely restricts the ability of question-answering systems to perform multi-hop reasoning and fails to meet the complex consultation needs of citizens. Summary of the Invention
[0005] This application aims to provide a retrieval method, apparatus, electronic device, and readable storage medium for a question-answering system, which at least solves the problem of fragmented information returned in prior art, which severely restricts the ability of question-answering systems to perform multi-hop reasoning.
[0006] To solve the above-mentioned technical problems, this application is implemented as follows: In a first aspect, embodiments of this application provide a retrieval method for a question-and-answer system, including: Obtain the user's query information; The query information is encoded and converted using a preset encoding conversion model to obtain a first triplet corresponding to the query information; the first triplet includes a first node. Determine the similarity between each element in the preset knowledge base and the first triplet; and determine the weight value between each element and the first triplet based on the similarity; each element in the preset knowledge base includes a second triplet or a preset paragraph text; the weight value is used to characterize the priority corresponding to each element; Based on the weight values, each element in the preset knowledge base is filtered to obtain a second set number of target elements that are most relevant to the first triplet; The target elements are input into a preset reasoning-action collaborative model for reasoning, and the query results corresponding to the query information are obtained.
[0007] Secondly, embodiments of this application also provide a retrieval device for a question-and-answer system, comprising: The retrieval module is used to retrieve the user's query information; The conversion module is used to encode and convert the query information using a preset encoding conversion model to obtain the first triplet corresponding to the query information.
[0008] The calculation module is used to determine the similarity between each element in the preset knowledge base and the first triplet; and to determine the weight value between each element and the first triplet based on the similarity; each element in the preset knowledge base includes a second triplet or a preset paragraph text; the weight value is used to characterize the priority corresponding to each element.
[0009] The filtering module is used to filter each element in the preset knowledge base according to the weight value to obtain a second set number of target elements with the highest relevance to the first triplet. The reasoning module is used to input the target elements into a preset reasoning-action collaborative model for reasoning, and obtain the query results corresponding to the query information.
[0010] Thirdly, embodiments of this application also provide an electronic device, characterized in that it includes a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions being executed by the processor to implement the steps of the method described in the first aspect.
[0011] Fourthly, embodiments of this application also provide a readable storage medium, characterized in that, when the instructions in the readable storage medium are executed by a processor of an electronic device, the electronic device is able to perform the method described in the first aspect.
[0012] In summary, a preset encoding conversion model is used to encode and convert the user's query information to obtain the first triplet corresponding to the query information. Then, the similarity between each element in the preset knowledge base (i.e., the second triplet and paragraph text) and the first triplet is calculated. Based on the similarity and the weight value between each element and the first triplet, the proportion of the second triplet and paragraph text in the query results is quantified. Based on the weight value, elements in the preset knowledge base are filtered to obtain a second set number of target second triplets and paragraph texts with the highest relevance to the first triplet. This yields several second triplets and paragraph texts with the highest relevance to the query information, facilitating the acquisition of the query results needed by the user. The target second triplets and paragraph texts are input into a preset reasoning-action collaborative model for reasoning, obtaining the query results corresponding to the query information. The preset reasoning-action collaborative model performs reasonable reflection and multi-level reasoning on the target second triplets and target paragraph texts, ultimately obtaining the query results needed by the user. This solves the problem of fragmented returned information, which severely restricts the multi-hop reasoning execution of question-answering systems. Attached Figure Description
[0013] Figure 1 This is a flowchart illustrating the steps of a retrieval method for a question-and-answer system provided in an embodiment of this application; Figure 2 This is a flowchart of the steps of a retrieval method for another question-answering system provided in an embodiment of this application; Figure 3 This is a flowchart of the steps of a retrieval method for another question-answering system provided in this application embodiment; Figure 4 This is a block diagram of a retrieval device for a question-and-answer system provided in an embodiment of this application; Figure 5 This is a block diagram of an electronic device provided in an embodiment of this application; Figure 6 This is a block diagram of another electronic device provided in the embodiments of this application. Detailed Implementation
[0014] 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, 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.
[0015] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0016] The retrieval method and apparatus of the question-answering system of this application will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0017] Figure 1 This is a flowchart illustrating the steps of a retrieval method for a question-answering system provided in an embodiment of this application. (Refer to...) Figure 1 As shown, the method may include: Step 101: Obtain the user's query information.
[0018] In this embodiment, the first step for a user using the question-and-answer system is to input the query information, i.e., the relevant question to be queried, into the system. A question-and-answer system is an intelligent information system based on artificial intelligence technology, particularly natural language processing and human-computer interaction technology. Its core objective is to provide accurate, efficient, and one-stop relevant information consultation and service guidance to relevant users, including citizens and businesses, through natural language dialogue. The knowledge base of a question-and-answer system typically includes a structured knowledge base and an unstructured document base. The structured knowledge base is based on a knowledge graph and stores relevant information in the form of triples, i.e., main graph node-relationship-object node. For example, it connects relevant regulations and service items into a semantic network; the characteristics of a structured knowledge base are accuracy and standardization. The unstructured document base is used to store massive amounts of raw text, such as the full text of relevant regulations, service guide web pages, and question-and-answer records. The characteristics of an unstructured document base are detailed content and rich context.
[0019] Step 102: Use a preset encoding conversion model to encode and convert the query information to obtain the first triplet corresponding to the query information.
[0020] In this embodiment, before retrieving query information, the query information must be converted into a triple form that the knowledge base of the question-answering system can parse; this is because natural language is flexible and ambiguous. For example, a user might query "the founder of Apple," where "Apple" could refer to either a fruit or a company. The triple structure requires the question-answering system to eliminate this ambiguity beforehand, explicitly mapping "Apple" to the entity Apple Inc. in the knowledge graph. This way, during subsequent queries, relevant content can be found based on the converted triples of the query information.
[0021] A triple is a basic unit for representing knowledge, consisting of three parts: a subject node, a relation node, and an object node. A triple expresses a fact in the most concise and unambiguous way. For example, when the query is "steps to apply for a disability certificate," the resulting triple would be (disability certificate, apply, steps). This gives us a triple with "disability certificate" as the subject node, "apply" as the relation, and "steps" as the object node. The question-answering system uses this triple to perform relevant queries on the query information, ultimately obtaining the corresponding query results. Furthermore, since the subject and object nodes in the corresponding triples usually indicate the content of the user's query, the system can extract the subject and object nodes from the triples.
[0022] Step 103: Determine the similarity between each element in the preset knowledge base and the first triplet; and determine the weight value between each element and the first triplet based on the similarity.
[0023] Each element in the preset knowledge base includes a second triplet or a preset paragraph text; the weight value is used to characterize the priority of each element.
[0024] In this embodiment, the preset knowledge base includes multiple preset second triples and multiple preset paragraph texts. That is, the knowledge base includes a knowledge graph and an unstructured text library. The knowledge graph is composed of a large number of triples and is a structured semantic knowledge base where the stored triples can describe concepts, entities, events, and their relationships in the real world in the form of a graph. The unstructured text library consists of a large amount of text data existing in paragraph form that has not yet been converted into triples.
[0025] After obtaining the subject node and object node corresponding to the query information, the second triplet or paragraph text with a high similarity to the triplet corresponding to the query information should be retrieved in the preset knowledge base.
[0026] The specific retrieval process is as follows: First, traverse the subject node and object node of the second triplet in the preset knowledge base, or the paragraph text, and calculate the similarity between the second triplet in the preset knowledge base and the paragraph text and the first triplet.
[0027] Depending on the situation: In the process of calculating the similarity between the first triplet and the second triplet, some second triplets with high similarity between the subject node or object node of the first triplet corresponding to the query information are selected as candidate triplets.
[0028] Then, based on the similarity between each triplet in the candidate triplet and the first triplet corresponding to the query information, the contribution of the subject node and object node in each triplet in the candidate triplet to the similarity is calculated. In other words, the subject node and object node that appear more frequently in all triplets and are related to the query information are identified. These subject nodes and object nodes have higher weights and are very likely to be part of the final query results.
[0029] Based on the weights of these subject and object nodes, the corresponding weight values for the subject and object nodes are calculated, namely the first weight for the subject node and the second weight for the object node. Based on the first weight for the subject node and the second weight for the object node, each triple in the candidate triples is adjusted to obtain more accurate search results.
[0030] In calculating the weight between paragraph text and the first triplet, since paragraph text usually contains a lot of content, the semantic relevance between each paragraph text and the first triplet is calculated as the weight between the paragraph text and the first triplet.
[0031] Step 104: Based on the weight values, each element in the preset knowledge base is filtered to obtain a second set number of target elements that have the highest relevance to the first triplet.
[0032] In this embodiment, based on the calculated weight values, the score of each triplet in the candidate triplet and the score of each paragraph text in the preset knowledge base are calculated. This determines whether each triplet and paragraph text has a high weight, as the triplet and paragraph text with higher weights are ultimately included as part of the query results. After calculating the scores of each triplet and paragraph text, the lower-scoring triplets / paragraph texts are filtered out, leaving only those with high scores. This ensures further accuracy of the query results to meet the customer's query needs.
[0033] Step 105: Input the target element into the preset reasoning-action collaborative big model for reasoning to obtain the query result corresponding to the query information.
[0034] In this embodiment, the target elements are input into a preset reasoning-action collaborative model to obtain the final query results. The reasoning-action collaborative model is a large model based on the ReAct framework. The ReAct framework is a paradigm that prompts a large language model to perform interactive reasoning. Its function is to allow the large model to iteratively execute the following steps: reasoning (generating thought processes and plans), action (retrieving information), and reflection (evaluating results and correcting errors) until a final answer is obtained. By inputting the target triples into the preset reasoning-action collaborative model, and through repeated steps of reasoning, action, and reflection, accurate query results that meet the user's needs are finally generated based on the target triples.
[0035] In summary, a preset encoding conversion model is used to encode and convert the user's query information to obtain the first triplet corresponding to the query information. Then, the similarity between each element in the preset knowledge base (i.e., the second triplet and paragraph text) and the first triplet is calculated. Based on the similarity and the weight value between each element and the first triplet, the proportion of the second triplet and paragraph text in the query results is quantified. Based on the weight value, elements in the preset knowledge base are filtered to obtain a second set number of target second triplets and paragraph texts with the highest relevance to the first triplet. This yields several second triplets and paragraph texts with the highest relevance to the query information, facilitating the acquisition of the query results needed by the user. The target second triplets and paragraph texts are input into a preset reasoning-action collaborative model for reasoning, obtaining the query results corresponding to the query information. The preset reasoning-action collaborative model performs reasonable reflection and multi-level reasoning on the target second triplets and target paragraph texts, ultimately obtaining the query results needed by the user. This solves the problem of fragmented returned information, which severely restricts the multi-hop reasoning execution of question-answering systems.
[0036] Figure 2 This is a flowchart illustrating the specific steps of a retrieval method for a question-answering system provided in this application. (Refer to...) Figure 2 The method may include the following steps: Step 201: Obtain the user's query information.
[0037] For details, please refer to step 101 above. We will not go into further detail here.
[0038] Step 202: Use a preset encoding conversion model to encode and convert the query information to obtain the first triplet corresponding to the query information.
[0039] For details, please refer to step 102 above. We will not go into further detail here.
[0040] Specifically, step 202 may also include sub-steps 2021 to 2023: Sub-step 2021: Use a preset encoding conversion model to clean the query information to obtain the cleaned text; the cleaning process includes at least one of removing irrelevant symbols, correcting spelling mistakes, and unifying formats. Sub-step 2022: Use a preset encoding conversion model to segment the cleaned text to obtain lexical units. Sub-step 2023: Use a preset encoding conversion model to combine the lexical units into a first triple according to the grammatical structure of the query information.
[0041] In the application embodiment, in sub-steps 2021 to 2023, the process of converting the query information into a triple is described in detail. The encoding conversion model is a deep learning model, and its core function is to convert a piece of text (such as query information) into a fixed-length, high-dimensional semantic vector (also called "embedding"). The encoding conversion model first cleans the query information, that is, removes irrelevant symbols in the query information, corrects spelling mistakes in the query information, unifies the format of the query information, etc. Then, the encoding conversion model segments the processed query information into several meaningful lexical units, including the subject, object, and action (predicate), etc. Finally, the encoding conversion model forms a triple corresponding to the query information from the lexical units such as the subject, object, and action.
[0042] For example, when the query information input by the user is "Which day is the New Year of the Nongli in 2100?", first clean the query information, and the cleaned query information text is "Which day is the Chinese New Year in 2100". Then, segment the cleaned text, segment it into independent word elements, and segment "Which day is the Chinese New Year in 2100" into: 2100, of, Chinese New Year, is, which day and other uncorrelated word elements; finally, integrate these word elements into a triple (2100, Chinese New Year, which day).
[0043] Step 203: Screen all the second triples in the preset knowledge graph according to the similarity between each second triple and the first triple to obtain a candidate set.
[0044] In the application embodiment, the user's query information is converted into a first triple (i.e., vector form) representation through an encoding conversion model, and then the similarity is calculated with all the second triples in the preset knowledge base. Screen out the top K triples with the highest similarity from all the second triples in the preset knowledge base to form a candidate set Scandidate, as shown in formula (1): (1) Where, Scandidate represents the candidate set; ti = (s,r,o) represents a triple, 1≤i≤K; s represents the subject node, o represents the object node, and r represents the relationship between the subject node and the object node.
[0045] A preliminary screening is performed on all second triples in the preset knowledge base to obtain several triples with high similarity to the query information as a candidate set, thereby reducing the computational load of the subsequent query process.
[0046] Optionally, step 203 may also include sub-steps 2031 to 2032: Sub-step 2031: Calculate the cosine similarity between the semantic vector corresponding to each second triplet and the semantic vector corresponding to the first triplet, and obtain the similarity between each second triplet and the first triplet respectively.
[0047] Sub-step 2032: Select the first set number of second triplets with the highest similarity among the similarity values corresponding to each second triplet as the candidate set.
[0048] In this embodiment, sub-steps 2031 and 2032 further explain the calculation process of step 203. For the second triplet in the preset knowledge base, the semantic vector corresponding to each triplet and the semantic vector corresponding to the first triplet corresponding to the query information are calculated using cosine similarity to obtain the similarity between each second triplet and the first triplet corresponding to the query information. Here, the semantic vector maps text (including words, phrases, and sentences) into points in a continuous vector space using a specific mathematical model.
[0049] Then, based on the similarity between each second triplet and the first triplet corresponding to the query information, a similarity threshold is set to filter the triplets, and a first set number of target triplets with similarity higher than the similarity threshold are selected as candidate sets.
[0050] Optionally, step 203 may also include sub-step 2033: Step 204: Calculate the similarity weight of the second node in each second triplet based on the similarity corresponding to each second triplet and the number of second nodes in each second triplet.
[0051] In this embodiment of the application, the similarity weight of nodes in the triplet is calculated. The calculation process includes, for each candidate triplet in the candidate set: extracting the subject node and object node corresponding to each triplet; calculating the similarity weight of each second node (including the subject node and object node) in the similarity corresponding to the triplet (which can be understood as the single contribution score of the node to the similarity), as shown in formula (2): (2) Where: s(ti) represents the similarity between the triple and the query information; p represents a node (subject node or object node); n(p) represents the total number of document nodes associated with the node in the preset knowledge base; score(p, ti) represents the similarity weight of the node in the similarity corresponding to the triple. It should be noted that: n(p) represents the number of elements (second triples or paragraph text) associated with each subject node / object node of the first triple in the knowledge base; the purpose is to balance the weights corresponding to high-frequency subject nodes / object nodes.
[0052] According to formula (2), the weight of the subject node / object node in the similarity of the second triplet can be calculated, which can then be used to measure the primary and secondary status of the subject node / object node in the process of generating the query results.
[0053] Step 205: Determine the weight value of each second triplet based on the frequency of occurrence and similarity ratio of the subject node and object node in the first triplet in the preset knowledge base.
[0054] In this embodiment, the primary and secondary positions of the subject node / object node in the query result generation process are further confirmed. For each first node, its score in all second triplets in the preset knowledge graph is accumulated, which is the similarity ratio, as shown in formula (3): (3) Where: Tp represents the set of candidate triples; This represents the cumulative weight of a node.
[0055] After calculating the sum of the similarity proportions of each second node in all second triplets in the preset knowledge base, the normalized weight of the second node in each second triplet is calculated, which is the first weight value corresponding to the subject node and the second weight value corresponding to the object node, as shown in formula (4): (4) in, N(p) represents the normalized weight of each node; N(p) represents the frequency of occurrence of a node, and N(p) is equal to the number of triplets in the set of all candidate triplets containing nodes, as shown in formula (5).
[0056] (5) The weight values of the second triplet are divided into a first weight value corresponding to the subject node and a second weight value corresponding to the object node. The first weight value corresponding to the subject node and the second weight value corresponding to the object node can reflect the overall priority of the node in the query retrieval process. That is, the higher the cumulative similarity and the lower the frequency of occurrence of the node, the more important the node is to the query retrieval process and the significance of the retrieval results. The query retrieval process should focus on the node with the higher normalized weight value to retrieve the query information.
[0057] Specifically, step 205 may also include sub-steps 2051 to 2056: Sub-step 2051: Count the number of elements in the preset knowledge base that contains the subject node or object node in the first triplet to obtain the occurrence frequency of the subject node and the occurrence frequency of the object node.
[0058] Sub-step 2052: Calculate the similarity ratio between the subject node and the object node using the occurrence frequency of the subject node and the occurrence frequency of the object node, and the similarity between each second triplet and the first triplet.
[0059] Sub-step 2053: Sum the similarity weights of the main nodes corresponding to each second triplet to obtain the first result.
[0060] Sub-step 2054: Calculate the first weight by dividing the first result by the frequency of occurrence of the main node.
[0061] The first weight value corresponds to the main node of the second triplet.
[0062] Sub-step 2055: Sum the similarity weights of the object nodes corresponding to each triple to obtain a second result. Sub-step 2056: Calculate the quotient between the second result and the frequency of occurrence of the object nodes to obtain the second weight.
[0063] The second weight value corresponds to the object node of the second triplet.
[0064] In this embodiment, sub-steps 2051 to 2056 further explain the process of determining the weight value of each second triplet in step 205. The occurrence counts of the subject node or object node in the first triplet are traversed and accumulated in each second triplet and paragraph text in the knowledge base to obtain the occurrence frequency of the subject node or object node. The purpose is to compare which of the subject node and object node has richer associated elements (i.e., more associated content), and to prioritize the node with richer associated content in subsequent query results, thus making the query results more accurate.
[0065] Using the similarity between each second triplet and the first triplet as the numerator, and the frequency of occurrence of the subject node or the object node as the denominator, calculate the ratio of the numerator to the denominator. This ratio is then used as the similarity weight of the subject node and the similarity weight of the object node. The similarity weight can be understood as measuring the magnitude of a node's influence on the generation of query results during the search process.
[0066] The similarity weights of the subject nodes and object nodes are summed separately to obtain a first result and a second result. The first result is then divided by the frequency of occurrence of the subject nodes to obtain the first weight value for the subject nodes. Similarly, the second result is divided by the frequency of occurrence of the object nodes to obtain the second weight value for the object nodes. This yields the weight value for each node in the second triplet, which can be used to quantify the influence of each node in the overall query result process. Nodes with larger weight values obviously contribute to more accurate query results.
[0067] Step 206: Determine the weight value between each paragraph text and the first triplet based on the similarity between each paragraph text and the first triplet, and the preset paragraph text weight coefficient.
[0068] In this embodiment, the process of calculating the similarity between each paragraph text and the first triplet is described. As shown in formula (6), the semantic relevance between the first triplet and all paragraph texts is calculated using a dense retrieval model: (6) Here, Equery represents the semantic vector of the first triplet; Epassage represents the semantic vector of the paragraph text; and spdr(dj) is the similarity (i.e., semantic relevance) between the paragraph text dj and the first triplet.
[0069] After determining the semantic relevance between the first triplet and all paragraph texts, the weights of the paragraph texts are calculated as shown in formula (7): (7) Where Wpassage(d) represents the weight of the paragraph text; γ represents the preset weight coefficient.
[0070] After calculating the similarity of the paragraph texts, the similarity is multiplied by a preset weighting coefficient. This is to balance the contribution ratio between paragraph texts from unstructured text and structured evidence (second triples) from the knowledge graph. By adjusting the weighting coefficient, the emphasis on factual accuracy and contextual richness when generating query results can be controlled, ensuring a reasonable balance between the influence of paragraph texts and second triples on the query results.
[0071] Step 207: Based on the weight values, each element in the preset knowledge base is filtered to obtain a second set number of target elements that have the highest relevance to the first triplet.
[0072] For details, please refer to step 104 above. We will not go into further detail here.
[0073] Optionally, step 207 may also include sub-steps 2071 to 2072: Sub-step 2071: Iterate the preset initial ranking value using the preset damping factor, the preset initial ranking value, and the weight value corresponding to each element to obtain the iterated ranking value.
[0074] Optionally, sub-step 2072 may also include sub-steps B1 to B3: Sub-step B1: Use the preset damping factor, preset initial ranking value and probability transition matrix to perform a summation operation to obtain the summation result.
[0075] Sub-step B2: Multiply the weight value corresponding to each element with the difference between the first and the preset damping factor to determine the product result.
[0076] Sub-step B3: Perform a summation operation on the summation result and the product result to determine the iterative ranking value.
[0077] In the embodiments of this application, sub-steps B1 to B3 further explain the iterative process of using a preset damping factor, a preset initial ranking value (initial ranking vector), a first weight value corresponding to the subject node, or a second weight value corresponding to the object node to iterate the preset initial ranking value (initial ranking vector) to obtain the iterative ranking value (iterative ranking vector).
[0078] As shown in formula (8): (8) Where P represents the probability transition matrix of the graph, and its element Pij = 1 / deg(vi). If there is an edge (vi, vj), that is, a relationship exists between two nodes, the value is 1; otherwise, it is 0. α represents the damping factor, which represents the probability that the random walker will continue to jump along the edge; s represents the weight of the element.
[0079] The iterative process of obtaining the iterative ranking vector by iterating over the initial ranking vector includes: The product of the probability transition matrix, the damping factor, and the initial ranking value is added to the product of the difference between the first and the preset damping factor and the node weights to obtain the iterative ranking value after one iteration.
[0080] Sub-step 2072: Replace the preset initial ranking value with the iterative ranking value, and proceed to sub-step 2071.
[0081] Sub-step 2073: When the difference between the iterative ranking value and the preset initial ranking value is less than a preset threshold, the iterative ranking value is taken as the final ranking value.
[0082] Sub-step 2074: Filter each element in the preset knowledge base according to the final ranking value to obtain a second set number of elements.
[0083] In this embodiment of the application, sub-steps 2071 to 2075 further explain the specific process of step 207. After obtaining the node weights (including the first weight and the second weight) of each element in the preset knowledge base, a unified node weight vector is constructed as the personalized vector for the personalized PageRank algorithm.
[0084] In the execution of the personalized PageRank algorithm, the initial vector setting directly determines the bias of the ranking result. In this application, the algorithm does not start from a uniform distribution or a random state, but uses a node weight vector that incorporates query information as the initial vector. This initial vector is directly composed of the node weights (first weight or second weight) obtained from the previous calculation, and has non-zero weights only on nodes related to the query. This ensures that the random walk process in the personalized PageRank algorithm starts from nodes that have been identified as important, so that the final converged iterative ranking value (reflecting the global importance score of the node) can simultaneously reflect the network structure characteristics and query intent, achieving truly personalized ranking.
[0085] The ranking value is iterated continuously according to formula (8). Finally, when the L1 norm of the vector difference between the iterated ranking vector and the initial ranking value (that is, the value of the previous iteration of the ranking vector) is less than the preset convergence threshold, the iterated ranking vector at this time is taken as the final ranking vector; as shown in formula (9): (9) in, This is the preset convergence threshold; This represents the ranking vector for the k-th iteration.
[0086] The resulting final ranking vector, or final ranking value, can simultaneously reflect both network structure characteristics and query intent, making it easier to accurately find the query results the user needs. After the personalized PageRank algorithm converges to obtain the final ranking value, each element in the preset knowledge base is further filtered and sorted in descending order according to the corresponding final ranking value to obtain a second set number of paragraph texts and triples.
[0087] Step 208: Input the target element into the preset reasoning-action collaborative big model for reasoning to obtain the query result corresponding to the query information.
[0088] For details on this step, please refer to step 105 above. We will not go into further detail here.
[0089] Optionally, step 207 may also include sub-steps 2081 to 2084.
[0090] Sub-step 2081: Use a preset reasoning-action collaborative big model to retrieve the target element based on the query information to obtain the context information and reasoning trajectory corresponding to the query information.
[0091] Sub-step 2082: Generate the reasoning result corresponding to the query information based on the context information and reasoning trajectory corresponding to the query information.
[0092] Sub-step 2083: Use a preset reasoning-action collaborative big model to process the reasoning result based on the query information; the processing includes: outputting as query result, re-retrieval or reflection evaluation.
[0093] Sub-step 2084: Using a preset reasoning-action collaborative big model, the query information is re-retrieved or re-evaluated to obtain the initial query result, which is then output as the query result.
[0094] In this embodiment, sub-steps 2071 to 2074 further explain the process in step 207. After obtaining several target elements, the relevant text content is used as context information and input into a preset reasoning-action collaborative model for collaborative reasoning and answer generation. This process is a multi-round iterative process, as detailed below: For each iteration, the reasoning-action collaborative big model executes the steps of reasoning, action, and reflection. In the reasoning step, the model generates the current reasoning approach based on the contextual information of the current target triple and the historical reasoning trajectory (i.e., the query results obtained in the previous round of reasoning). In the action step, the model determines the next action based on the current reasoning result, including: Retrieve, Answer, and Reflect.
[0095] When the next action is to salvage the situation, the reasoning-action collaborative big model generates a new query, the system re-executes the retrieval process, retrieves the new triple-related documents, and updates the context.
[0096] When the next action is to respond, the reasoning-action collaborative big data model generates the final answer.
[0097] The next step is reflection: the reasoning-action collaborative model performs self-assessment and reflection on the current reasoning process. The reasoning-action collaborative model verifies and evaluates the current reasoning state and the generated content: reflection includes checking the accuracy of facts, logical consistency, and compliance.
[0098] The iteration stops when any of the termination conditions is met, including: the next action is to provide an answer and the confidence level of the query result is greater than the set confidence level threshold, or the number of iterations reaches the maximum limit.
[0099] Finally, the reasoning-action collaborative big data model outputs the query results and their confidence scores, and provides relevant source information, including the source text supporting the query results. Through multiple rounds of reasoning-action-reflection loops, the reasoning-action collaborative big data model can generate accurate, rigorous, and verifiable query results.
[0100] Optionally, the method may further include the following steps: Step B1: Obtain the text to be updated.
[0101] Step B2: Input the text to be updated into the preset semantic parsing model for triple parsing to obtain a set of parsing results.
[0102] The parsing result set includes the triplet corresponding to each statement in the text to be updated.
[0103] In this embodiment of the application, in steps B1 to B2, when it is necessary to update the preset knowledge graph, for example, to add new file content to the preset knowledge graph, the semantic parsing big model is used to parse the obtained text to be updated, and the triples corresponding to each statement in the text to be updated are obtained.
[0104] A large semantic parsing model, including a large language model, is used as a deep semantic parser to parse the acquired text to be updated. This process consists of two layers: canonical knowledge extraction and open knowledge extraction. The standard knowledge extraction includes: the semantic parsing big model extracts structurally standard and semantically clear triples from the text to be updated based on predefined core tables (as shown in Table 1 and Table 2) to form a high-quality standard knowledge layer.
[0105]
[0106] Table 1 Entity Type Definitions
[0107] Table 2 Relation Type Definitions Open knowledge extraction includes: the semantic parsing big model autonomously extracts other valuable <subject, relation, object> triples from the text without relying on predefined tables, thereby forming a broad-coverage open knowledge layer.
[0108] Step B3: For the semantic vector corresponding to the triple of each statement in the text to be updated, calculate the cosine similarity between the similarity between the vector and the triple in the preset knowledge base, and determine the similarity.
[0109] In this embodiment of the application, the similarity between the triples corresponding to each statement in the text to be updated and the triples in the preset knowledge graph is calculated; and cosine similarity is a common method for calculating similarity.
[0110] A pre-trained encoder (including Sentence-BERT) is used to map all phrase nodes in a pre-defined knowledge base to a high-dimensional vector space. As shown in equation (10), for each node pi, its vector representation is: (10) Here, Encoder means encoder, and its function is to encode node pi to obtain the semantic vector vi corresponding to node pi.
[0111] As in formula (11), for node pi (semantic vector vi), calculate its cosine similarity with all existing nodes (corresponding semantic vectors vj) in the preset knowledge graph: (11) Where sim(vi, vj) represents the cosine similarity between semantic vector vi and semantic vector vj.
[0112] Step B4: Perform a normalization and merging operation on the triples corresponding to similarity values greater than the preset similarity threshold to determine the merged triples.
[0113] In this embodiment, the top-K candidate nodes with the highest text similarity to be updated are used to form a candidate set C = {p1, p2, ..., pk}. When there exists a candidate node pj ∈ C that satisfies the cosine similarity between semantic vector vi and semantic vector vj being greater than or equal to a preset cosine similarity threshold, a normalization operation is performed, as shown in formula (12): (12) Step B5: Add the merged triplet, which is merged with the corresponding text to be updated, to the preset knowledge graph to obtain the updated knowledge base.
[0114] In this embodiment of the application, each paragraph of the text to be updated is added as an independent document node to a preset knowledge graph, and a source edge is established between each document node and all phrase nodes extracted from that paragraph.
[0115] This application's embodiments achieve automated, incremental knowledge updates through a hierarchical extraction and dynamic fusion mechanism, significantly reducing maintenance costs and ensuring that the knowledge base and documents are updated synchronously.
[0116] like Figure 3 As shown, the retrieval method of the question-answering system provided in this application embodiment is summarized as follows: After a user initiates a query, the question-answering system uses query encoding and relevant fact filtering to initially filter the preset second triplets and preset paragraph texts in the preset knowledge base, obtaining a set of elements (preset second triplets and preset paragraph texts) with high relevance to the query. The initial weight of each element obtained from the initial filtering is calculated to quantify the contribution of the subject node and object node in the node to the similarity. Next, based on the initial weight of the node and combined with a personalized PageRank algorithm, the elements obtained from the initial filtering are further filtered. The filtered results consist of several second triplets and paragraph texts. After several processes of reasoning / action / reflection, the query results that best meet the user's query needs are finally obtained.
[0117] Figure 4 This is a schematic diagram of the structure of a retrieval device for a question-answering system provided in an embodiment of this application, as shown below. Figure 4 As shown, the retrieval device 30 of the question-and-answer system includes: The first acquisition module 301 is used to acquire the user's query information.
[0118] The conversion module 302 is used to encode and convert the query information using a preset encoding conversion model to obtain the first triplet corresponding to the query information.
[0119] Optionally, the conversion module 302 may also include: The cleaning submodule is used to clean the query information using a preset encoding conversion model to obtain cleaned text; the cleaning process includes at least one of: removing irrelevant symbols, correcting spelling errors, and unifying the format.
[0120] The segmentation submodule is used to segment the cleaned text using a preset encoding conversion model to obtain lexical units.
[0121] The combination submodule is used to combine lexical units into a first triplet according to the grammatical structure of the query information using a preset encoding conversion model.
[0122] The calculation module 303 is used to determine the similarity between each element in the preset knowledge base and the first triplet; and to determine the weight value between each element and the first triplet based on the similarity.
[0123] Each element in the preset knowledge base includes a second triplet or a preset paragraph text; the weight value is used to characterize the priority of each element.
[0124] Optionally, the calculation module 303 may further include: wherein the first triplet includes a first node; the first node includes a subject node and an object node; the element includes a second triplet; the second triplet includes a second node; and the second node includes a subject node and an object node.
[0125] The first filtering submodule is used to filter each second triplet based on the similarity between each triplet and the first triplet, thereby obtaining a candidate set. Optionally, the first filtering submodule may further include: The first calculation subunit is used to perform cosine similarity calculation between the semantic vector corresponding to each second triplet and the semantic vector corresponding to the first triplet, so as to obtain the similarity between each second triplet and the first triplet.
[0126] The confirmation subunit is used to select the first set number of triples with the highest similarity among the similarities corresponding to each second triplet as the candidate set.
[0127] The first calculation submodule is used to calculate the similarity weight of nodes in each triplet based on the similarity corresponding to each triplet and the number of nodes in each triplet.
[0128] The second calculation submodule is used to determine the weight value of each second triplet based on the frequency of occurrence and similarity ratio of each triplet in the preset knowledge base of the subject node and object node in the first triplet.
[0129] The triple includes nodes; the nodes include subject nodes and object nodes.
[0130] Optionally, the second calculation submodule may also include: The statistics unit is used to perform statistics on the elements in a preset knowledge base that include the subject node or object node in the first triplet, and to obtain the occurrence frequency of the subject node and the occurrence frequency of the object node.
[0131] The second calculation unit is used to calculate the similarity ratio between the subject node and the object node by using the occurrence frequency of the subject node and the occurrence frequency of the object node, and the similarity between each second triplet and the first triplet.
[0132] The first summation unit is used to sum the similarity weights of the subject nodes corresponding to each triplet to obtain the first result.
[0133] The first quotient unit is used to perform a quotient operation between the first result and the frequency of occurrence of the main node to obtain the first weight.
[0134] The first weight value corresponds to the main node of the second triplet.
[0135] The second summation unit is used to sum the similarity weights of the object nodes corresponding to each triple in the preset knowledge graph to obtain a second result; The second quotient unit is used to perform a quotient operation between the second result and the frequency of occurrence of the object node to obtain the second weight.
[0136] The second weight value corresponds to the object node of the second triplet.
[0137] Optionally, the computing module 303 may also include: The third calculation submodule is used to determine the weight value between each paragraph text and the first triplet based on the similarity between each paragraph text and the first triplet, and a preset paragraph text weight coefficient.
[0138] The filtering module 304 is used to filter each element in the preset knowledge base according to the first weight value and the second weight value to obtain a second set number of target elements with the highest relevance to the first triplet.
[0139] Optionally, the filtering module 304 may also include: The first iteration submodule is used to iterate over the preset initial ranking value using a preset damping factor, a preset initial ranking value, and the weight value corresponding to each element to obtain the iterative ranking value.
[0140] Optionally, the first iteration submodule may also include: The third summation unit is used to perform summation operations using a preset damping factor, a preset initial ranking value, and a probability transition matrix to obtain the summation result.
[0141] The product unit is used to multiply the weight value corresponding to each element with the difference between a preset damping factor and the product value to determine the product result.
[0142] The fourth summation unit is used to perform a summation operation on the summation result and the product result to determine the iterative ranking value.
[0143] The second iteration submodule is used to replace the preset initial ranking value with the iterative ranking value, and enters the step of iterating the preset initial ranking value using the preset damping factor, the preset initial ranking value, and the weight value corresponding to each element to obtain the iterative ranking value initial ranking value.
[0144] The determination submodule is used to determine the final ranking value when the difference between the iterative ranking value and the preset ranking value is less than a preset threshold. The second filtering submodule is used to filter each element in the preset knowledge base according to the final ranking value to obtain a second set number of target elements.
[0145] The reasoning module 305 is used to input the target element into a preset reasoning-action collaborative big model for reasoning, and obtain the query result corresponding to the query information.
[0146] The optional inference module 305 may also include: The retrieval submodule is used to retrieve the target elements based on the query information using a preset reasoning-action collaborative big model, and to obtain the context information and reasoning trajectory corresponding to the query information; The reasoning submodule is used to generate the reasoning result corresponding to the query information based on the context information and reasoning trajectory corresponding to the query information; The first processing submodule is used to process the reasoning result based on the query information using a preset reasoning-action collaborative big model; the processing includes: outputting the query result, re-retrieval, or reflection and evaluation; The second processing submodule is used to re-retrieve or reflect on the query information using a preset reasoning-action collaborative big model to obtain the initial query result, which is then output as the query result.
[0147] Optionally, the retrieval device of the question-answering system may also include: The second acquisition module is used to acquire the text to be updated.
[0148] The parsing module is used to input the text to be updated into a preset semantic parsing model for triple parsing to obtain a set of parsing results; the set of parsing results includes triples corresponding to each statement in the text to be updated; the triples include nodes and relations.
[0149] The calculation module is used to calculate the cosine similarity between the semantic vectors corresponding to the triples of each sentence in the text to be updated, and obtain the similarity.
[0150] The merging module is used to perform a normalization and merging operation on triples corresponding to similarity values greater than a preset similarity threshold to obtain merged triples.
[0151] The update module is used to add the merged triplet, which is merged with the corresponding text to be updated, to a preset knowledge graph to obtain the updated knowledge graph.
[0152] Figure 5 This is a block diagram of an electronic device 800 provided in an embodiment of this application. For example, the electronic device 800 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0153] Reference Figure 5 The electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0154] Processing component 802 typically controls the overall operation of electronic device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0155] Memory 804 is used to store various types of data to support the operation of electronic device 800. Examples of this data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, multimedia, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0156] Power supply component 806 provides power to various components of electronic device 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800.
[0157] Multimedia component 808 includes a screen that provides an output interface between electronic device 800 and user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may not only sense the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When electronic device 800 is in an operating mode, such as shooting mode or multimedia mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0158] Audio component 810 is used to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) used to receive external audio signals when electronic device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0159] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0160] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of electronic device 800. For example, sensor assembly 814 can detect the on / off state of electronic device 800, the relative positioning of components such as the display and keypad of electronic device 800, changes in position of electronic device 800 or a component of electronic device 800, the presence or absence of user contact with electronic device 800, orientation or acceleration / deceleration of electronic device 800, and temperature changes of electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0161] Communication component 816 facilitates wired or wireless communication between electronic device 800 and other devices. Electronic device 800 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 7G), or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0162] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to implement a method for splitting dialogue segments in voice data provided in the embodiments of this application.
[0163] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 720 of an electronic device 800 to perform the above-described method. For example, the non-transitory storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0164] Figure 6 This is a block diagram illustrating an electronic device 900 according to an exemplary embodiment. For example, the electronic device 900 may be provided as a server. (Refer to...) Figure 6 The electronic device 900 includes a processing component 922, which further includes one or more processors, and memory resources represented by a memory 932 for storing instructions, such as application programs, that can be executed by the processing component 922. The application programs stored in the memory 932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 922 is configured to execute instructions to perform a retrieval method for a question-answering system provided in embodiments of this application.
[0165] Electronic device 900 may also include a power supply component 926 configured to perform power management of electronic device 900, a wired or wireless network interface 950 configured to connect electronic device 900 to a network, and an input / output (I / O) interface 958. Electronic device 900 may operate on an operating system stored in memory 932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.
[0166] This application also provides a computer program product, including a computer program, which, when executed by a processor, implements a retrieval method for a question-and-answer system.
[0167] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include undisclosed common knowledge or customary techniques in the art. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0168] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A retrieval method for a question-and-answer system, characterized in that, The method includes: Obtain the user's query information; The query information is encoded and converted using a preset encoding conversion model to obtain the first triplet corresponding to the query information; Determine the similarity between each element in the preset knowledge base and the first triplet; and determine the weight value between each element and the first triplet based on the similarity; each element in the preset knowledge base includes a second triplet or a preset paragraph text; the weight value is used to characterize the priority corresponding to the element; based on the weight value, filter each element in the preset knowledge base to obtain a second set number of target elements with the highest relevance to the first triplet; The target elements are input into a preset reasoning-action collaborative model for reasoning, and the query results corresponding to the query information are obtained.
2. The retrieval method of the question-and-answer system according to claim 1, characterized in that, The first triplet includes a first node; the first node includes a subject node and an object node; the element includes a second triplet; the second triplet includes a second node; the second node includes a subject node and an object node; The step of determining the weight value between each element and the first triplet based on the similarity includes: Based on the similarity between each second triplet and the first triplet, each second triplet is filtered to obtain a candidate set; Based on the similarity of each second triplet and the number of second nodes in each second triplet, the similarity weight of the second nodes in each second triplet is calculated. The weight value of each second triplet is determined based on the frequency of occurrence and similarity ratio of the subject node and object node in the first triplet in the preset knowledge base.
3. The retrieval method of the question-and-answer system according to claim 1, characterized in that, The element includes a preset paragraph text; The step of determining the weight value between each element and the first triplet based on the similarity includes: The weight value between each paragraph text and the first triplet is determined based on the similarity between each paragraph text and the first triplet, and a preset paragraph text weight coefficient.
4. The retrieval method of the question-and-answer system according to claim 2, characterized in that, The step of filtering each second triplet based on its similarity to the first triplet to obtain a candidate set includes: The cosine similarity between the semantic vector corresponding to each second triplet and the semantic vector corresponding to the first triplet is calculated to obtain the similarity between each second triplet and the first triplet. The first predetermined number of second triplets with the highest similarity among the similarity values corresponding to each second triplet are selected as the candidate set.
5. The retrieval method of the question-answering system according to claim 2, characterized in that, The weight values of the second triplet include the first weight value and the second weight value; The step of determining the weight value of each second triplet based on the frequency of occurrence and similarity ratio of the subject node and object node in the first triplet in a preset knowledge base includes: The number of elements in a preset knowledge base containing the subject node or object node of the first triple is counted to obtain the occurrence frequency of the subject node and the occurrence frequency of the object node. The similarity ratio between the subject node and the object node is determined by calculating the occurrence frequency of the subject node and the occurrence frequency of the object node, and the similarity between each second triplet and the first triplet. The similarity weights of the main nodes corresponding to each second triplet are summed to obtain the first result; The first weight is obtained by quotienting the first result with the frequency of occurrence of the main node; the first weight value corresponds to the main node of the second triplet. The similarity weights of the object nodes corresponding to each second triplet are summed to obtain the second result; The second result is divided by the frequency of occurrence of the object node to obtain the second weight; the second weight value corresponds to the object node of the second triplet.
6. The retrieval method of the question-answering system according to claim 1, characterized in that, The step of filtering each element in the preset knowledge base according to the weight value to obtain a second set number of target elements with the highest relevance to the first triplet includes: The preset initial ranking value is iterated using a preset damping factor, a preset initial ranking value, and a weight value corresponding to each element to obtain the iterated ranking value. The iterative ranking value is used to replace the preset initial ranking value, and the process proceeds to the step of iterating the preset initial ranking value using a preset damping factor, a preset initial ranking value, and the weight value corresponding to each element to obtain the iterative ranking value. When the difference between the iterative ranking value and the preset initial ranking value is less than a preset threshold, the iterative ranking value is taken as the final ranking value. Each element in the preset knowledge base is filtered according to the final ranking value to obtain a second set number of target elements.
7. The retrieval method of the question-answering system according to claim 1, characterized in that, The method further includes: Get the text to be updated; The text to be updated is input into a preset semantic parsing model for triple parsing to obtain a set of parsing results; the set of parsing results includes the triples corresponding to each statement in the text to be updated. The similarity between the semantic vectors corresponding to the triples of each statement in the text to be updated is calculated using cosine similarity to determine the similarity. Perform a normalization and merging operation on the triples corresponding to similarity scores greater than the preset similarity threshold to determine the merged triples; The merged triplet, which is combined with the corresponding text to be updated, is added to the preset knowledge base to obtain the updated knowledge base.
8. A retrieval device for a question-and-answer system, characterized in that, The device includes: The retrieval module is used to retrieve the user's query information; The conversion module is used to encode and convert the query information using a preset encoding conversion model to obtain the first triplet corresponding to the query information; A calculation module is used to determine the similarity between each element in a preset knowledge base and the first triplet; and to determine the weight value between each element and the first triplet based on the similarity; each element in the preset knowledge base includes a second triplet or a preset paragraph text; the weight value is used to characterize the priority corresponding to each element; The filtering module is used to filter each element in the preset knowledge base according to the weight value to obtain a second set number of target elements with the highest relevance to the first triplet. The reasoning module is used to input the target elements into a preset reasoning-action collaborative model for reasoning, and obtain the query results corresponding to the query information.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the method as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that, When the instructions in the readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the steps of the method as described in any one of claims 1 to 7.