Knowledge chain library construction method, question answering method, and related devices and equipment

Through large language models, the prediction relationships in the knowledge point library are learned, and the knowledge chain is constructed and detected, which solves the problem of insufficient knowledge points in the answers to complex problems, and improves the accuracy of the answers and the quality of the knowledge base.

CN117687988BActive Publication Date: 2025-06-13ANTELOPE IND INTERNET CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311559177.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-21
Publication Date
2025-06-13
Estimated Expiration
2043-11-21

AI Technical Summary

Technical Problem

In the prior art, when assisting in answering complex questions, the knowledge points obtained in the knowledge point library may not be sufficient to solve the problem, resulting in low answer accuracy.

Method used

Through large language models, learn the knowledge point library, obtain the predictive relationship between knowledge points, build candidate knowledge chains, and determine the target knowledge chain by detecting contradictions, and improve the quality of the knowledge chain library.

Benefits of technology

It improves the quality of knowledge construction and can improve the accuracy of answering questions when assisting answering complex questions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117687988B_ABST
    Figure CN117687988B_ABST
Patent Text Reader

Abstract

The present application discloses a method for constructing a knowledge chain library, a method for answering questions, and related devices and equipment. The method includes: obtaining the output result after a large language model learns from a knowledge point library; wherein, the output result at least includes the predicted relationships between knowledge points in the knowledge point library; based on the predicted relationships between knowledge points, obtaining a number of candidate knowledge chains; based on the large language model after learning from the knowledge point library, detecting the candidate knowledge chains to obtain the detection result of the candidate knowledge chains; wherein, the detection result includes whether the candidate knowledge chains are contradictory; based on the detection result of the candidate knowledge chains, determining whether to select the candidate knowledge chains as target knowledge chains and save them to the knowledge chain library. The above solution can improve the quality of knowledge construction, so as to improve the accuracy of question answering as much as possible even when assisting in answering complex questions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information processing technologies, and in particular, to a method for constructing a knowledge chain library, a method for answering questions, and related devices and equipment. Background Art

[0002] With the development of deep learning networks, some question-and-answer systems that involve a large amount of manual participation have gradually started to transform into an automated manner. Using a system storing knowledge points to provide relevant knowledge points for solving some problems can reduce manual participation and can quickly respond to user needs.

[0003] In the prior art, a knowledge point library containing numerous knowledge points is usually constructed to assist in answering questions. Exemplarily, knowledge points that meet a similarity threshold are obtained by matching the similarity between the question to be retrieved and the knowledge points, and the knowledge points are used as reference content for answering the question to be retrieved. However, when the question to be retrieved is relatively complex, the knowledge points obtained based on similarity may not be able to or be insufficient to solve the question to be retrieved. In view of this, how to improve the quality of knowledge construction so as to improve the accuracy of question answering as much as possible even when assisting in answering complex questions has become an urgent problem to be solved. Summary of the Invention

[0004] The main technical problem to be solved by this application is to provide a method for constructing a knowledge chain library, a method for answering questions, and related devices and equipment, which can improve the quality of knowledge construction so as to improve the accuracy of question answering as much as possible even when assisting in answering complex questions.

[0005] To solve the above technical problem, a first aspect of this application provides a method for constructing a knowledge chain library, including obtaining an output result after a large language model learns a knowledge point library; wherein, the output result at least includes the predicted relationships between the knowledge points in the knowledge point library; based on the predicted relationships between the knowledge points, obtaining several candidate knowledge chains; using the large language model after learning the knowledge point library to detect the candidate knowledge chains, and obtaining a detection result of the candidate knowledge chains; wherein, the detection result includes whether the candidate knowledge chains are contradictory; based on the detection result of the candidate knowledge chains, determining whether to select the candidate knowledge chains as target knowledge chains and save them to the knowledge chain library.

[0006] To solve the above technical problem, a second aspect of this application provides a method for answering questions, including obtaining a question to be retrieved and obtaining a knowledge chain library; wherein, the knowledge chain library is obtained by the method for constructing a knowledge chain library described in the first aspect above; generating an answer to the question to be retrieved based on the knowledge chain library.

[0007] To solve the above technical problems, a third aspect of the present application provides a knowledge chain library construction device, including a result acquisition module, a candidate construction module, a contradiction detection module, and a result determination module. The result acquisition module is used to obtain the output result of the large language model after learning the knowledge point library; wherein, the output result at least includes the predicted relationships between the knowledge points in the knowledge point library. The candidate construction module is used to obtain a number of candidate knowledge chains based on the predicted relationships between the knowledge points. The contradiction detection module is used to detect the candidate knowledge chains based on the large language model after learning the knowledge point library, and obtain the detection result of the candidate knowledge chains; wherein, the detection result includes whether the candidate knowledge chains are contradictory. The result determination module is used to determine whether to select the candidate knowledge chains as target knowledge chains and save them to the knowledge chain library based on the detection result of the candidate knowledge chains.

[0008] To solve the above technical problems, a fourth aspect of the present application provides a question answering device, including an acquisition module and a generation module. The acquisition module is used to obtain the question to be retrieved and obtain the knowledge chain library; wherein, the knowledge chain library is obtained by the knowledge chain library construction method described in the first aspect above. The generation module is used to generate an answer to the question to be retrieved based on the knowledge chain library.

[0009] To solve the above technical problems, a fifth aspect of the present application provides an electronic device, including a memory and a processor coupled to each other. The memory stores program instructions, and the processor is used to execute the program instructions to implement the knowledge chain library construction method described in the first aspect above, or to implement the question answering method described in the second aspect above.

[0010] To solve the above technical problems, a sixth aspect of the present application provides a computer-readable storage medium, storing program instructions that can be run by a processor. The program instructions are used to implement the knowledge chain library construction method described in the first aspect above, or to implement the question answering method described in the second aspect above.

[0011] In the above solution, the large language model learns the knowledge points stored in the knowledge point library in the form of knowledge points, and obtains the output result after learning, and the output result at least includes the prediction relationship between the knowledge points. Based on the prediction relationship between the knowledge points, the knowledge points that the large language model considers to be related after learning are constructed into chains to obtain several candidate knowledge chains. The large language model after learning the knowledge library is used to detect the candidate knowledge chains to determine whether there are contradictions in the candidate knowledge chains, so as to obtain the detection result of the candidate knowledge chains. And based on the detection result of the candidate knowledge chains, it is determined whether to select the candidate knowledge chains as the target knowledge chains, and the determined target knowledge chains are saved to the knowledge chain library. On the one hand, after obtaining the candidate knowledge chains based on the prediction relationship between the knowledge points, then judge whether there are contradictions in the establishment of the candidate knowledge chains based on the semantic content of the knowledge points in the knowledge point library after learning, so as to reduce the false construction rate of the candidate knowledge chains as much as possible, so as to improve the quality of the target knowledge chains constructed in the knowledge chain library; on the other hand, the target knowledge chains in the form of chains are stored in the knowledge chain library. In the case of using the knowledge chain library to answer the target question and the target question is relatively complex, compared with the knowledge point library containing discrete knowledge points, it can provide as much auxiliary information as possible based on the target knowledge chains to help improve the accuracy of answering complex questions. Therefore, it is possible to improve the quality of knowledge construction, so as to improve the accuracy of answering questions as much as possible even when assisting in answering complex questions. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 is a schematic flowchart of an embodiment of the method for constructing a knowledge chain library of the present application;

[0013] Figure 2 is a schematic flowchart of an embodiment of the method for answering questions of the present application;

[0014] Figure 3 is a schematic flowchart of another embodiment of the method for answering questions of the present application;

[0015] Figure 4 is a schematic framework diagram of an embodiment of the device for constructing a knowledge chain library of the present application;

[0016] Figure 5 is a schematic framework diagram of an embodiment of the device for answering questions of the present application;

[0017] Figure 6 is a schematic framework diagram of an embodiment of the electronic device of the present application;

[0018] Figure 7 is a schematic framework diagram of an embodiment of the computer-readable storage medium of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0019] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts belong to the scope of protection of the present application.

[0020] The terms "system" and "network" are often used interchangeably herein. The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the preceding and following associated objects. In addition, "plurality" in this article means two or more than two.

[0021] Please refer to Figure 1 , Figure 1 is a schematic flowchart of an embodiment of the method for constructing the knowledge chain library of the present application. Specifically, it may include the following steps:

[0022] Step S10: Obtain the output result after the large language model learns the knowledge point library; wherein, the output result at least includes the predicted relationships between the knowledge points in the knowledge point library.

[0023] In the embodiments of the present disclosure, a large language model (LLM) refers to a deep learning model trained using a large amount of text data, which can generate natural language text or understand the meaning of language text. The large language model can handle various natural language tasks, such as text classification, question answering, dialogue, etc., and is an important way to artificial intelligence.

[0024] It should be noted that the type of the large language model in the present application is not limited. For example, Chat GPT, Spark large model, LLAMA, etc.

[0025] In an implementation scenario, the knowledge points include the knowledge point name and the knowledge point content. The knowledge point content is used to supplement the description of the knowledge point. Specifically, the knowledge point content includes explanations, applications, characteristics, etc. related to the entity represented by the knowledge point name. For example, a certain chemical substance is used as the knowledge point name, and the corresponding knowledge point content includes the elemental composition, preparation method, practical application, etc. of the chemical substance. A knowledge point library is constructed based on the obtained knowledge points.

[0026] In a specific implementation scenario, the knowledge points in the knowledge point library can use different data storage types to store the knowledge point names and knowledge point contents under the same knowledge point, and there is a hierarchical relationship between the data storage types of the knowledge point names and the knowledge point contents. For example, the knowledge point content is marked in the form of tags on the knowledge point name to form a knowledge point, reducing the storage space required for the knowledge point.

[0027] In a specific implementation scenario, the knowledge point library stores discrete knowledge points, and the knowledge points are independent of each other without establishing a relationship between knowledge points. It should be noted that the storage form of the knowledge points in this application is not limited, such as semi-structured data, knowledge articles, etc.

[0028] In a specific implementation scenario, the knowledge points can be obtained by extracting semi-structured web pages in the Internet encyclopedia library regarding the knowledge point content, such as encyclopedia web pages, knowledge communities, etc. Specifically, the Internet encyclopedia library includes encyclopedia web pages presenting knowledge in the form of web pages, and its content includes descriptions, contents, examples, applications, etc. of the knowledge points.

[0029] It should be noted that the Internet encyclopedia library used to obtain knowledge documents is not limited in this application, such as Baidu Encyclopedia, Wikipedia, Sogou Encyclopedia, etc.

[0030] In a specific implementation scenario, the knowledge documents regarding the knowledge points are unstructured data, such as knowledge articles, electronic books, scanned papers, etc. String extraction is performed on such data, and the strings are combined and spliced to obtain the content regarding the knowledge points.

[0031] In an implementation scenario, after obtaining the knowledge point library and before obtaining the output result after the large language model learns the knowledge point library, each knowledge point in the knowledge point library is classified and labeled to obtain the classification labels of each knowledge point, and the learning logic of the large language model learning the knowledge points is determined based on the classification labels of the knowledge points, so that the large language model learns the knowledge points according to the learning logic of the knowledge points. Through the above method, corresponding learning logics are adopted for different types of knowledge points, improving the learning efficiency of the knowledge points.

[0032] In a specific implementation scenario, the classification labels of each knowledge point include conditional knowledge, formula-based knowledge, and general knowledge. Each knowledge point is marked with at least one classification label. Specifically, some knowledge points are marked with multiple classification labels. For example, a certain knowledge point is marked with a conditional knowledge label and a formula-based knowledge label, and another knowledge point is marked with a general knowledge label.

[0033] In a specific implementation scenario, each knowledge point in the knowledge point library is obtained as a knowledge point to be classified, and the preset data structure is matched based on the data structure of the knowledge point to be classified. The preset data structure includes a first data structure for representing the conditional data structure and a second data structure for representing the formula data structure. When the data structure of the knowledge point to be classified matches the first data structure, a conditional knowledge label is assigned to the knowledge point to be classified, and / or when the data structure of the knowledge point to be classified matches the second data structure, a formula-based knowledge label is assigned to the knowledge point to be classified. When the data structure of the knowledge point to be classified does not match either the first data structure or the second data structure, a general knowledge label is assigned to the knowledge point to be classified. Through the above method, based on the special data structures of conditional knowledge and formula-based knowledge, label annotation is performed on the knowledge points to be classified, improving the classification efficiency of different categories of knowledge points.

[0034] In a specific implementation scenario, when the classification label of a knowledge point is conditional knowledge, the learning logic of the large language model for the knowledge point is to understand the conditions of the knowledge point and perform conditional loop trial and error based on the understood conditions, deepening the ability to understand the conditions of conditional knowledge.

[0035] In a specific implementation scenario, when the classification label of a knowledge point is formula-based knowledge, the learning logic of the large language model for the knowledge point is to understand the formula of the knowledge point and perform numerical substitution on the formula based on the understanding, achieving the learning ability of drawing inferences from one instance for formula-based knowledge.

[0036] In a specific implementation scenario, when the classification label of a knowledge point is general knowledge, the general knowledge is regarded as common sense knowledge, and the learning logic of the large language model for the knowledge point is to store and remember the knowledge point and understand its semantics.

[0037] In a specific implementation scenario, when there are two or more classification labels for a knowledge point, the content of the knowledge point can be extracted and segmented to obtain the knowledge point content corresponding to different classification labels respectively. The corresponding learning logic is adopted for different categories of knowledge point content, and the learning results obtained after separate learning are integrated.

[0038] In an implementation scenario, after the large language model learns the knowledge points in the knowledge point library, a large amount of content for understanding the knowledge points is obtained, and based on the understood results, the prediction relationships between the knowledge points in the obtained knowledge point library are obtained, and the prediction relationships between the knowledge points are used as the output results of the large language model. Through the above method, the learning and understanding of the knowledge points in the knowledge point library improve the accuracy of constructing the prediction relationships between the knowledge points, so as to improve the quality of the target knowledge chain constructed in the knowledge chain library.

[0039] In a specific implementation scenario, a knowledge point is selected from the knowledge point library as the target knowledge point, and other knowledge points in the knowledge point library are used as candidate knowledge points. Based on the learning results of the large language model for the target knowledge point and each candidate knowledge point, a predicted relationship between the target knowledge point and some of the candidate knowledge points is obtained. For example, there are 100 knowledge points in the knowledge point library. Knowledge point A is used as the target knowledge point, and the remaining 99 knowledge points are used as candidate knowledge points. After the large language model learns and understands the 100 knowledge points, it is predicted that there are associated relationships between knowledge point B, knowledge point C, and knowledge point D and knowledge point A. The predicted relationship between knowledge point A and knowledge point B is that knowledge point B constitutes knowledge point A. The predicted relationship between knowledge point A and knowledge point C is that knowledge point C constitutes knowledge point A. The predicted relationship between knowledge point A and knowledge point D is that knowledge point A constitutes knowledge point D.

[0040] In a specific implementation scenario, the predicted relationship includes the logical relationship or the establishment condition between the target knowledge point and the candidate knowledge point. Preset types of logical labels can be set in advance. Based on the learning results of the knowledge points in the knowledge point library, the logical labels are matched to the target knowledge point and the candidate knowledge point with an associated relationship to represent the predicted relationship between the target knowledge point and the candidate knowledge point. Through the above method, the preset logical labels are matched to represent the predicted relationship between the target knowledge point and the candidate knowledge point, improving the efficiency of obtaining the predicted relationship.

[0041] In a specific implementation scenario, the output result of the large language model also includes the knowledge category of the knowledge point. For example, the knowledge category of knowledge point A is the clause category, and the knowledge category of knowledge point B is the formula category.

[0042] In a specific implementation scenario, the knowledge category of the knowledge point can also be analyzed by referring to the classification label of the knowledge point.

[0043] Step S20: Based on the predicted relationship between the knowledge points, several candidate knowledge chains are obtained.

[0044] In an implementation scenario, when the output result after the large language model learns the knowledge point library includes the predicted relationship between the knowledge points, a knowledge point is selected from the knowledge point library as the target knowledge point. Based on the predicted relationship, at least one candidate knowledge point associated with the target knowledge point is selected from the knowledge point library. Based on the target knowledge point and each candidate knowledge point associated with the target knowledge point, a candidate knowledge chain is constructed. Through the above method, based on the predicted relationship, a candidate knowledge chain is constructed between each candidate knowledge point associated with the target knowledge point, improving the construction quality of the candidate knowledge chain.

[0045] In a specific implementation scenario, when the output result after the large language model learns the knowledge point library also includes the knowledge category of the knowledge point, candidate knowledge points having an associated relationship with the target knowledge point are selected based on the knowledge category of the target knowledge point, and then a candidate knowledge chain is constructed based on the prediction relationship between the target knowledge point and the candidate knowledge points. Through the above method, the efficiency and accuracy of constructing the candidate knowledge chain are improved.

[0046] In a specific implementation scenario, when the knowledge category of the target knowledge point is a clause category, the target clause in the target knowledge point is extracted, and the knowledge points in the knowledge point library that contain candidate clauses are queried as the candidate knowledge points associated with the target knowledge point, and the candidate clauses have a reference relationship with the target clause. Through the above method, the extraction and identification of the target clause for the knowledge points of the clause category with a large number of mutual reference, exclusion and other relationships are carried out, and the candidate clauses having a reference relationship with the target clause are determined based on the extracted target clause, and the efficiency of determining the candidate knowledge points is improved while ensuring the associated relationship between the target knowledge point and the candidate knowledge points as much as possible.

[0047] In another specific implementation scenario, when the knowledge category of the target knowledge point is a formula category, the target formula in the target knowledge point is extracted, candidate formulas after numerical substitution and / or logical combination of the target formula are obtained, and the knowledge points in the knowledge point library that contain the candidate formulas are queried as the candidate knowledge points having an associated relationship with the target knowledge point. Through the above method, numerical substitution and / or logical combination of the formulas for the knowledge points of the formula category with a knowledge progression relationship and numerical substitution characteristics are carried out to determine the candidate formulas, and the efficiency of determining the candidate knowledge points is improved while ensuring the associated relationship between the target knowledge point and the candidate knowledge points as much as possible.

[0048] In another specific implementation scenario, when the knowledge category of the target knowledge point is a general category, the semantic information of the target knowledge point is identified, and the knowledge points in the knowledge point library associated with the semantic information are queried as the candidate knowledge points having an associated relationship with the target knowledge point.

[0049] Step S30: Based on the large language model after learning the knowledge point library, the candidate knowledge chain is detected to obtain the detection result of the candidate knowledge chain; wherein, the detection result includes whether the candidate knowledge chain is contradictory.

[0050] In an implementation scenario, after learning from the knowledge point library, a large language model detects candidate knowledge chains, determines whether there are contradictions in the candidate knowledge chains, and uses whether there are contradictions as the detection result of the candidate knowledge chains. Through the above method, after obtaining candidate knowledge chains based on the prediction relationship between knowledge points, then based on the semantic content after learning the knowledge points in the knowledge point library, it is judged whether there are contradictions in the establishment of the candidate knowledge chains, so as to reduce the false construction rate of the candidate knowledge chains as much as possible and improve the quality of the target knowledge chains constructed in the knowledge chain library.

[0051] In a specific implementation scenario, reference knowledge points are obtained. The reference knowledge points are used as auxiliary information for judging whether there are contradictions in the establishment of candidate knowledge chains, and there is an association relationship between the reference knowledge and at least one of the target knowledge points and candidate knowledge points in the candidate knowledge chains. Through the above method, the reference knowledge points are used to provide auxiliary information for judging whether there are contradictions in the candidate knowledge chains, so as to reduce the false construction rate of the candidate knowledge chains as much as possible and improve the quality of the target knowledge chains constructed in the knowledge chain library.

[0052] In a specific implementation scenario, the semantic information of the reference knowledge points is obtained based on the reference knowledge points, and it is judged whether the candidate knowledge chains are related to the knowledge logic based on the knowledge logic in the semantic information. When the prediction relationship of the candidate knowledge chains is not related to or contrary to the knowledge logic, it indicates that the prediction relationship in the candidate knowledge chains is incorrect. Through the above method, the reference knowledge points are used to provide auxiliary information for judging whether there are contradictions in the candidate knowledge chains, so as to reduce the false construction rate of the candidate knowledge chains as much as possible and improve the quality of the target knowledge chains constructed in the knowledge chain library.

[0053] In a specific implementation scenario, the memory knowledge after the large language model learns from the knowledge point library is obtained, and at least contradiction detection is performed on the candidate knowledge chains based on the memory knowledge to obtain a detection result including whether the candidate knowledge chains are contradictory. Through the above method, the memory ability of the large language model for knowledge points is used to judge the contradiction of the candidate knowledge chains, so as to improve the quality of the target knowledge chains constructed in the knowledge chain library.

[0054] In a specific implementation scenario, the knowledge points with the classification label of common sense knowledge are selected as reference knowledge points. The common sense knowledge is composed of natural language texts and has relatively accurate front and back description logics, which can provide more accurate auxiliary information for the contradiction judgment of candidate knowledge chains, so as to reduce the false construction rate of the candidate knowledge chains as much as possible and improve the quality of the target knowledge chains constructed in the knowledge chain library.

[0055] In a specific implementation scenario, when the predicted relationship of the candidate knowledge chain is irrelevant or contrary to the knowledge logic, the logical relationship or establishment condition in the candidate knowledge chain can be adjusted based on the reference knowledge points. When the adjusted logical relationship or establishment condition is related to multiple reference knowledge points, without changing the target knowledge point and candidate knowledge points in the candidate knowledge chain, only the logical relationship or establishment condition between the target knowledge point and the candidate knowledge points can be adjusted to make the candidate knowledge chain established. Through the above method, the misconstruction rate of candidate knowledge chain construction is reduced as much as possible, and the accuracy of the logical relationship or establishment condition in the candidate knowledge chain is improved.

[0056] In a specific implementation scenario, the reference knowledge points can be selected from several knowledge points that have an associated relationship with the target knowledge point and / or candidate knowledge points, and the knowledge points with the classification label of general knowledge. The large language model has more accurate memory learning of general knowledge and is not prone to errors. Using such knowledge points as reference knowledge points can reduce the misconstruction rate of candidate knowledge chain construction as much as possible and improve the accuracy of the logical relationship or establishment condition in the candidate knowledge chain.

[0057] Step S40: Based on the detection result of the candidate knowledge chain, determine whether to select the candidate knowledge chain as the target knowledge chain and save it to the knowledge chain library.

[0058] In an implementation scenario, delete the candidate knowledge chains whose detection results indicate contradictions in the candidate knowledge chains, and use the candidate knowledge chains whose detection results indicate no contradictions as the target knowledge chains. Through the above method, on the one hand, after obtaining the candidate knowledge chain based on the predicted relationship between knowledge points, then judge whether there are contradictions in the establishment of the candidate knowledge chain based on the semantic content learned from the knowledge points in the knowledge point library, so as to reduce the misconstruction rate of the candidate knowledge chain as much as possible and improve the quality of the target knowledge chain constructed in the knowledge chain library; on the other hand, the target knowledge chains in the form of chains are stored in the knowledge chain library. In the case of using the knowledge chain library to answer target questions and the target questions are relatively complex, auxiliary information for answering complex questions is provided based on the target knowledge chain to improve the accuracy of answering complex questions.

[0059] In an implementation scenario, save the target knowledge chain to the knowledge chain library to construct the knowledge chain library.

[0060] In a specific implementation scenario, logical labels are marked on the target knowledge chain, and the logical relationship and / or establishment condition between the target knowledge point and the candidate knowledge points are stored in the logical labels.

[0061] In a specific implementation scenario, contradictory labels that match each other are marked between the target knowledge points and candidate knowledge points in the candidate knowledge chains whose detection results characterize the existence of contradictions in the candidate knowledge chains, so as to avoid wasting resources by re - constructing knowledge chains between the target knowledge points and candidate knowledge points where the contradictory labels match each other.

[0062] In a specific implementation scenario, after determining the target knowledge chain, manual intervention can be carried out to conduct spot checks on the target knowledge chain to improve the construction quality of the target knowledge chain.

[0063] In an implementation scenario, after determining whether to select a candidate knowledge chain as the target knowledge chain and save it to the knowledge chain library based on the detection results of the candidate knowledge chain, when new knowledge points are added to the knowledge point library, the knowledge point library is updated based on the new knowledge points, and the step of obtaining the output result after the large - language model learns the knowledge point library is returned for execution to update the knowledge chain library, that is, the knowledge chain library is iteratively updated based on the new knowledge point library to improve the quality of the constructed knowledge chain library.

[0064] In another implementation scenario, after determining whether to select a candidate knowledge chain as the target knowledge chain and save it to the knowledge chain library based on the detection results of the candidate knowledge chain, the first keyword in the first knowledge point and the second keyword in the second knowledge point in the target knowledge chain are extracted. Based on the co - occurrence relationship between the first keyword and the second keyword, a keyword mapping is constructed. For example, if the first keyword in the first knowledge point in the target knowledge chain is A and the second keyword in the second knowledge point in the target knowledge chain is B, a keyword mapping between A and B is constructed. When new knowledge points are stored in the knowledge point library, the new knowledge points are obtained. Based on the new knowledge points and the keyword mapping, candidate knowledge points associated with the new knowledge points are selected from the knowledge point library. Based on the newly constructed target knowledge chain composed of the new knowledge points and the candidate knowledge points associated with them, the knowledge chain library is expanded. Through the above method, the historical target knowledge chains provide auxiliary information for constructing knowledge chains for new knowledge points, and the efficiency of knowledge chain construction is improved while ensuring the construction quality of the knowledge chain as much as possible.

[0065] In a specific implementation scenario, the keyword in the new knowledge point is extracted as the keyword to be processed. Based on the keyword to be processed and the keyword mapping, the third keyword with a mapping relationship with the keyword to be processed is determined. Based on the third keyword, candidate knowledge points associated with the new knowledge point are queried in the knowledge point library. For example, if the keyword to be processed is A and the obtained keyword mapping is the keyword mapping between A and B, then B is the third keyword.

[0066] In a specific implementation scenario, there can be multiple keyword mappings related to the keyword to be processed. For example, if the keyword to be processed is A, and the obtained keyword mappings are the keyword mappings between A and B, between A and C, and between A and D, then B is the third keyword, C is also the third keyword, and D is also the third keyword.

[0067] In a specific implementation scenario, a preset number of semantic approximation words of the keyword to be processed are obtained, and the similarity between the semantic approximation words and the keyword to be processed is not less than a preset threshold. Based on the keyword to be processed and the semantic approximation words, keyword mappings are jointly retrieved to obtain the third keyword.

[0068] It should be noted that the method for obtaining semantic approximation words is not limited in this application. For example, a semantic similarity matching model, a large language model, etc. can be used.

[0069] In an implementation scenario, after saving the target knowledge chain to the knowledge chain library, when there are the same knowledge points in different target knowledge chains, the knowledge chains are intertwined to form a knowledge network, that is, the knowledge network is stored in the knowledge chain library. When a new knowledge point is input into the knowledge point library, the knowledge network in the knowledge chain library is iteratively updated to obtain an updated knowledge network.

[0070] In the above solution, the large language model learns the knowledge points stored in the knowledge point library in the form of knowledge points, and the obtained output result at least includes the predicted relationships between the knowledge points. Based on the predicted relationships between the knowledge points, the knowledge points considered to be related by the large language model after learning are chained to obtain several candidate knowledge chains. The candidate knowledge chains are detected by the large language model after learning the knowledge base to determine whether there are contradictions in the candidate knowledge chains, so as to obtain the detection result of the candidate knowledge chains. Based on the detection result of the candidate knowledge chains, it is determined whether to select the candidate knowledge chains as the target knowledge chains, and the determined target knowledge chains are saved to the knowledge chain library. On the one hand, after obtaining the candidate knowledge chains based on the predicted relationships between the knowledge points, then judge whether there are contradictions in the establishment of the candidate knowledge chains based on the semantic content of the knowledge points in the knowledge point library after learning, so as to reduce the false construction rate of the candidate knowledge chains as much as possible, so as to improve the quality of the target knowledge chains constructed in the knowledge chain library; on the other hand, the target knowledge chains in the form of chains are stored in the knowledge chain library. In the case of using the knowledge chain library to answer target questions and the target questions are relatively complex, compared with the knowledge point library containing discrete knowledge points, it can provide as much auxiliary information as possible based on the target knowledge chains to answer complex questions, which helps to improve the accuracy of answering complex questions. Therefore, it is possible to improve the quality of knowledge construction, so as to improve the accuracy of answering questions as much as possible even when assisting in answering complex questions.

[0071] Please refer toFigure 2 , Figure 2 is a schematic flowchart of an embodiment of the method for answering questions in this application.

[0072] Specifically, it may include the following steps:

[0073] Step S11: Obtain the question to be retrieved and obtain the knowledge chain library.

[0074] It should be noted that the knowledge chain library is constructed by any of the foregoing embodiments of the knowledge chain library construction method. The specific construction steps can refer to the relevant descriptions in the foregoing embodiments. For the sake of brevity, they will not be elaborated here.

[0075] In an implementation scenario, in response to a user inputting a question to be retrieved, retrieve the knowledge points in the knowledge chain library based on the semantic expression of the question to be retrieved, and provide auxiliary information for the question to be retrieved based on the logical relationship and establishment conditions of the target knowledge chain in the knowledge chain library, so as to obtain relevant knowledge points for answering the question to be retrieved. When using the knowledge chain library to answer a target question and the target question is relatively complex, providing auxiliary information for answering complex questions based on the target knowledge chain can improve the accuracy of answering complex questions.

[0076] In a specific implementation scenario, parse the question to be retrieved to obtain the intention to be answered of the question to be retrieved, and obtain the keywords and logical relationships in the question to be retrieved. Use the keywords as matching knowledge points and the logical relationships as matching tags. For example, if the question to be retrieved is "When the on-site environmental temperature is 80 degrees, can Material A be used?", parse the above question to be retrieved to obtain the keyword as "Material A" and the logical relationship as "material heat resistance".

[0077] It should be noted that the method for determining the keywords and logical relationships in the question to be retrieved in this application is not limited, such as large language models, etc.

[0078] In a specific implementation scenario, the knowledge chains in the knowledge chain library are classified and stored according to application scenarios, and retrieve by matching the application scenario corresponding to the question to be retrieved with the application scenarios in the knowledge chain library to improve the efficiency of answering the question to be retrieved.

[0079] Step S21: Generate an answer to the question to be retrieved based on the knowledge chain library.

[0080] In an implementation scenario, use the keywords of the question to be retrieved as matching knowledge points, traverse the knowledge chain library based on the matching knowledge points, obtain the target knowledge points corresponding to the matching knowledge points, pre-answer the question to be retrieved based on the target knowledge points, and when the pre-answer can be used to solve the question to be retrieved, generate an answer text for answering the question to be retrieved based on the target knowledge points and display it to the user.

[0081] In another implementation scenario, the keywords of the question to be retrieved are used as the matching knowledge points, and the knowledge chain library is traversed based on the matching knowledge points to obtain the target knowledge points corresponding to the matching knowledge points. The question to be retrieved is pre-answered based on the target knowledge points. When the pre-answer cannot be used to solve the question to be retrieved, the knowledge points used to answer the question to be retrieved are queried in the knowledge chain library as the matching knowledge points. The prompt text generated by the matching knowledge points is input into the large language model to obtain the judgment result output by the large language model, and the judgment result includes: whether it is currently sufficient to answer the question to be retrieved, and the reference guidance when it is not sufficient to answer the question to be retrieved; based on the reference guidance, the matching knowledge points are queried and updated in the target knowledge chain containing the matching knowledge points in the knowledge chain library, and then the step of inputting the prompt text generated by the matching knowledge points into the large language model to obtain the judgment result output by the large language model is returned and executed until the judgment result includes the answer to the question to be retrieved. Through the above method, in the process of querying the knowledge points used to answer the question to be retrieved based on the knowledge chain library, when the question to be retrieved is relatively complex and a single knowledge point cannot provide the knowledge content for answering the question to be retrieved, the reference guidance is obtained based on the question to be retrieved and the matching knowledge points, and the knowledge content of the new matching knowledge points and the new knowledge points related to the matching knowledge points is obtained based on the target knowledge chain stored in the knowledge chain library. Through the process of cyclic iteration, the knowledge content of the knowledge points used to answer the question to be retrieved is accumulated, more auxiliary information is provided for answering the question to be retrieved, and based on the knowledge chain of the matching knowledge points, it is ensured as much as possible that the new knowledge points obtained based on the reference guidance have a high degree of relevance to the question to be retrieved, so as to improve the accuracy of answering complex questions.

[0082] In a specific implementation scenario, based on the reference guidance and the matching knowledge points, the target knowledge chain is selected as the matching knowledge chain in the knowledge chain library, and the matching knowledge points are supplemented based on the knowledge points in the matching knowledge chain. Specifically, the reference guidance is the logical label in the target knowledge chain. For example, the matching knowledge point is A, and the first knowledge chain and the second knowledge chain are stored in the knowledge chain library. The first knowledge chain represents the knowledge chain formed between knowledge point A and knowledge point B, and the logical label between A and B is "B constitutes A". The second knowledge chain represents the knowledge chain formed between knowledge point A and knowledge point C, and the logical label between A and C is "C is a derivative of A". The reference guidance generated based on the question to be retrieved is "the composition of A material". Based on the reference guidance and the logical relationship, the similarity matching is performed, and the first knowledge chain is selected as the matching knowledge chain, and the matching knowledge points are supplemented based on knowledge point B.

[0083] In a specific implementation scenario, based on the knowledge content of the supplemented matching knowledge points, natural language text for answering the question to be retrieved is generated. It should be noted that the method for generating natural language text in this application is not limited, such as Spark Model, Chat GPT, etc.

[0084] Please refer to Figure 3 , Figure 3 which is a schematic flowchart of another embodiment of the question answering method of this application. As Figure 3 shown, after obtaining the question to be retrieved "When the on-site environmental temperature is 80 degrees, can Material A be applied?", the knowledge point "Material A" for answering the question to be retrieved is queried in the knowledge chain library based on the question to be retrieved as the matching knowledge point, and the prompt text "heat resistance" generated by the matching knowledge point "Material A" is input into the large language model, and the judgment result output by the large language model is "The current knowledge point is not sufficient to answer the question to be retrieved" and "The reference guide for the question to be retrieved is 'the heat resistance of the components of Material A'". Based on the reference guide, query in the target knowledge chain containing the matching knowledge point in the knowledge chain library, and obtain that "Material A is composed of Material B and Material C", and update the matching knowledge points to "Material B" and "Material C", and return to execute the input of the prompt text "high temperature resistance" generated by the matching knowledge point "Material B" and the prompt text "When the temperature is above 50 degrees, Material C will soften" generated by the matching knowledge point "Material C" into the large language model, and obtain the judgment result output by the large language model as "Currently sufficient to answer the question to be retrieved", and the answer text is "Material A is not applicable to an environment of 80 degrees".

[0085] In the above solution, the knowledge chains in the knowledge chain library constructed by the embodiment of the knowledge chain library construction method described above have relatively high construction quality, and the target knowledge chains stored in the knowledge chain library are in the form of chains. In the case of using the knowledge chain library to answer the question to be retrieved and the question to be retrieved is relatively complex, compared with the knowledge point library containing discrete knowledge points, it can provide as rich auxiliary information as possible based on the target knowledge chain for answering complex questions, which helps to improve the accuracy of answering complex questions. Therefore, use the knowledge chain library constructed by the foregoing embodiments to improve the accuracy of question answering as much as possible even when assisting in answering complex questions.

[0086] Please refer to Figure 4 , Figure 4 which is a schematic framework diagram of an embodiment of the knowledge chain library construction device 40 of this application. As Figure 4As shown, the knowledge chain library construction device 40 includes a result acquisition module 41, a candidate construction module 42, a contradiction detection module 43 and a result determination module 44. The result acquisition module 41 is used to obtain the output result after the large language model learns the knowledge point library; wherein the output result at least includes the predicted relationship between the knowledge points in the knowledge point library; the candidate construction module 42 is used to obtain a number of candidate knowledge chains based on the predicted relationship between the knowledge points; the contradiction detection module 43 is used to detect the candidate knowledge chain based on the large language model after learning the knowledge point library, and obtain the detection result of the candidate knowledge chain; wherein the detection result includes whether the candidate knowledge chain is contradictory; the result determination module 44 is used to determine whether to select the candidate knowledge chain as the target knowledge chain to be saved in the knowledge chain library based on the detection result of the candidate knowledge chain.

[0087] Therefore, the large language model in the knowledge chain library construction device 40 learns the knowledge points stored in the knowledge point library in the form of knowledge points to obtain the output results after learning, and the output results at least include the predicted relationship between the knowledge points. Based on the predicted relationship between the knowledge points, the knowledge points that are considered to have an association relationship after learning by the large language model are chained to obtain a number of candidate knowledge chains. The candidate knowledge chains are detected based on the large language model after learning the knowledge base to determine whether there are contradictions in the candidate knowledge chains to obtain the detection results of the candidate knowledge chains. Based on the detection results of the candidate knowledge chains, it is determined whether to select the candidate knowledge chain as the target knowledge chain, and the determined target knowledge chain is saved to the knowledge chain library. On the one hand, after obtaining the candidate knowledge chain based on the predicted relationship between knowledge points, the semantic content after learning the knowledge points in the knowledge point library is used to determine whether there is any contradiction in the establishment of the candidate knowledge chain, so as to reduce the misconstruction rate of the candidate knowledge chain as much as possible, so as to improve the quality of the target knowledge chain constructed in the knowledge chain library; on the other hand, the knowledge chain library stores the target knowledge chain in the form of a chain. When the knowledge chain library is used to answer the target question and the target question is relatively complex, compared with the knowledge point library containing discrete knowledge points, it can provide as much auxiliary information as possible for answering complex questions based on the target knowledge chain, which helps to improve the accuracy of answering complex questions. Therefore, the quality of knowledge construction can be improved, so that even when assisting in answering complex questions, the accuracy of answering questions can be improved as much as possible.

[0088] In some disclosed embodiments, the candidate construction module 42 also includes an association construction module (not shown), which is used to select a knowledge point from the knowledge point library as a target knowledge point; select at least one candidate knowledge point associated with the target knowledge point in the knowledge point library based on at least the predicted relationship; and construct a candidate knowledge chain based on the target knowledge point and each candidate knowledge point associated with the target knowledge point.

[0089] In some disclosed embodiments, the output result further includes the knowledge category of the knowledge point (not shown). Before constructing the candidate knowledge chain based on the target knowledge point and each candidate knowledge point associated with the target knowledge point, the association construction module further includes a knowledge category matching sub-module, which is used to, in response to the knowledge category of the target knowledge point being the clause category, extract the target clause in the target knowledge point, and query the knowledge points in the knowledge point library that contain the candidate clause as the candidate knowledge points associated with the target knowledge point; wherein, the candidate clause has a citation relationship with the target clause; in response to the knowledge category of the target knowledge point being the formula category, extract the target formula in the target knowledge point, obtain the candidate formula after numerical substitution and / or logical combination of the target formula, and query the knowledge points in the knowledge point library that contain the candidate formula as the candidate knowledge points having an association relationship with the target knowledge point; in response to the knowledge category of the target knowledge point being the general category, identify the semantic information of the target knowledge point, and query the knowledge points in the knowledge point library associated with the semantic information as the candidate knowledge points having an association relationship with the target knowledge point.

[0090] In some disclosed embodiments, the contradiction detection module 43 further includes a detection sub-module (not shown), which is used to obtain the memory knowledge after the large language model learns the knowledge point library; perform at least contradiction detection on the candidate knowledge chain based on the memory knowledge to obtain a detection result including whether the candidate knowledge chain is contradictory.

[0091] In some disclosed embodiments, after determining whether to select the candidate knowledge chain as the target knowledge chain and save it to the knowledge chain library based on the detection result of the candidate knowledge chain, the knowledge chain library construction device 40 further includes a keyword mapping module (not shown), which is used to extract the first keyword in the first knowledge point and the second keyword in the second knowledge point in the target knowledge chain; construct a keyword mapping based on the co-occurrence relationship between the first keyword and the second keyword; select candidate knowledge points associated with the new knowledge point from the knowledge point library based on the new knowledge point and the keyword mapping; expand the knowledge chain library based on the newly constructed target knowledge chain composed of the new knowledge point and the candidate knowledge points associated with it.

[0092] In some disclosed embodiments, the keyword mapping module further includes a candidate knowledge point query sub-module (not shown), which is used to extract the keyword in the new knowledge point as the keyword to be processed; determine the third keyword having a mapping relationship with the keyword to be processed based on the keyword to be processed and the keyword mapping; query the candidate knowledge points associated with the new knowledge point in the knowledge point library based on the third keyword.

[0093] In some disclosed embodiments, before obtaining the output result after the large language model learns the knowledge point library, the knowledge chain library construction device 40 further includes a classification module (not shown) for obtaining the classification labels of each knowledge point in the knowledge point library; based on the classification labels of the knowledge points, determining the learning logic for the large language model to learn the knowledge points, so that the large language model learns the knowledge points according to the learning logic of the knowledge points.

[0094] In some disclosed embodiments, after determining whether to select a candidate knowledge chain as the target knowledge chain and save it to the knowledge chain library based on the detection result of the candidate knowledge chain, the knowledge chain library construction device 40 further includes an iterative update module (not shown) for, in response to new knowledge points, updating the knowledge point library based on the new knowledge points, and returning to execute the step of obtaining the output result after the large language model learns the knowledge point library, so as to update the knowledge chain library.

[0095] Please refer to Figure 5 , Figure 5 which is a schematic framework diagram of an embodiment of the question answering device 50 of the present application. As Figure 5 shown, the question answering device includes an acquisition module 51 and a generation module 52. The acquisition module 51 is used to acquire the question to be retrieved and acquire the knowledge chain library; wherein, the knowledge chain library is obtained by the knowledge chain library construction method described in the first aspect above; the generation module 52 is used to generate an answer to the question to be retrieved based on the knowledge chain library.

[0096] Therefore, the question answering device 50 answers the question to be retrieved based on the knowledge chain library. The knowledge chains in the knowledge chain library constructed by the foregoing embodiments of the knowledge chain library construction method have relatively high construction quality, and the target knowledge chains stored in the knowledge chain library are in the form of chains. In the case of using the knowledge chain library to answer the question to be retrieved and the question to be retrieved is relatively complex, compared with the knowledge point library containing discrete knowledge points, it can provide as rich auxiliary information as possible based on the target knowledge chain for answering complex questions, which helps to improve the accuracy of answering complex questions. Therefore, using the knowledge chain library constructed by the foregoing embodiments can improve the accuracy of question answering as much as possible even when assisting in answering complex questions.

[0097] In some disclosed embodiments, the generation module 52 further includes a reference loop query module (not shown) configured to query, based on the question to be retrieved, for knowledge points in the knowledge chain library that are used to answer the question to be retrieved as matching knowledge points; input the prompt text generated by the matching knowledge points into a large language model to obtain a judgment result output by the large language model; wherein the judgment result includes: whether it is currently sufficient to answer the question to be retrieved, and a reference guide when it is not sufficient to answer the question to be retrieved; based on the reference guide, query and update the matching knowledge points within the target knowledge chain containing the matching knowledge points in the knowledge chain library; return to execute the step of inputting the prompt text generated by the matching knowledge points into the large language model to obtain the judgment result output by the large language model, until the judgment result includes the answer to the question to be retrieved.

[0098] In some disclosed embodiments, the reference loop query module further includes a supplement sub-module (not shown) configured to select, based on the reference guide and the matching knowledge points, a target knowledge chain in the knowledge chain library as a matching knowledge chain; supplement the matching knowledge points based on the knowledge points in the matching knowledge chain.

[0099] Please refer to Figure 6 , Figure 6 is a schematic framework diagram of an embodiment of the electronic device 60 of the present application. As Figure 6 shown, the electronic device 60 includes a mutually coupled memory 61 and a processor 62. Program instructions are stored in the memory 61, and the processor 62 is configured to execute the program instructions to implement the steps in any of the above-described embodiments of the knowledge chain library construction method, or, the steps in any of the above-described embodiments of the question answering method. Specifically, the electronic device 60 may include, but is not limited to: a server, a desktop computer, a laptop computer, a tablet computer, a smart phone, etc., which are not limited herein. Specifically, the processor 62 is configured to control itself and the memory 61 to implement the steps in any of the above-described embodiments of the knowledge chain library construction method, or, any of the embodiments of the question answering method. The processor 62 may also be referred to as a CPU (Central Processing Unit). The processor 62 may be an integrated circuit chip with signal processing capabilities. The processor 62 may also be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Additionally, the processor 62 may be implemented jointly by integrated circuit chips.

[0100] Therefore, in the electronic device 60, the large language model learns the knowledge points stored in the knowledge point library in the form of knowledge points to obtain the learned output result, and the output result at least includes the prediction relationship between the knowledge points. Based on the prediction relationship between the knowledge points, the knowledge points considered to be related by the large language model after learning are chained to obtain several candidate knowledge chains. The large language model after learning the knowledge base is used to detect the candidate knowledge chains to determine whether there are contradictions in the candidate knowledge chains, so as to obtain the detection result of the candidate knowledge chains. Based on the detection result of the candidate knowledge chains, it is determined whether to select the candidate knowledge chains as the target knowledge chains, and the determined target knowledge chains are saved to the knowledge chain library. On the one hand, after obtaining the candidate knowledge chains based on the prediction relationship between the knowledge points, the semantic content of the knowledge points in the knowledge point library after learning is used to determine whether there are contradictions in the establishment of the candidate knowledge chains, so as to reduce the false construction rate of the candidate knowledge chains as much as possible and improve the quality of the target knowledge chains constructed in the knowledge chain library. On the other hand, the target knowledge chains in the form of chains are stored in the knowledge chain library. In the case of using the knowledge chain library to answer the target questions and the target questions are relatively complex, compared with the knowledge point library containing discrete knowledge points, the target knowledge chains can provide as much auxiliary information as possible for answering complex questions, which helps to improve the accuracy of answering complex questions. Therefore, the quality of knowledge construction can be improved, so that even when assisting in answering complex questions, the accuracy of answering questions can be improved as much as possible.

[0101] Please refer to Figure 7 , Figure 7 FIG. is a schematic framework diagram of an embodiment of the computer-readable storage medium 70 of the present application. The computer-readable storage medium 70 stores program instructions 71 that can be run by a processor. The program instructions 71 are used to implement the steps in any of the above-described embodiments of the knowledge chain library construction method or the steps in any of the above-described embodiments of the question answering method.

[0102] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.

[0103] The above descriptions of the various embodiments tend to emphasize the differences between the various embodiments. The same or similar parts can be referred to each other. For the sake of brevity, they will not be repeated in this article.

[0104] In several embodiments provided by the present application, it should be understood that the disclosed methods and apparatuses can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the apparatuses or units can be in electrical, mechanical or other forms.

[0105] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units. They can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0106] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0107] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods in each embodiment of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.

[0108] If the technical solution of this application involves personal information, before the product applying the technical solution of this application processes personal information, it has clearly informed the personal information processing rules and obtained the autonomous consent of the individual. If the technical solution of this application involves sensitive personal information, before the product applying the technical solution of this application processes sensitive personal information, it has obtained the individual's separate consent and at the same time meets the requirements of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If an individual voluntarily enters the collection scope, it is regarded as consenting to the collection of their personal information; or on the device for personal information processing, when the personal information processing rules are informed by obvious signs / information, personal authorization is obtained through pop-up messages or by asking the individual to upload their personal information by themselves, etc.; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.

Claims

1. A method for constructing a knowledge chain library, characterized in that, it includes: Obtaining the output result after the large language model learns the knowledge point library; wherein, the output result at least includes the predicted relationships between the knowledge points in the knowledge point library; Based on the predicted relationships between the knowledge points, obtaining a number of candidate knowledge chains; Based on the large language model after learning the knowledge point library, detecting the candidate knowledge chains to obtain the detection results of the candidate knowledge chains; wherein, the detection results include whether the candidate knowledge chains are contradictory; Based on the detection results of the candidate knowledge chains, determining whether to select the candidate knowledge chains as target knowledge chains and save them to the knowledge chain library; Extracting the first keyword in the first knowledge point and the second keyword in the second knowledge point in the target knowledge chain; Based on the co-occurrence relationship between the first keyword and the second keyword, constructing a keyword mapping; Based on the new knowledge point and the keyword mapping, selecting candidate knowledge points associated with the new knowledge point from the knowledge point library; Based on the target knowledge chain newly constructed by the new knowledge point and the candidate knowledge points associated with it, expanding the knowledge chain library.

2. The method according to claim 1, characterized in that, the obtaining a number of candidate knowledge chains based on the predicted relationships between the knowledge points includes: Selecting the knowledge points from the knowledge point library as target knowledge points; Based on at least the predicted relationships, selecting at least one candidate knowledge point associated with the target knowledge point in the knowledge point library; Based on the target knowledge point and each of the candidate knowledge points associated with the target knowledge point, constructing candidate knowledge chains.

3. The method according to claim 2, characterized in that, the output result further includes the knowledge category of the knowledge point. Before constructing the candidate knowledge chains based on the target knowledge point and each of the candidate knowledge points associated with the target knowledge point, the method further includes at least one of the following: In response to the knowledge category of the target knowledge point being a clause category, extracting the target clause in the target knowledge point and querying the knowledge points in the knowledge point library that contain candidate clauses as candidate knowledge points associated with the target knowledge point; wherein, the candidate clause has a citation relationship with the target clause; In response to the knowledge category of the target knowledge point being a formula category, extracting the target formula in the target knowledge point, obtaining candidate formulas after numerical substitution and / or logical combination of the target formula, and querying the knowledge points in the knowledge point library that contain the candidate formulas as candidate knowledge points associated with the target knowledge point; In response to the knowledge category of the target knowledge point being a general category, identifying the semantic information of the target knowledge point and querying the knowledge points in the knowledge point library associated with the semantic information as candidate knowledge points associated with the target knowledge point based on the semantic information.

4. The method according to claim 1, characterized in that, The large language model after learning from the knowledge point library detects the candidate knowledge chain to obtain the detection result of the candidate knowledge chain, including: Obtain the memory knowledge after the large language model learns from the knowledge point library; wherein, the memory knowledge represents the semantic content of each knowledge point in the knowledge point library; Based on the memory knowledge, perform at least contradiction detection on the candidate knowledge chain to obtain a detection result including whether the candidate knowledge chain is contradictory.

5. The method according to any one of claims 1 to 4, wherein, The method of selecting candidate knowledge points associated with the new knowledge point from the knowledge point library based on the new knowledge point and the keyword mapping includes: Extract the keywords in the new knowledge point as the keywords to be processed; Based on the keywords to be processed and the keyword mapping, determine the third keyword having a mapping relationship with the keywords to be processed; Based on the third keyword, query the candidate knowledge points associated with the new knowledge point in the knowledge point library.

6. The method according to any one of claims 1 to 4, wherein, After determining whether to select the candidate knowledge chain as the target knowledge chain and save it to the knowledge chain library based on the detection result of the candidate knowledge chain, the method further includes: In response to a new knowledge point, update the knowledge point library based on the new knowledge point, and return to execute the step of obtaining the output result after the large language model learns from the knowledge point library to update the knowledge chain library.

7. The method according to any one of claims 1 to 4, wherein, Before obtaining the output result after the large language model learns from the knowledge point library, the method further includes: Obtain the classification labels of each knowledge point in the knowledge point library; Based on the classification labels of the knowledge points, determine the learning logic for the large language model to learn the knowledge points, so that the large language model learns the knowledge points according to the learning logic of the knowledge points.

8. A question answering method, wherein, including: Obtain the question to be retrieved and obtain the knowledge chain library; wherein, the knowledge chain library is obtained by the knowledge chain library construction method according to any one of claims 1 to 7; Based on the knowledge chain library, generate an answer to the question to be retrieved.

9. The method according to claim 8, wherein, The method of generating an answer to the question to be retrieved based on the knowledge chain library includes: Based on the question to be retrieved, query the knowledge points in the knowledge chain library for answering the question to be retrieved as the matching knowledge points; Input the prompt text generated by the matching knowledge points into the large language model to obtain the judgment result output by the large language model; wherein, the judgment result includes: whether it is currently sufficient to answer the question to be retrieved, and the reference guidance when it is not sufficient to answer the question to be retrieved; Based on the reference guidance, query and update the matching knowledge points in the target knowledge chain including the matching knowledge points in the knowledge chain library. Return to the step of inputting the prompt text generated by the matched knowledge points into the large language model to obtain the judgment result output by the large language model, until the judgment result includes the answer to the question to be retrieved.

10. The method according to claim 9, wherein, the querying and updating of the matched knowledge points in the target knowledge chain including the matched knowledge points in the knowledge chain library based on the reference guidance includes: selecting a target knowledge chain as a matched knowledge chain in the knowledge chain library based on the reference guidance and the matched knowledge points; supplementing the matched knowledge points based on the knowledge points in the matched knowledge chain.

11. A knowledge chain library construction device, wherein, comprising: a result acquisition module, configured to acquire the output result after the large language model learns the knowledge point library; wherein, the output result at least includes the predicted relationships between the knowledge points in the knowledge point library; a candidate construction module, configured to obtain a number of candidate knowledge chains based on the predicted relationships between the knowledge points; a contradiction detection module, configured to detect the candidate knowledge chains based on the large language model after learning the knowledge point library to obtain the detection result of the candidate knowledge chains; wherein, the detection result includes whether the candidate knowledge chains are contradictory; a result determination module, configured to determine whether to select the candidate knowledge chains as target knowledge chains and save them to the knowledge chain library based on the detection result of the candidate knowledge chains; a keyword mapping module, configured to extract a first keyword in a first knowledge point and a second keyword in a second knowledge point in the target knowledge chain; construct a keyword mapping based on the co-occurrence relationship between the first keyword and the second keyword; select candidate knowledge points associated with the new knowledge point from the knowledge point library based on the new knowledge point and the keyword mapping; expand the knowledge chain library based on the newly constructed target knowledge chain composed of the new knowledge point and the candidate knowledge points associated with it.

12. A question answering device, wherein, comprising: an acquisition module, configured to acquire a question to be retrieved and acquire a knowledge chain library; wherein, the knowledge chain library is obtained by the knowledge chain library construction method according to any one of claims 1 to 7; a generation module, configured to generate an answer to the question to be retrieved based on the knowledge chain library.

13. An electronic device, wherein, comprising a memory and a processor coupled to each other, wherein program instructions are stored in the memory, and the processor is configured to execute the program instructions to implement the knowledge chain library construction method according to any one of claims 1 to 7, or to implement the question answering method according to any one of claims 8 to 10.

14. A computer-readable storage medium, wherein, storing program instructions capable of being run by a processor, the program instructions being used to implement the program instructions to implement the knowledge chain library construction method according to any one of claims 1 to 7, or to implement the question answering method according to any one of claims 8 to 10.

Citation Information

Patent Citations

  • Answer generation method and apparatus based on knowledge base, and intelligent session system

    CN109783624A

  • Knowledge mining method and device based on double-library linkage

    CN110874376A

  • Method and apparatus for question parsing, electronic device, and storage medium

    WO2021208703A1