Retrieval method, device and equipment based on knowledge tree, medium and product

Through the search method based on the knowledge tree, the pre-constructed knowledge tree structure is used to match the user input text, determine the leaf nodes and display their knowledge text, which solves the problem of insufficient time and accuracy in large language model retrieval, and achieves faster and more accurate knowledge information retrieval.

CN119721197APending Publication Date: 2025-03-28INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411856829.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, knowledge information retrieval through large language models has problems such as time-consuming and insufficient accuracy of search results, especially in the professional field, which is difficult to provide accurate results.

Method used

Using a knowledge tree-based search method, the user input text is obtained and matched through the pre-constructed knowledge tree structure, the successful matching leaf node is determined, and the knowledge text bound to it is used as the search result.

Benefits of technology

It significantly improves the search speed and accuracy of search results, solves the problems of inefficiency and insufficient accuracy in traditional large language models retrieval, especially in professional fields, which greatly improves the accuracy of search results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119721197A_ABST
    Figure CN119721197A_ABST
Patent Text Reader

Abstract

The invention provides a retrieval method and device based on a knowledge tree, equipment, a medium and a product, and relates to the technical field of data processing. The method comprises the following steps: acquiring a user input text, and matching the user input text with a description text of a root node of a knowledge tree to obtain a first matching result; when the first matching result is successful matching, matching the user input text with a description text of a first node except a root node in the knowledge tree to obtain a second matching result; when a second matching result corresponding to a first target node in the first nodes is successful matching, determining the type of the first target node; and when the type of the first target node is a leaf node, taking the knowledge text bound with the first target node as a retrieval result of the text input by the user. According to the method provided by the invention, the retrieval speed and the accuracy of the retrieval result are improved by utilizing the pre-constructed knowledge tree structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a retrieval method, device, equipment, medium and product based on a knowledge tree. Background Art

[0002] In work, study and life, quickly and accurately obtaining knowledge and information is essential for solving problems and making decisions. Efficient knowledge and information retrieval can significantly save time and improve the work efficiency of individuals and organizations.

[0003] In the prior art, database retrieval is usually performed by relying on a pre-trained large language model to obtain the required knowledge information.

[0004] However, retrieving knowledge information through large language models is not only time-consuming, but also has the problem of insufficient accuracy of retrieval results in professional fields. Summary of the invention

[0005] The present application provides a knowledge tree-based retrieval method, apparatus, device, medium and product for improving the retrieval speed and the accuracy of retrieval results by utilizing a pre-built knowledge tree structure.

[0006] In a first aspect, the present application provides a knowledge tree-based retrieval method, comprising:

[0007] Acquire user input text, and match the user input text with the description text of the root node of the knowledge tree to obtain a first matching result;

[0008] When the first matching result is a successful match, the user input text is matched with the description text of the first node other than the root node in the knowledge tree to obtain a second matching result;

[0009] When the second matching result corresponding to the first target node in the first node is a successful match, determining the type of the first target node;

[0010] When the type of the first target node is a leaf node, the knowledge text bound to the first target node is used as the search result of the user input text.

[0011] In a second aspect, the present application provides a retrieval device based on a knowledge tree, comprising:

[0012] A first matching module, used to obtain a user input text, and match the user input text with a description text of a root node of the knowledge tree to obtain a first matching result;

[0013] A second matching module is used to match the user input text with the description text of the first node other than the root node in the knowledge tree to obtain a second matching result when the first matching result is a successful match;

[0014] A node determination module, configured to determine the type of the first target node when the second matching result corresponding to the first target node in the first node is a successful match;

[0015] The result output module is used to use the knowledge text bound to the first target node as the search result of the user input text when the type of the first target node is a leaf node.

[0016] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0017] Memory stores computer-executable instructions;

[0018] The processor executes the computer execution instructions stored in the memory to implement a knowledge tree-based retrieval method according to the first aspect of the invention.

[0019] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a processor, they are used to implement a knowledge tree-based retrieval method of the invention content of the first aspect.

[0020] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, is used to implement a knowledge tree-based retrieval method of the invention content of the first aspect.

[0021] The present application provides a retrieval method, device, equipment, medium and product based on a knowledge tree, including: first, obtaining a user input text, and matching the user input text with the description text of the root node of the knowledge tree to obtain a first matching result; then, when the first matching result is a successful match, matching the user input text with the description text of the first node other than the root node in the knowledge tree to obtain a second matching result; then, when the second matching result corresponding to the first target node in the first node is a successful match, determining the type of the first target node; finally, when the type of the first target node is a leaf node, using the knowledge text bound to the first target node as the retrieval result of the user input text. The following technical effects are achieved: first, the knowledge tree where the root node with a successful match is located is determined according to the user input text, and then the leaf node with a successful match is determined from the knowledge tree, and the knowledge text bound to the leaf node is displayed to the user as the retrieval result of the user input text, so as to achieve efficient extraction and presentation of retrieval results directly from the knowledge tree. By initially matching the user input text with the root nodes of each knowledge tree, the most relevant knowledge tree can be quickly determined, and then the most relevant leaf nodes can be further matched from the knowledge tree, which can shorten the search time, significantly improve the search speed and the accuracy of the search results, and solve the problems of low efficiency and lack of accuracy in traditional large language model search. And by creating corresponding knowledge trees for the knowledge information in each professional field, the accuracy of the search results in the search of professional field knowledge is greatly improved, which can provide users with faster and more accurate knowledge information search results. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0023] Figure 1 A schematic diagram of an application scenario of a knowledge tree-based retrieval method provided in an embodiment of the present application.

[0024] Figure 2 A schematic diagram of a flow chart of a knowledge tree-based retrieval method provided in an embodiment of the present application.

[0025] Figure 3 A schematic diagram from the first target node to the leaf node provided in an embodiment of the present application.

[0026] Figure 4 A schematic diagram of the structure of a knowledge tree-based retrieval device provided in an embodiment of the present application.

[0027] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0028] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0029] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0030] In the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will appreciate that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference. It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way. In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more.

[0031] It should be noted that the "at..." in the embodiment of the present application can be the instant when a certain situation occurs, or can be a period of time after a certain situation occurs, and the embodiment of the present application does not specifically limit this. In addition, the knowledge tree-based retrieval method provided in the embodiment of the present application is only used as an example, and a knowledge tree-based retrieval method can also include more or less content.

[0032] It should be noted that the knowledge tree-based retrieval method, device, equipment, medium and product provided in the present application can be used in the field of data processing technology, and can also be used in any field outside the field of data processing technology. The application field of the knowledge tree-based retrieval method, device, equipment, medium and product in the present application is not limited.

[0033] In many scenarios of modern work, study and daily life, people urgently need to quickly and accurately obtain the required knowledge and information in order to efficiently solve problems or make wise decisions. An efficient knowledge and information retrieval mechanism can undoubtedly greatly save valuable time resources, thereby improving the work efficiency of individuals and organizations.

[0034] Traditional retrieval methods generally rely on pre-trained large language models to retrieve knowledge information from huge databases. Although this method provides users with a convenient way to obtain information and meets basic needs to a certain extent. However, in practical applications, the inherent time-consuming problem of retrieval through large language models cannot be ignored. Therefore, traditional methods have the problem of being time-consuming. Moreover, when it comes to professional knowledge, especially in professional and technical fields such as medicine, law, and finance, it is usually difficult to understand complex business processes and the nuances of different scenarios when searching the database through pre-trained large language models, resulting in the output of retrieval results that may be too generalized or inaccurate, so that the accuracy of the retrieval results is usually low and cannot accurately meet the specific needs of users. Therefore, there is still a lot of room for improvement.

[0035] Based on this, the embodiment of the present application proposes a retrieval method, device, equipment, medium and product based on a knowledge tree, which can be used in the field of data processing technology, aiming to solve the above technical problems of the prior art. By utilizing the pre-built knowledge tree structure, the retrieval results are efficiently extracted and presented directly from the knowledge tree, thereby significantly improving the speed of retrieval and the accuracy of the retrieval results. The knowledge tree is a hierarchical data structure that can effectively represent the concepts and their interrelationships in the knowledge field, so that the retrieval process is not limited to simple text matching, but can deeply understand the query intent and provide results that are more relevant to user needs. By introducing the innovative structure of the knowledge tree, the problems of inefficiency and lack of accuracy in traditional large language model retrieval can be solved, thereby significantly accelerating the retrieval speed of knowledge information, and in the retrieval of professional field knowledge, greatly improving the accuracy of the retrieval results, and providing users with faster and more accurate knowledge information retrieval results.

[0036] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0037] In order to better understand the solution of the embodiment of the present application, an application scenario involved in the embodiment of the present application is first introduced below.

[0038] For specific application scenarios of this application, please refer to Figure 1 . Figure 1 A schematic diagram of an application scenario of a knowledge tree-based retrieval method provided in an embodiment of the present application. It should be noted that: Figure 1 What is shown are merely examples of application scenarios to which the embodiments of the present application can be applied, in order to help those skilled in the art understand the technical content of the present application, but it does not mean that the embodiments of the present application cannot be used in other devices, systems, environments or scenarios.

[0039] like Figure 1 As shown, the application scenario includes: a terminal device 110 and a server 120. In the specific implementation process, the terminal device 110 can be a desktop computer, a server, a tablet computer, a smart phone, a PDA (Personal Digital Assistant), a laptop computer, etc. Figure 1 The terminal device 110 shown is a smart phone and a computer, which is only an example and not a specific limitation. The terminal device 110 may also include other types of devices. The user can input text through the terminal device 110 and send it to the server 120 to retrieve knowledge information.

[0040] The server 120 may be implemented using a server or a cluster of multiple servers with more powerful processing capabilities and higher security. If possible, a computer or laptop with stronger computing power may be used as a replacement.

[0041] The connection between the terminal device 110 and the server 120 may be a wired connection or a wireless connection.

[0042] The server 120 stores a pre-built knowledge tree for receiving user input text sent by the terminal device 110, and accurately obtains search results based on the user input text by using the pre-built knowledge tree, and sends the search results back to the terminal device for the user to view.

[0043] Figure 2 The following is a flow chart of a knowledge tree-based retrieval method provided in an embodiment of the present application. Figure 2 As shown, the method includes:

[0044] S201: Obtain user input text, and match the user input text with the description text of the root node of the knowledge tree to obtain a first matching result.

[0045] In an embodiment of the present application, the executor of a knowledge tree-based retrieval method may be a server, which may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server, etc., without specific limitation.

[0046] Specifically, the server stores multiple knowledge trees containing knowledge in different professional fields that have been pre-constructed by technical personnel. Among them, one knowledge tree can correspond to the knowledge information of one professional field. Technical personnel can classify and organize the knowledge information in different professional fields to construct multiple knowledge trees.

[0047] The user can input a query text (i.e., the user input text) in the retrieval interface through an input device (such as a keyboard or a touch screen device). The server can receive and record the user input text and preprocess the user input text. For example, (1) perform text cleaning to remove unnecessary characters (such as punctuation marks), convert the case of letters, etc., so as to standardize the user input text; (2) perform word segmentation, segment the user input text according to language characteristics, and extract meaningful words or phrases; (3) remove stop words, remove common meaningless words (such as "de", "shi", etc.) to reduce noise; (4) perform word stemming and lemmatization: convert the words into their basic forms to more accurately match the description texts of each node in the knowledge tree later.

[0048] Then, the server can extract the description texts of the root nodes of each knowledge tree from the multiple pre-stored knowledge trees. Furthermore, by matching the user input text with the description texts of the root nodes of each knowledge tree, the first matching results between the user input text and each knowledge tree can be obtained. Among them, the description text can include the node name text and the node function description text. By splicing these two texts, the description text of the node can be obtained. The node name is a descriptive name for the concept represented by the node, which can be a professional term, a phrase, a proper noun, etc. The node function description can provide detailed information about the use of the knowledge represented by the node, describe the application of the node in different scenarios and its role in the knowledge tree, as well as information about the association between this node and other nodes, which can be a short paragraph or a sentence.

[0049] S202. When the first matching result is a successful match, match the user input text with the description text of the first node other than the root node in the knowledge tree to obtain a second matching result.

[0050] Specifically, after the server determines the knowledge tree where the root node that successfully matches the user input text is located, it can further match the user input text with the description texts of multiple first nodes other than the root node in this knowledge tree, so as to obtain the second matching results between the user input text and the description texts of each first node.

[0051] S203. When the second matching result corresponding to the first target node in the first nodes is a successful match, determine the type of the first target node.

[0052] Specifically, after determining the first target node that successfully matches the user input text, the server may further determine whether the type of the first target node is a leaf node.

[0053] S204: When the type of the first target node is a leaf node, the knowledge text bound to the first target node is used as a search result of the user input text.

[0054] Specifically, after determining that the type of the first target node is a leaf node, the server may use the knowledge text bound to the first target node as the search result of the user input text, and display the search result to the user through the user interface.

[0055] In addition, the server can display the search results in a variety of ways, such as text, graphics, or interactive content, to enhance the user experience.

[0056] A knowledge tree-based retrieval method provided in this embodiment includes: first, obtaining user input text, and matching the user input text with the description text of the root node of the knowledge tree to obtain a first matching result; then, when the first matching result is a successful match, matching the user input text with the description text of the first node other than the root node in the knowledge tree to obtain a second matching result; then, when the second matching result corresponding to the first target node in the first node is a successful match, determining the type of the first target node; finally, when the type of the first target node is a leaf node, using the knowledge text bound to the first target node as the retrieval result of the user input text.

[0057] The following technical effects are achieved: first, the knowledge tree where the root node with successful matching is located is determined based on the user input text, and then the leaf node with successful matching is determined from the knowledge tree, and the knowledge text bound to the leaf node is displayed to the user as the search result of the user input text, so as to achieve efficient extraction and presentation of search results directly from the knowledge tree. By preliminarily matching the user input text with the root nodes of each knowledge tree, the most relevant knowledge tree can be quickly determined, and then the most relevant leaf nodes can be further matched from the knowledge tree, which can shorten the search time, significantly improve the search speed and the accuracy of the search results, and solve the problems of low efficiency and insufficient accuracy in traditional large language model search. And by creating corresponding knowledge trees for the knowledge information of each professional field, the accuracy of the search results is greatly improved in the search of professional field knowledge, and then faster and more accurate knowledge information retrieval results can be provided to users.

[0058] In a possible implementation, matching the user input text with the description text of any node of the knowledge tree includes:

[0059] S301: Calculate the vector similarity between the user input text and the description text of any node.

[0060] Specifically, in order to calculate the vector similarity between the user input text and the description text of any node, and determine whether the match is successful based on the similarity, the server can first use text vectorization technology, such as term frequency-inverse document frequency (TF-IDF), or word embedding models, such as word vector (Word to Vector, Word2Vec), to convert the user input text and the description text of any node into corresponding vectors. Then, the cosine similarity and other measurement methods can be used to calculate the similarity between the vectors to obtain the vector similarity between the user input text and the description text of any node.

[0061] S302: When the vector similarity is greater than or equal to a preset threshold, determine that the match is successful.

[0062] Specifically, the server may set a reasonable preset threshold (eg, 0.75, 0.8, or 0.9, etc.) according to the actual application scenario to distinguish whether the match is successful or not. If the calculated vector similarity is greater than or equal to the preset threshold, it can be determined that the match is successful.

[0063] S303: When the vector similarity is less than a preset threshold, determine that the matching fails.

[0064] Specifically, if the calculated vector similarity is less than a preset threshold, the server may determine that the match fails.

[0065] A knowledge tree-based retrieval method provided in an embodiment of the present application first converts a user input text and a description text of any node into corresponding vectors, and then obtains the vector similarity between the user input text and the description text of any node by calculating the similarity between the vectors. Then, when the vector similarity is greater than or equal to a preset threshold, the match is determined to be successful. Compared with the method of matching and retrieving in a database through a large language model in the prior art, by comparing the vector similarity, the nodes that are successfully matched can be quickly determined, thereby shortening the retrieval time and improving the retrieval efficiency.

[0066] In a possible implementation, in the above step S301, calculating the vector similarity between the user input text and the description text of any node includes:

[0067] S401: Input the user input text into the large language model, and extract the user intention text from the user input text.

[0068] Specifically, in order to further improve the matching accuracy between the user input text and the description text of any node, the server can store a large language model pre-trained by technicians. In other words, the server can also accurately extract the user's intended text from the user input text by inputting the user input text into a pre-trained large language model, such as Bidirectional Encoder Representations from Transformers (BERT).

[0069] S402: Convert the user intention text into a user input vector, and obtain a description text vector of any node from the attribute information of any node.

[0070] Specifically, in order to further improve the retrieval efficiency and shorten the retrieval time, the attribute information of each node of the knowledge tree can further include the description text vector of the node, so that when calculating the vector similarity, the server can directly obtain the description text vector of the node from the attribute information of any node, so that there is no need to convert the description text of any node into a corresponding vector through the text vectorization technology every time the vector similarity is calculated. That is, by reducing the time of converting the description text of any node into the description text vector, the time of the entire retrieval process is shortened, thereby achieving the effect of improving the retrieval efficiency. In addition, by including the description text vector of any node in the attribute information of the node in advance, it is avoided that each time the vector similarity is calculated, the text vectorization technology is repeatedly used to convert the description text into the description text vector, which can save the server's computing power resources and avoid wasting the server's computing power resources, thereby further improving the retrieval efficiency.

[0071] In the embodiment of the present application, the server can convert the user intention text into a user input vector through a word vector model such as TF-IDF or Word2Vec, and convert the description text of any node into a description text vector. Alternatively, the server can also directly obtain the description text vector of any node from the attribute information of any node, which is not specifically limited here.

[0072] S403: Calculate the similarity between the user input vector and the description text vector as vector similarity.

[0073] Specifically, the server may calculate the similarity between the user input vector and the description text vector to obtain the vector similarity between the user input text and the description text.

[0074] A knowledge tree-based retrieval method provided in an embodiment of the present application can improve the matching accuracy between the user input text and the description text of any node, thereby improving the retrieval accuracy, by inputting the user input text into a pre-trained large language model to directly identify the user intention; by making the attribute information of each node of the knowledge tree further include the description text vector of the node, so that when calculating the vector similarity, the description text vector of the node can be directly obtained from the attribute information of any node, avoiding the need to convert the description text of any node into a corresponding vector through text vectorization technology each time the vector similarity is calculated, which can reduce the time for converting the description text of any node into a description text vector, save the computing power resources of the server, avoid wasting the computing power resources of the server, and thereby improve the retrieval efficiency.

[0075] In a possible implementation, after the above step S204, the method further includes:

[0076] S501: When the type of the first target node is a non-leaf node, first prompt information corresponding to each child node branch is generated according to the description text of each child node branch of the first target node.

[0077] In an embodiment of the present application, the first prompt information is used to instruct the user to enter the first supplementary text for the sub-node branch, and the description text of the sub-node branch includes the description text of the sub-node of the first target node and the description text of all subordinate nodes of the sub-node.

[0078] Specifically, when the server determines that the type of the first target node is a non-leaf node, it can further generate the first prompt information corresponding to each sub-node branch according to the description text of each sub-node branch under the first target node, and display it to the user, that is, by designing a questioning strategy for the user, the user is guided to provide more search information to the server by inputting the first supplementary text according to the first prompt information for the sub-node branch, so that the server can continue to traverse in the direction of the leaf nodes of the knowledge tree. The first prompt information corresponding to each sub-node branch can include keywords in the description text of the sub-node branch.

[0079] S502: Determine a target leaf node from leaf nodes corresponding to the first target node according to the first supplementary text input by the user.

[0080] Specifically, the server can parse and preprocess the first supplementary text input by the user, extract meaningful words or phrases from the first supplementary text, and convert them into a standard form, and then determine the target leaf node by matching each leaf node corresponding to the first target node.

[0081] S503: When there is one target leaf node, the knowledge text bound to the target leaf node is used as the search result of the user input text.

[0082] Specifically, when there is only one target leaf node that successfully matches the first supplementary text, the server can directly display the knowledge text bound to the target leaf node as a retrieval result to the user.

[0083] The embodiment of the present application provides a knowledge tree-based retrieval method, when the type of the first target node is a non-leaf node, by generating a first prompt message to further inquire the user, to guide the user to enter a first supplementary text for a subnode branch, to provide more retrieval information to the server, so that the server can continue to search in the direction of the leaf node in the knowledge tree according to the first supplementary text entered by the user, and finally determine the target leaf node. By continuing to inquire the user in this way, the accuracy of the retrieval results can be further improved.

[0084] In a possible implementation, in the above step S502, determining the target leaf node from the leaf nodes corresponding to the first target node according to the first supplementary text input by the user includes:

[0085] S601. For each child node branch of a first target node, construct a leaf node branch according to the leaf nodes included in the child node branch.

[0086] In the embodiment of the present application, the leaf node branch includes a branch from a child node of the first target node to a leaf node. In order to facilitate understanding of the concept of the leaf node branch, the leaf node branch is first described in detail. Figure 3 This is a schematic diagram of the first target node to the leaf node provided in the embodiment of the present application. Figure 3 As shown, the first target node A has child nodes B and C, child node B has leaf nodes D, E and F, and child node C has leaf node G.

[0087] Then the first target node A includes two sub-node branches, namely: the sub-node branch BDEF composed of the sub-node B and the leaf node D, the leaf node E and the leaf node F; and the sub-node branch CG composed of the sub-node C and the leaf node G.

[0088] Furthermore, in the first target node A, there are 4 leaf node branches, namely: leaf node branch BD formed by child node B and leaf node D; leaf node branch BE formed by child node B and leaf node E; leaf node branch BF formed by child node B and leaf node F; and leaf node branch CG formed by child node C and leaf node G.

[0089] S602: For each leaf node branch, obtain the association strength between the second target node and the parent node of the second target node from the attribute information of each second target node included in the leaf node branch.

[0090] Specifically, the second target node refers to each node in each leaf node branch. The association strength between the second target node and the parent node of the second target node can be pre-set by the technician based on previous practical experience, or can be determined based on the access frequency between different nodes. Different association strengths are equivalent to different access weights.

[0091] S603: For each second target node, calculate a first matching degree between the first supplementary text and the description text of the second target node, and adjust the first matching degree according to the association strength between the second target node and the parent node to obtain a second matching degree.

[0092] Specifically, the server may adjust the first matching degree between the first supplementary text and the description text of the second target node according to the association strength between the second target node and the parent node, so as to make the target leaf node finally determined more accurate.

[0093] S604. For each leaf node branch, the sum of the second matching degrees of each second target node included in the leaf node branch is used as the third matching degree between the leaf node branch and the first supplementary text, and the leaf node corresponding to the leaf node branch with the largest third matching degree is used as the target leaf node.

[0094] Specifically, the server can calculate the second matching degree of each second target node, and sum up the second matching degrees of multiple second target nodes included in each leaf node branch, so as to obtain the third matching degree between each leaf node branch and the first supplementary text, and then use the leaf node included in the leaf node branch with the largest third matching degree as the target leaf node, and display the knowledge text bound to the target leaf node as the retrieval result to the user.

[0095] The embodiment of the present application provides a knowledge tree-based retrieval method, which obtains the association strength between the second target node and the parent node of the second target node, and adjusts the calculated first matching degree according to the association strength to obtain the second matching degree, and then sums the second matching degrees in each leaf node branch to obtain the third matching degree corresponding to each leaf node branch, and takes the leaf node contained in the leaf node branch with the largest third matching degree as the target leaf node. By combining the association strength between the second target node and the parent node of the second target node to determine the target leaf node, the target leaf node finally determined can be made more accurate, thereby further improving the accuracy of the retrieval results.

[0096] In a possible implementation, after the above step S503, the method further includes:

[0097] S701: When there are multiple target leaf nodes, generate second prompt information for each target leaf node according to the description texts of the multiple target leaf nodes.

[0098] In an embodiment of the present application, the second prompt information is used to instruct the user to enter a second supplementary text for the target leaf node.

[0099] Specifically, when the server determines that there are multiple target leaf nodes, it can further generate second prompt information for each target leaf node based on the description texts of the multiple target leaf nodes and display it to the user, that is, through a secondary questioning method, guide the user to further provide more search information to the server by inputting the second supplementary text for the target leaf node based on the second prompt information, so that the server can determine the target leaf node corresponding to the second supplementary text from the multiple target leaf nodes. The second prompt information corresponding to each target leaf node can include keywords in the description text of the target leaf node.

[0100] S702: Use the knowledge text bound to the target leaf node corresponding to the second supplementary text as the search result of the user input text.

[0101] Specifically, after guiding the user to input the second supplementary text, the server may use the knowledge text bound to the target leaf node corresponding to the second supplementary text as the retrieval result of the user input text.

[0102] The embodiment of the present application provides a knowledge tree-based retrieval method. When there are multiple target leaf nodes, the second prompt information of each target leaf node is generated to continue to ask the user, thereby guiding the user to enter the second supplementary text for the target leaf node, and further providing more retrieval information to the server, so that the server can determine the target leaf node corresponding to the second supplementary text from multiple target leaf nodes according to the second supplementary text entered by the user, and use the knowledge text bound to the target leaf node corresponding to the second supplementary text as the retrieval result of the user input text. By asking the user twice, the accuracy of the retrieval result can be further improved.

[0103] In a possible implementation, after the above step S201, the method further includes:

[0104] S801: When the first matching result and / or the second matching result is a matching failure, the user input text is matched with a preset search text in a preset database to obtain a successfully matched target search text.

[0105] In the embodiment of the present application, the preset database includes preset search texts and their corresponding knowledge texts. Each preset search text corresponds to a user query template, and the knowledge text corresponding to the preset search text is a detailed answer or solution to the query.

[0106] Specifically, the server may also provide a backup search method, which may be enabled if a match fails during the search through the knowledge tree, resulting in a failure in the knowledge tree search. Specifically, the user input text is matched with the preset search text in the preset database, and the most similar or completely matched item is found by comparing the user input text with each preset search text in the preset database, thereby obtaining a successfully matched target search text.

[0107] S802: Use the knowledge text corresponding to the target search text in the preset database as the search result corresponding to the user input text.

[0108] Specifically, the server can determine the corresponding knowledge text in the preset database according to the target search text, and this knowledge text is the search result corresponding to the user input text. The server can return the knowledge text to the user as the final search result.

[0109] Optionally, if the alternative search method still cannot find matching results, the server can return a default response to the user or prompt the user to re-enter the search text.

[0110] The embodiment of the present application provides a knowledge tree-based retrieval method. By setting a backup retrieval method, if the knowledge tree retrieval match fails, it can be retrieved from the traditional database, thereby improving the flexibility of the method of the present application when facing complex or uncertain user input text, so that it can still provide useful information and display the retrieval results, ensuring that the method of the present application can strike a balance between accuracy and retrieval efficiency when providing retrieval results.

[0111] In a possible implementation, after the above step S204, the method further includes:

[0112] S901. When the search result is a knowledge text obtained in the knowledge tree, obtain the user's evaluation text of the search result, and generate adjustment information for the knowledge tree according to the evaluation text.

[0113] Specifically, after outputting the search results, the server can further dynamically adjust the knowledge tree according to user feedback. First, the server can request the user to provide evaluation feedback on the search results by sending a third indication message, such as marking the relevance of the results or requesting more information. The server can also collect the user's evaluation text on the search results to understand the user's satisfaction and specific suggestions for each search result, and extract key information by parsing the evaluation text to identify the specific issues, suggestions, and improvement points involved in the evaluation text of the user's feedback, and then generate adjustment information for the knowledge tree based on this information.

[0114] S902: Adjust the knowledge tree according to the adjustment information.

[0115] Specifically, the server can adjust the knowledge tree according to the adjustment information, for example, modify the content or structure of existing nodes, add new nodes or paths to cover user needs, delete or merge redundant or irrelevant nodes, etc., to ensure that the updated knowledge tree can better meet user needs and improve retrieval accuracy.

[0116] Optionally, the server may further consider cross-border application scenarios, and by setting conversions between different languages, the knowledge tree may further support retrieval in multiple languages, thereby satisfying multiple application scenarios.

[0117] A knowledge tree-based retrieval method provided in an embodiment of the present application allows users to evaluate retrieval results through a feedback and adjustment mechanism, and can continuously learn and adapt to user needs, thereby gradually improving the understanding of user query intent and enhancing the accuracy of scene recognition, thereby continuously improving the quality and service level of the knowledge tree by effectively utilizing user feedback, and ultimately improving the accuracy of subsequent retrieval results and improving user experience.

[0118] Figure 4 A schematic diagram of a knowledge tree-based retrieval device provided in an embodiment of the present application. Figure 4 As shown, the knowledge tree-based retrieval device includes: a first matching module 410, a second matching module 420, a node determination module 430 and a result output module 440;

[0119] A first matching module 410 is used to obtain a user input text, and match the user input text with a description text of a root node of the knowledge tree to obtain a first matching result;

[0120] A second matching module 420, configured to match the user input text with the description text of the first node other than the root node in the knowledge tree to obtain a second matching result when the first matching result is a successful match;

[0121] A node determination module 430, configured to determine the type of the first target node when the second matching result corresponding to the first target node in the first node is a successful match;

[0122] The result output module 440 is used to use the knowledge text bound to the first target node as the search result of the user input text when the type of the first target node is a leaf node.

[0123] In a possible design, the first matching module 410 and the second matching module 420 both include: a similarity calculation module, a matching determination module, and a non-matching determination module;

[0124] A similarity calculation module is used to calculate the vector similarity between the user input text and the description text of any node;

[0125] A matching determination module is used to determine that the match is successful when the vector similarity is greater than or equal to a preset threshold;

[0126] The mismatch determination module is used to determine that the match fails when the vector similarity is less than a preset threshold.

[0127] In a possible design, the similarity calculation module includes: an intention extraction module, a vector conversion module and a vector similarity module;

[0128] An intention extraction module is used to input the user input text into the large language model and extract the user intention text from the user input text;

[0129] A vector conversion module, used to convert the user intention text into a user input vector, and to obtain a description text vector of any node from the attribute information of any node;

[0130] The vector similarity module is used to calculate the similarity between the user input vector and the description text vector as the vector similarity.

[0131] In a possible design, the device further includes: a first questioning module, a target leaf node module, and a first result module;

[0132] A first inquiry module is used to generate first prompt information corresponding to each child node branch according to the description text of each child node branch of the first target node when the type of the first target node is a non-leaf node, the first prompt information is used to instruct the user to input a first supplementary text for the child node branch, and the description text of the child node branch includes the description text of the child node of the first target node and the description text of all subordinate nodes of the child node;

[0133] A target leaf node module, used to determine a target leaf node from leaf nodes corresponding to the first target node according to the first supplementary text input by the user;

[0134] The first result module is used to use the knowledge text bound to the target leaf node as the search result of the user input text when there is one target leaf node.

[0135] In a possible design, the target leaf node module includes: a leaf node branch module, an association strength module, an adjustment module and a summation module;

[0136] A leaf node branch module, for each child node branch of the first target node, constructing a leaf node branch according to the leaf nodes included in the child node branch, wherein the leaf node branch includes a branch from a child node of the first target node to a leaf node;

[0137] An association strength module, for obtaining, for each leaf node branch, an association strength between the second target node and the parent node of the second target node from the attribute information of each second target node included in the leaf node branch;

[0138] An adjustment module, configured to calculate, for each second target node, a first matching degree between the first supplementary text and the description text of the second target node, and adjust the first matching degree according to the association strength between the second target node and the parent node to obtain a second matching degree;

[0139] A summing module is used to take, for each leaf node branch, the sum of the second matching degrees of each second target node included in the leaf node branch as the third matching degree between the leaf node branch and the first supplementary text, and take the leaf node corresponding to the leaf node branch with the largest third matching degree as the target leaf node.

[0140] In a possible design, the device further includes: a second questioning module and a second result module;

[0141] A second inquiry module is used to generate second prompt information for each target leaf node according to the description texts of the multiple target leaf nodes when there are multiple target leaf nodes, and the second prompt information is used to instruct the user to input a second supplementary text for the target leaf node;

[0142] The second result module is used to use the knowledge text bound to the target leaf node corresponding to the second supplementary text as the retrieval result of the user input text.

[0143] In one possible design, the device further includes: a backup retrieval module and a third result module;

[0144] A backup search module, used for matching the user input text with a preset search text in a preset database to obtain a successfully matched target search text when the first matching result and / or the second matching result is a matching failure;

[0145] The second result module is used to use the knowledge text corresponding to the target search text in the preset database as the search result corresponding to the user input text.

[0146] In one possible design, the device further includes: a feedback module and an optimization module;

[0147] A feedback module, used for obtaining the user's evaluation text of the search result when the search result is the knowledge text obtained in the knowledge tree, and generating adjustment information for the knowledge tree according to the evaluation text;

[0148] The optimization module is used to adjust the knowledge tree according to the adjustment information.

[0149] The present embodiment provides a knowledge tree-based retrieval device that can execute a knowledge tree-based retrieval method of the above-mentioned embodiment. Its implementation principle and technical effects are similar and will not be described in detail in the present embodiment.

[0150] In the specific implementation of the aforementioned knowledge tree-based retrieval device, each module can be implemented as a processor, and the processor can execute computer-executable instructions stored in the memory, so that the processor executes the aforementioned knowledge tree-based retrieval method.

[0151] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device includes: at least one processor 510 and a memory 520. The electronic device also includes a communication component 530. The processor 510, the memory 520 and the communication component 530 are connected via a bus 540.

[0152] In a specific implementation process, at least one processor 510 executes the computer execution instructions stored in the memory 520, so that at least one processor 510 executes a knowledge tree-based retrieval method as executed by the electronic device side above.

[0153] The specific implementation process of the processor 510 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0154] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0155] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk storage.

[0156] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0157] The above-mentioned functions implemented by the electronic device and the main control device introduce the scheme provided by the embodiment of the present invention. It can be understood that in order to implement the above-mentioned functions, the electronic device or the main control device includes a hardware structure and / or software module corresponding to the execution of each function. In combination with the units and algorithm steps of each example described in the embodiment disclosed in the embodiment of the present invention, the embodiment of the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present invention.

[0158] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the computer-readable storage medium is used to implement the above-mentioned knowledge tree-based retrieval method.

[0159] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0160] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in an electronic device or a main control device.

[0161] The present application also provides a computer program product, which includes a computer program. The computer program is stored in a readable storage medium. At least one processor of an electronic device can read the computer program from the readable storage medium. At least one processor executes the computer program so that the electronic device executes the solution provided by the above embodiment.

[0162] Those skilled in the art can understand that all or part of the steps of the above method embodiments can be completed by hardware related to program instructions. The above program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above method embodiments are executed; and the above storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0163] So far, the technical solution of the present application has been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments, and the above embodiments are only used to illustrate the technical solution of the present application rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A retrieval method based on a knowledge tree, characterized in that: include: Acquire user input text, and match the user input text with the description text of the root node of the knowledge tree to obtain a first matching result; When the first matching result is a successful match, matching the user input text with a description text of a first node other than the root node in the knowledge tree to obtain a second matching result; When the second matching result corresponding to the first target node in the first node is a successful match, determining the type of the first target node; When the type of the first target node is a leaf node, the knowledge text bound to the first target node is used as the search result of the user input text.

2. The method according to claim 1, characterized in that Matching the user input text with the description text of any node of the knowledge tree includes: Calculating the vector similarity between the user input text and the description text of the arbitrary node; When the vector similarity is greater than or equal to a preset threshold, determining that the match is successful; When the vector similarity is less than the preset threshold, it is determined that the matching fails.

3. The method according to claim 2, characterized in that The calculating the vector similarity between the user input text and the description text of the arbitrary node includes: Inputting the user input text into a large language model, and extracting user intended text from the user input text; Converting the user intention text into a user input vector, and acquiring a description text vector of the arbitrary node from the attribute information of the arbitrary node; The similarity between the user input vector and the description text vector is calculated as the vector similarity.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: When the type of the first target node is a non-leaf node, first prompt information corresponding to each child node branch is generated according to the description text of each child node branch of the first target node, the first prompt information is used to instruct the user to enter a first supplementary text for the child node branch, and the description text of the child node branch includes the description text of the child node of the first target node and the description text of all subordinate nodes of the child node; Determining a target leaf node from leaf nodes corresponding to the first target node according to the first supplementary text input by a user; When there is one target leaf node, the knowledge text bound to the target leaf node is used as the search result of the user input text.

5. The method according to claim 4, characterized in that The step of determining a target leaf node from leaf nodes corresponding to the first target node according to the first supplementary text input by a user includes: For each child node branch of the first target node, construct a leaf node branch according to the leaf nodes included in the child node branch, wherein the leaf node branch includes a branch from a child node of the first target node to a leaf node; For each of the leaf node branches, acquiring the association strength between the second target node and the parent node of the second target node from the attribute information of each second target node included in the leaf node branch; For each of the second target nodes, calculating a first matching degree between the first supplementary text and the description text of the second target node, and adjusting the first matching degree according to the association strength between the second target node and the parent node to obtain a second matching degree; For each leaf node branch, the sum of the second matching degrees of each second target node included in the leaf node branch is taken as the third matching degree between the leaf node branch and the first supplementary text, and the leaf node corresponding to the leaf node branch with the largest third matching degree is taken as the target leaf node.

6. The method according to claim 4, characterized in that The method further comprises: When there are multiple target leaf nodes, second prompt information for each target leaf node is generated according to the description texts of the multiple target leaf nodes, wherein the second prompt information is used to instruct the user to input a second supplementary text for the target leaf node; The knowledge text bound to the target leaf node corresponding to the second supplementary text is used as the retrieval result of the user input text.

7. The method according to any one of claims 1 to 3, characterized in that The method further comprises: When the first matching result and / or the second matching result is a matching failure, matching the user input text with a preset search text in a preset database to obtain a successfully matched target search text; The knowledge text corresponding to the target search text in the preset database is used as the search result corresponding to the user input text.

8. The method according to any one of claims 1 to 3, characterized in that The method further comprises: When the search result is a knowledge text obtained in the knowledge tree, obtaining a user's evaluation text of the search result, and generating adjustment information for the knowledge tree according to the evaluation text; The knowledge tree is adjusted according to the adjustment information.

9. A retrieval device based on a knowledge tree, characterized in that: include: A first matching module, used for acquiring a user input text, and matching the user input text with a description text of a root node of a knowledge tree to obtain a first matching result; A second matching module, configured to match the user input text with a description text of a first node other than the root node in the knowledge tree to obtain a second matching result when the first matching result is a successful match; a node determination module, configured to determine the type of the first target node when the second matching result corresponding to the first target node in the first node is a successful match; A result output module is used to use the knowledge text bound to the first target node as the search result of the user input text when the type of the first target node is a leaf node.

10. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed by a processor.

12. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 8 when being executed by a processor.