A knowledge point search method and system based on binary tree structure

By constructing a binary tree structure retrieval mechanism in the knowledge base, the problem of traditional knowledge point retrieval methods being unable to comprehensively extract relevant knowledge points in the complex hierarchical structure knowledge base is solved, achieving more accurate and comprehensive knowledge point retrieval, and improving the question and answer system. professionalism and reliability.

CN118964584BActive Publication Date: 2025-01-21SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411433036.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-01-21
Estimated Expiration
2044-10-15

AI Technical Summary

Technical Problem

When facing a knowledge base with a complex hierarchical structure, traditional knowledge point search methods cannot fully extract relevant knowledge points, resulting in incomplete answers and affecting the professionalism and reliability of the question-and-answer system.

Method used

Adopt knowledge point retrieval methods and systems based on the binary tree structure, build a hierarchically structured knowledge base, and use the binary tree retrieval mechanism to comprehensively collect relevant knowledge points to ensure the integrity and depth of information.

Benefits of technology

It significantly improves the accuracy and comprehensiveness of knowledge point retrieval in specific tasks, ensuring that users can get more accurate and comprehensive answers, and improving the professionalism and reliability of the question and answer system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964584B_ABST
    Figure CN118964584B_ABST
Patent Text Reader

Abstract

The present invention discloses a knowledge point search method based on a binary tree structure, which belongs to electronic digital data processing, including: S1 constructing a hierarchical knowledge base; S2 obtaining a user input question and using a large language model to identify its intent after a certain rewriting; S3 performing similarity search and matching between the processed user input and the knowledge points in the database, and returning the top‑k search results; S4 constructing a binary tree search mechanism, using the idea of ​​"from root to leaf" and "from leaf to root" to search for knowledge points in the search results. The present invention also discloses a knowledge point search system based on a binary tree structure. The present invention can be widely used in question-answering systems of complex hierarchical knowledge bases and scenarios where multiple levels of knowledge points need to be accurately searched, and can effectively avoid the problem of missing knowledge points due to top‑k search restrictions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to electronic digital data processing, and more specifically, to a knowledge point search method and system based on a binary tree structure. Background Art

[0002] With the widespread application of big models in the field of natural language processing (NLP), question-answering systems with big models as the core have shown great potential and application value in various professional fields. In order to provide accurate and professional answers in specific fields, big model question-answering systems often need to rely on structured knowledge bases. These knowledge bases not only need to cover a wide range of professional knowledge, but also need to be able to efficiently extract knowledge points that meet user needs. Therefore, the construction and retrieval strategy of the knowledge base directly affects the performance of the big model question-answering system in specific fields.

[0003] In fields with complex hierarchical structures such as technical documents, law, and medicine, traditional knowledge retrieval methods face significant challenges. Specifically, traditional retrieval methods usually rely on fixed retrieval parameters and similarity calculations. However, such methods are prone to missing some relevant knowledge points due to top-k retrieval restrictions. For example, when a user asks a complex question that needs to cover multiple knowledge points, the system may only return some knowledge points, resulting in incomplete answers, which directly affects the professionalism and reliability of the question-answering system. That is, traditional knowledge point retrieval methods cannot fully extract relevant knowledge points when faced with a knowledge base with a complex hierarchical structure. Common problems include:

[0004] (1) Limited search scope: Traditional top-k search methods can usually only return the closest few knowledge points, which is insufficient for problem scenarios that require comprehensive answers, especially when the knowledge points span multiple levels.

[0005] (2) Difficulty in processing hierarchical structures: In a knowledge system with complex hierarchies, simple similarity retrieval is difficult to cope with multi-level knowledge relationships and cannot guarantee a comprehensive retrieval of all relevant knowledge points.

[0006] Therefore, a more intelligent and comprehensive knowledge point retrieval strategy is needed to solve the above problems. Summary of the invention

[0007] The technical problem to be solved by the present invention is to address the deficiencies of the prior art and provide a knowledge point search method and system based on a binary tree structure, thereby ensuring that a large model can extract all relevant knowledge points from the knowledge base, thereby improving the professionalism and reliability of the question-answering system.

[0008] The present invention provides a knowledge point search method based on a binary tree structure, comprising the following steps:

[0009] S1: Build a hierarchical knowledge base;

[0010] S2: Get user input question , and the user inputs a question After rewriting, use the pre-trained large language model to identify the intent and obtain the intent recognition result ;

[0011] S3: The intention recognition result Perform similarity retrieval and matching with the knowledge points in the knowledge base, and return the top k knowledge points with the highest similarity ; k is a pre-set parameter, indicating the knowledge points returned the number of

[0012] S4: Construct a binary tree retrieval mechanism to store the knowledge points Input into the binary tree retrieval mechanism for knowledge points Get the target knowledge point set .

[0013] As a further improvement, step S4 specifically includes:

[0014] S4.1: The knowledge points are indexed by the index table Make hierarchical judgment to determine the knowledge points Is it an intermediate root node or a terminal leaf node?

[0015] S4.2: If the knowledge point After hierarchical judgment, it is determined to be a terminal leaf node, and the following operations are performed:

[0016] S4.2.1: Identify the knowledge point through the index table The node position is determined by moving up the binary tree structure to determine the node on the previous level. ;

[0017] S4.2.2: The upper level node As the new root node, collect all its leaf nodes along the binary tree structure downward The following knowledge points:

[0018] S4.3: If the knowledge point After hierarchical judgment, it is determined to be an intermediate root node, and the following operations are performed:

[0019] S4.3.1: Identify the knowledge point through the index table The node location;

[0020] S4.3.2: Collect all leaf nodes along the binary tree structure downward The following knowledge points:

[0021] S4.4 All the obtained knowledge point contents and the knowledge point Merge to get the target knowledge point set .

[0022] As a further improvement, step S1 specifically includes:

[0023] S1.1: Clean the original bibliographic text to add heading numbers ;

[0024] S1.2: For each of the above title numbers and the content of the bibliographic text as an original knowledge point , for each of the original knowledge points Add prefixes to get knowledge points ;

[0025] S1.3: for the knowledge points Create an index dictionary table M ;

[0026] S1.4: The above knowledge points Vectorization is performed to build a knowledge base.

[0027] Furthermore, step S1.2 is specifically as follows:

[0028] The original knowledge point Title number All the title names corresponding to the parent title numbers are used as prefixes, expressed as follows:

[0029] ,

[0030] in, Represents the original knowledge point The full title number, Indicates the title number No. Level parent title number, Indicates the total number of levels of title numbers. express The corresponding title name, represents a union;

[0031] The prefix And original knowledge points Merge into knowledge points .

[0032] As a further improvement, step S2 specifically includes:

[0033] S2.1: For the input question Perform pre-processing;

[0034] S2.2: Combine historical conversation records For the input question Rewrite and complete to form user query ;

[0035] S2.3: Use the pre-trained large language model to query the user Perform intent recognition and obtain intent recognition results .

[0036] Furthermore, the preprocessing includes: Perform word segmentation, remove stop words, and tag parts of speech.

[0037] As a further improvement, in step S3, the intention recognition result is converted into Perform similarity retrieval and matching with knowledge points in the knowledge base:

[0038] ,

[0039] in, Represents the knowledge base A vector of knowledge points, represents the vector dot product, represents the magnitude of a vector, Represents the similarity score.

[0040] Furthermore, in step S3, the first k knowledge points with the highest similarity are Specifically: according to the calculated similarity scores, select the top The knowledge points as search results.

[0041] A knowledge point search system based on a binary tree structure, the system comprising:

[0042] Knowledge base building module: used to convert the original bibliographic text into knowledge points , and based on all the above knowledge points Build a hierarchically structured knowledge base;

[0043] Intent recognition module: used to identify user input questions Rewrite and use the pre-trained large language model to rewrite the user input question Perform intent recognition and obtain intent recognition results ;

[0044] Knowledge point retrieval module: used to retrieve the intention recognition results Perform similarity retrieval and matching with the knowledge points in the knowledge base, and return the top k knowledge points with the highest similarity ; k is a pre-set parameter, indicating the knowledge points returned the number of

[0045] Binary tree knowledge point search mechanism module: used to build a binary tree search mechanism to Input into the binary tree retrieval mechanism for knowledge points Get the target knowledge point set .

[0046] Beneficial Effects

[0047] The advantages of the present invention are as follows: the present invention significantly improves the accuracy of specific tasks by constructing a knowledge base with a specific hierarchical structure and adopting a unique retrieval mechanism based on a binary tree. The knowledge base is constructed using bibliographic text data, and the system can understand the special needs of users in their questions through accurate recognition of user intentions. Furthermore, through in-depth retrieval based on a binary tree structure, the present invention can comprehensively collect relevant knowledge points, ensure the integrity and depth of information, and enable users to obtain more accurate and comprehensive answers. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a flow chart of the knowledge point search method based on the binary tree structure in the present invention.

[0049] Figure 2 It is a schematic diagram of the application process of the knowledge point search method based on the binary tree structure of the present invention in an actual question-answering system. DETAILED DESCRIPTION

[0050] The present invention will be further described below in conjunction with the embodiments, but it does not constitute any limitation to the present invention. Any limited number of modifications made by anyone within the scope of the claims of the present invention are still within the scope of the claims of the present invention.

[0051] like Figure 1 and Figure 2 As shown, a knowledge point search method based on a binary tree structure of the present invention has the following specific steps:

[0052] S1: Convert the original bibliographic text into several knowledge points, and then integrate them into a hierarchically structured knowledge base.

[0053] Furthermore, step S1 is specifically implemented by the following steps:

[0054] S1.1: Clean the original bibliographic text. Specifically, you can add title numbers according to the order and level of the chapters. The title numbers should be in a hierarchical representation. For example, "3.1" of the third largest chapter should be "3.3.1" after adding the title number.

[0055] S1.2: Each title number and its content as an original knowledge point , for each original knowledge point Add prefixes to achieve the original knowledge points Rewrite to get knowledge points The specific adding process is as follows: for the original knowledge point The corresponding title number ,Add to All the title names corresponding to the parent title numbers are used as prefixes to enhance the accuracy of similarity retrieval. Determined by the following formula:

[0056] ,

[0057] In the formula, Represents the original knowledge point The full title number, express No. Level parent title number, Indicates the total number of levels of title numbers. express The corresponding title name, Indicates a union. And original knowledge points Merge into knowledge points .

[0058] S1.3: Knowledge points Create an index dictionary table , where the key is the title number and the value is the corresponding knowledge point content with the prefix added. The index dictionary table The construction formula is:

[0059] ,

[0060] in, Indicates the title number, Indicates the corresponding knowledge point content with the prefix added.

[0061] S1.4: Each knowledge point Vectorization is performed to build a knowledge base.

[0062] S2: Get user input question , and the user inputs a question After rewriting, use the pre-trained large language model to identify the intent and obtain the intent recognition result .

[0063] Step S2 specifically includes the following steps:

[0064] S2.1: Receive the original input question from the user , and preprocess it. Preprocessing includes but is not limited to word segmentation, stop word removal, part-of-speech tagging, etc.

[0065] S2.2: Combine historical conversation records Input question Rewrite and complete to form user query . The process can be expressed as:

[0066] ,

[0067] in, Represents a rewriting function, which semantically completes and rewrites the original question based on historical conversation records to improve the accuracy of intent recognition. This step usually uses a pre-trained large language model, such as GPT-4, to achieve the purpose of rewriting by writing a specific prompt and passing in historical conversations as context information.

[0068] S2.3: Use a pre-trained large language model (LLM), such as GPT-4, to rewrite the user query Perform intent recognition and obtain the final intent recognition result .

[0069] S3: The intention recognition result Perform similarity retrieval and matching with the knowledge points in the knowledge base, and return the top k knowledge points with the highest similarity , that is, return the top-k knowledge points . Where k is a pre-set parameter, indicating the knowledge points returned The number of.

[0070] Step S3 specifically includes the following steps:

[0071] In step S3, the intention recognition result is converted into Perform similarity retrieval and matching with knowledge points in the knowledge base:

[0072] ,

[0073] in, Represents the knowledge base A vector of knowledge points, represents the vector dot product, represents the magnitude of a vector, Represents the similarity score.

[0074] In addition, the top k knowledge points with the highest similarity Specifically: according to the calculated similarity scores, select the top The knowledge points as search results.

[0075] S4: Construct a binary tree search mechanism, and use the ideas of "from root to leaf" and "from leaf to root" to search for all knowledge points in the search results to obtain the target knowledge point set .

[0076] Step S4 includes the following steps:

[0077] S4.1: For each retrieved knowledge point , it is necessary to perform hierarchical judgment through the index table to determine whether it is an intermediate root node or a terminal leaf node.

[0078] S4.2: If the knowledge point After hierarchical judgment, it is found to be a terminal leaf node, and the following operations are performed:

[0079] S4.2.1: Identify knowledge points through index tables The node position is determined by moving up the binary tree structure to determine the node on the previous level. ;

[0080] S4.2.2: As the new root node, collect all its leaf nodes along the binary tree structure downward The following knowledge points.

[0081] S4.3: If the knowledge point After hierarchical judgment, it is found to be an intermediate root node, and the following operations are performed:

[0082] S4.3.1: Identify knowledge points through index tables The node location;

[0083] S4.3.2: Collect all leaf nodes along the binary tree structure downward The following knowledge points.

[0084] S4.4 will obtain all the knowledge points and knowledge points Merge to get the final knowledge point set , complete the check of knowledge points.

[0085] In the prior art, when a user asks a question, the system usually generates an answer by retrieving the top K (i.e., top-k) knowledge points with the highest similarity. However, when faced with "concept enumeration" questions such as "what are the symptoms of xxx disease", traditional retrieval methods may cause some relevant knowledge points to be missed due to the hierarchical structure of knowledge points in the knowledge base, especially when the top-k is set too small. At the same time, an overly large top-k will result in the return of too many irrelevant knowledge points, which will affect the model's understanding ability and even exceed the model input carrying range.

[0086] Therefore, based on the problems existing in the prior art, the present invention significantly improves the accuracy and comprehensiveness of knowledge point retrieval in specific tasks, such as "concept enumeration" tasks, by constructing a knowledge base with a specific hierarchical structure and adopting a unique retrieval mechanism based on a binary tree. The knowledge base is constructed using bibliographic data, and the system can understand the special needs of users in their questions through accurate identification of user intent. Furthermore, through in-depth retrieval based on a binary tree structure, the present invention can comprehensively collect relevant knowledge points, ensure the integrity and depth of information, and enable users to obtain more accurate and comprehensive answers.

[0087] A knowledge point search system based on a binary tree structure, which is used to implement the above-mentioned knowledge point search method based on a binary tree structure, specifically includes:

[0088] Knowledge base construction module: This module is responsible for converting the original bibliographic text into several knowledge points and then integrating them into a hierarchically structured knowledge base;

[0089] Intent recognition module: This module uses a pre-trained large language model to rewrite the user's original input and recognize the intent of the final query;

[0090] Knowledge point retrieval module: This module is responsible for calculating the similarity between the rewritten final query and each knowledge point vector in the knowledge base, and returns the top k knowledge points with the highest similarity;

[0091] Binary tree knowledge point search mechanism module: This module is used to build a binary tree search mechanism, and uses the ideas of "from root to leaf" and "from leaf to root" to search the knowledge points in the search results to obtain the target knowledge point set. .

[0092] When working, the knowledge base construction module first processes the original bibliographic text, builds an index dictionary table and vectorizes it to provide basic data for subsequent operations. The intention recognition module accepts user questions, performs preprocessing and rewrites to complete and recognize the intention. The knowledge point retrieval module receives the data processed by the user query rewrite and intention recognition module, and determines whether a full search operation is required based on the recognized intention. If necessary, the received user query is searched for similarity and the top-k knowledge points are returned to the binary tree retrieval mechanism module. The binary tree retrieval mechanism module performs a full search operation on the received knowledge points to obtain the final set of knowledge points.

[0093] The above is only a preferred embodiment of the present invention. It should be pointed out that for those skilled in the art, several modifications and improvements can be made without departing from the structure of the present invention, which will not affect the effect of the implementation of the present invention and the practicality of the patent.

Claims

1. A knowledge point search method based on a binary tree structure, characterized in that: The following steps are involved: S1: Build a hierarchical knowledge base; S2: Get user input question , and the user inputs a question After rewriting, use the pre-trained large language model to identify the intent and obtain the intent recognition result ; S3: The intention recognition result Perform similarity retrieval and matching with the knowledge points in the knowledge base, and return the top k knowledge points with the highest similarity ; k is a pre-set parameter, indicating the knowledge points returned the number of S4: Construct a binary tree retrieval mechanism to store the knowledge points Input into the binary tree retrieval mechanism for knowledge points Get the target knowledge point set ; Step S4 specifically includes: S4.1: The knowledge points are indexed by the index table Make hierarchical judgment to determine the knowledge points Is it an intermediate root node or a terminal leaf node? S4.2: If the knowledge point After hierarchical judgment, it is determined to be a terminal leaf node, and the following operations are performed: S4.2.1: Identify the knowledge point through the index table The node position is determined by moving up the binary tree structure to determine the node on the previous level. ; S4.2.2: The upper level node As the new root node, collect all its leaf nodes along the binary tree structure downward The following knowledge points: S4.3: If the knowledge point After hierarchical judgment, it is determined to be an intermediate root node, and the following operations are performed: S4.3.1: Identify the knowledge point through the index table The node location; S4.3.2: Collect all leaf nodes along the binary tree structure downward The following knowledge points: S4.4: Combine all the obtained knowledge point contents with the knowledge point Merge to get the target knowledge point set ; Step S1 specifically includes: S1.1: Clean the original bibliographic text to add heading numbers ; S1.2: For each of the above title numbers and the content of the bibliographic text as an original knowledge point , for each of the original knowledge points Add prefixes to get knowledge points ; S1.3: for the knowledge points Create an index dictionary table M ; S1.4: Each of the above knowledge points Vectorize to build a knowledge base; Step S1.2 is specifically as follows: The original knowledge point Title number All the title names corresponding to the parent title numbers are used as prefixes, expressed as follows: , in Represents the original knowledge point The full title number, Indicates the title number No. Level parent title number, Indicates the total number of levels of title numbers. express The corresponding title name, represents a union; The prefix And original knowledge points Merge into knowledge points .

2. A knowledge point search method based on a binary tree structure as claimed in claim 1, characterized in that: Step S2 specifically includes: S2.1: For the input question Perform pre-processing; S2.2: Combine historical conversation records For the input question Rewrite and complete to form user query ; S2.3: Use the pre-trained large language model to query the user Perform intent recognition and obtain intent recognition results .

3. A knowledge point search method based on a binary tree structure as claimed in claim 2, characterized in that: The preprocessing includes: Perform word segmentation, remove stop words, and tag parts of speech.

4. A knowledge point search method based on a binary tree structure as claimed in claim 1, characterized in that: In step S3, the intention recognition result is converted into Perform similarity retrieval and matching with knowledge points in the knowledge base: in, Represents the knowledge base The vector of knowledge points, represents the vector dot product, represents the magnitude of a vector, Represents the similarity score.

5. A knowledge point search method based on a binary tree structure as claimed in claim 4, characterized in that: In step S3, the first k knowledge points with the highest similarity are Specifically: according to the calculated similarity scores, select the top The knowledge points as search results.

6. A knowledge point search system based on a binary tree structure, characterized in that: The system includes: Knowledge base building module: used to convert the original bibliographic text into knowledge points , and based on all the above knowledge points Build a hierarchically structured knowledge base; Intent recognition module: used to identify user input questions Rewrite and use the pre-trained large language model to rewrite the user input question Perform intent recognition and obtain intent recognition results ; Knowledge point retrieval module: used to retrieve the intention recognition results Perform similarity retrieval and matching with the knowledge points in the knowledge base, and return the top k knowledge points with the highest similarity ; k is a pre-set parameter, indicating the knowledge points returned the number of Binary tree knowledge point search mechanism module: used to build a binary tree search mechanism to Input into the binary tree retrieval mechanism for knowledge points Get the target knowledge point set ; The binary tree knowledge point search mechanism module specifically includes: S4.1: The knowledge points are indexed by the index table Make hierarchical judgment to determine the knowledge points Is it an intermediate root node or a terminal leaf node? S4.2: If the knowledge point After hierarchical judgment, it is determined to be a terminal leaf node, and the following operations are performed: S4.2.1: Identify the knowledge point through the index table The node position is determined by moving up the binary tree structure to determine the node on the previous level. ; S4.2.2: The upper level node As the new root node, collect all its leaf nodes along the binary tree structure downward The following knowledge points: S4.3: If the knowledge point After hierarchical judgment, it is determined to be an intermediate root node, and the following operations are performed: S4.3.1: Identify the knowledge point through the index table The node location; S4.3.2: Collect all leaf nodes along the binary tree structure downward The following knowledge points: S4.4: Combine all the obtained knowledge point contents with the knowledge point Merge to get the target knowledge point set ; The knowledge base construction module specifically includes: S1.1: Clean the original bibliographic text to add heading numbers ; S1.2: For each of the above title numbers and the content of the bibliographic text as an original knowledge point , for each of the original knowledge points Add prefixes to get knowledge points ; S1.3: for the knowledge points Create an index dictionary table M ; S1.4: Each of the above knowledge points Vectorize to build a knowledge base; Among them, step S1.2 is specifically as follows: The original knowledge point Title number All the title names corresponding to the parent title numbers are used as prefixes, expressed as follows: , in Represents the original knowledge point The full title number, Indicates the title number No. Level parent title number, Indicates the total number of levels of title numbers. express The corresponding title name, represents a union; The prefix And original knowledge points Merge into knowledge points .

Citation Information

Patent Citations

  • A method for acquiring knowledge point semantic vectors and a method and a system for determining correlative knowledge points

    CN105893362A

  • Large language model intelligent question and answer work order processing method and device based on optimized knowledge base

    CN118535702A