Method and system for constructing classification system from text and storage medium thereof

The candidate entity node and relationship detection are generated through a large language model, combined with the maximum spanning tree algorithm, cross-domain and long-tail knowledge problems when building a classification system from the text are solved, and efficient and accurate classification system generation is achieved.

CN119577130APending Publication Date: 2025-03-07STATE GRID INFORMATION & TELECOMM BRANCH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411299554.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

When the existing technology automatically builds classification systems from text, there are problems such as cross-domain and long-tail knowledge, resulting in insufficient efficiency and coverage of the generated classification systems.

Method used

A large language model is used to generate candidate entity nodes from the text, and any two candidate entity nodes are detected through the relationship detection module, and finally the maximum spanning tree algorithm is used to convert the detection results into a classification system.

Benefits of technology

It improves the accuracy and efficiency of classification system generation, effectively utilizes the context of text information, enhances the output reliability of large language models, and solves the problems of cross-domain and long-tail knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577130A_ABST
    Figure CN119577130A_ABST
Patent Text Reader

Abstract

The invention provides a method and a system for constructing a classification system from a text and a storage medium thereof. The method comprises the following steps: generating candidate entity nodes from the text; performing relation detection on any two candidate entity nodes; and generating a text classification system based on all relation detection results. According to the method, the classification system can be efficiently and accurately constructed from the text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of text data processing, and in particular relates to a method, system and storage medium for constructing a classification system from text. Background Art

[0002] The hierarchical relationship between entities plays a great role in the structure of the vocabulary, and it is an important basis for organizing and building knowledge. Taxonomy is a semantic hierarchy consisting of a series of concepts connected by hierarchical relationships. The valuable knowledge provided by taxonomy can support various application scenarios, including query understanding, personalized recommendation, web search, etc. With the introduction of knowledge graph, the development of semantic web has been further accelerated, which can provide users with more intelligent services, such as more accurate recommendation and search. Taxonomy provides an important foundation for the construction of knowledge graph. The early methods of relying on human experts to manually build or crowdsource the domain classification system from top to bottom are time-consuming and laborious. In recent years, various methods of automatically building classification systems have shown higher efficiency and superior performance. However, in large-scale practice, the automatic construction of classification systems from text still has inevitable problems such as cross-domain and long-tail knowledge. Therefore, it is an important issue in classification system engineering to automatically build classification systems from text and further improve their performance and scope of application.

[0003] At present, the academic community has proposed some research methods for taxonomy induction. A very famous method is the pattern-based taxonomy construction method, the key of which is to design a reasonable and effective large number of hierarchical and subordinate language patterns, but it requires domain experts to spend a lot of time and energy. Secondly, the limitations of the pattern-based construction method are very obvious. It is impossible for artificially constructed patterns to achieve a high coverage rate in massive and multi-domain texts, and it is almost ineffective for implicit hierarchical and sub-hierarchical relationships. Summary of the invention

[0004] The purpose of the present invention is to address the deficiencies of the above-mentioned background technology and to provide a method, system and storage medium for constructing a classification system from text, which can efficiently and accurately construct a classification system from text.

[0005] The technical solution adopted by the present invention is: a method for constructing a classification system from text, comprising the following steps:

[0006] Generate candidate entity nodes from text;

[0007] Perform relationship detection on any two candidate entity nodes;

[0008] Generate a text classification system based on all relationship detection results.

[0009] In the above technical solution, a large language model is used to generate candidate entity nodes from the text.

[0010] In the above technical solution, a large language model is used to perform relationship detection on any two candidate entity nodes.

[0011] In the above technical solution, the maximum spanning tree algorithm is used to convert all relationship detection results into a classification system.

[0012] In the above technical solution, the process of using a large language model to generate candidate entity nodes from text includes: allowing the large language model to generate initial candidate nodes based on the text; using the large language model to determine the matching degree between the initial candidate nodes and their corresponding text information; for each initial candidate node, allowing the large language model to generate a candidate entity node based on its corresponding text information according to its matching degree with the corresponding text information.

[0013] In the above technical solution, the matching degree includes matching, mismatching and existence of a better solution; for any initial candidate node, the process of generating a candidate entity node includes:

[0014] If the matching degree with the corresponding text information is not a match, the large language model is made to generate a new candidate node as a candidate entity node according to the corresponding text information;

[0015] If the matching degree with the corresponding text information is a match, the large language model is used to refine the corresponding text information as a candidate entity node;

[0016] If the matching degree with the corresponding text information is that there is a better solution, the large language model is used to generate a new candidate node according to the corresponding text information and compare it with the initial candidate node, and the better node is selected as the candidate entity node.

[0017] In the above technical solution, a context learning prompting technology is used to enable a large language model to generate initial candidate nodes based on the text.

[0018] In the above technical solution, the process of using a large language model to perform relationship detection on all candidate entity nodes includes: for any two candidate entity nodes, using the large language model to generate several corresponding thought chains for superior-female relationship judgment according to the set thought chain template and scoring each thought chain; selecting the induced result corresponding to the thought chain with the highest score as the relationship detection result corresponding to the two candidate entity nodes.

[0019] In the above technical solution, the thought chain template is as follows: define two candidate entity nodes as the first candidate entity node and the second candidate entity node respectively; summarize the information of the two candidate entity nodes respectively; and judge the hierarchical relationship between the two candidate entity nodes based on the information of the two candidate entity nodes.

[0020] In the above technical solution, the hierarchical relationship between the two candidate entity nodes is: the first candidate entity node is a second candidate entity node; or the second candidate entity node is a first candidate entity node; in the latter case, there is no inheritance relationship between the first candidate entity node and the second candidate entity node.

[0021] In the above technical scheme, the process of using a large language model to perform relationship detection on all candidate entity nodes also includes: for two candidate entity nodes, the large language model is used to obtain the corresponding thinking chain for judging the hierarchical relationship between the two candidate entity nodes when they are sorted differently according to the set thinking chain template, and the induced result corresponding to the thinking chain with the highest score in the thinking chain generated by the two sorting methods is selected as the relationship detection result corresponding to the two candidate entity nodes.

[0022] In the above technical solution, the process of scoring any thought chain includes: scoring each link of the thought chain; and generating a scoring result of the thought chain according to the scoring result of each link.

[0023] In the above technical solution, the process of scoring any link in the thinking chain includes: inputting the previous dialogue of the link into the large language model, requiring the large language model to judge whether the answer to the link is "reasonable", and outputting the model prediction probability of a "reasonable" answer as the score of the link.

[0024] The present invention also provides a system for constructing a classification system from text, comprising a candidate entity node generation module, a relationship detection module and a classification system generation module; wherein:

[0025] The candidate entity node generation module is used to generate candidate entity nodes from text;

[0026] The relationship detection module is used to perform relationship detection on any two candidate entity nodes;

[0027] The classification system generation module is used to generate a text classification system based on all relationship detection results.

[0028] In the above technical solution, the candidate entity node generation module is used to generate candidate entity nodes from text using a large language model.

[0029] In the above technical solution, the relationship detection module is used to use a large language model to perform relationship detection on any two candidate entity nodes.

[0030] In the above technical solution, the classification system generation module is used to convert all relationship detection results into a classification system using a maximum spanning tree algorithm.

[0031] In the above technical solution, the process in which the candidate entity node generation module uses a large language model to generate candidate entity nodes from text includes: allowing the large language model to generate initial candidate nodes based on the text; using the large language model to determine the matching degree of the initial candidate nodes and their corresponding text information; for each initial candidate node, allowing the large language model to generate a candidate entity node based on its corresponding text information according to its matching degree with the corresponding text information.

[0032] In the above technical solution, the matching degree includes matching, mismatching and existence of a better solution; for any initial candidate node, the process of generating a candidate entity node includes:

[0033] If the matching degree with the corresponding text information is not a match, the large language model is made to generate a new candidate node as a candidate entity node according to the corresponding text information;

[0034] If the matching degree with the corresponding text information is a match, the large language model is used to refine the corresponding text information as a candidate entity node;

[0035] If the matching degree with the corresponding text information is that there is a better solution, the large language model is used to generate a new candidate node according to the corresponding text information and compare it with the initial candidate node, and the better node is selected as the candidate entity node.

[0036] In the above technical solution, the candidate entity node generation module adopts the prompt technology of context learning to enable the large language model to generate initial candidate nodes according to the text.

[0037] In the above technical solution, the process in which the relationship detection module uses a large language model to perform relationship detection on all candidate entity nodes includes: for any two candidate entity nodes, using the large language model to generate a number of corresponding thought chains for judging the hierarchical relationship according to the set thought chain template and scoring each thought chain; selecting the induced result corresponding to the thought chain with the highest score as the relationship detection result corresponding to the two candidate entity nodes.

[0038] In the above technical solution, the thought chain template is as follows: define two candidate entity nodes as the first candidate entity node and the second candidate entity node respectively; summarize the information of the two candidate entity nodes respectively; and judge the hierarchical relationship between the two candidate entity nodes based on the information of the two candidate entity nodes.

[0039] In the above technical solution, the hierarchical relationship between the two candidate entity nodes is: the first candidate entity node is a second candidate entity node; or the second candidate entity node is a first candidate entity node; in the latter case, there is no inheritance relationship between the first candidate entity node and the second candidate entity node.

[0040] In the above technical scheme, the process in which the relationship detection module uses a large language model to perform relationship detection on all candidate entity nodes also includes: for two candidate entity nodes, the large language model is used respectively to obtain the corresponding thinking chain for judging the hierarchical relationship between the two candidate entity nodes when they are sorted differently according to the set thinking chain template, and the induced result corresponding to the thinking chain with the highest score in the thinking chain generated by the two sorting methods is selected as the relationship detection result corresponding to the two candidate entity nodes.

[0041] In the above technical solution, the process of scoring any thought chain includes: scoring each link of the thought chain; and generating a scoring result of the thought chain according to the scoring result of each link.

[0042] In the above technical solution, the process of scoring any link in the thinking chain includes: inputting the previous dialogue of the link into the large language model, requiring the large language model to judge whether the answer to the link is "reasonable", and outputting the model prediction probability of a "reasonable" answer as the score of the link.

[0043] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method of constructing a classification system from text as described in the above technical solution is implemented.

[0044] The present invention also provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for constructing a classification system from text as described in any one of claims 1 to 13 by executing the computer instructions.

[0045] The beneficial effect of the present invention is that in the process of constructing a classification system from text, the present invention conducts in-depth mining and utilization of text information, effectively improving the accuracy of generating the classification system.

[0046] Furthermore, the present invention fully utilizes the large language model to implement the process of detecting candidate entity nodes and node relationships, effectively improving the overall efficiency of the method flow.

[0047] Furthermore, the present invention utilizes the maximum spanning tree algorithm to convert all relationship detection results into a classification system, thereby ensuring the accuracy of generating the classification system while effectively improving the computational efficiency.

[0048] Furthermore, the present invention uses the large language model to reversely verify the initial candidate nodes generated by the large language model, reviews the corresponding text information based on the nodes, effectively utilizes the contextual information of the text, forms a double verification mechanism based on the matching degree, and deeply mines and utilizes the text information, effectively improving the accuracy of the large language model in generating candidate nodes.

[0049] Furthermore, the present invention improves the performance of generating candidate nodes of a large language model through a double verification mechanism of re-judging the matching degree of the initial candidate node and its corresponding text information.

[0050] Furthermore, the present invention adopts context learning prompt technology to enable the large language model to generate initial candidate nodes according to the text. This method effectively utilizes the context and improves the quality of initial candidate node generation.

[0051] Furthermore, the present invention generates a relationship detection result between two nodes by generating a thought chain score based on a thought chain template, and using self-assessment as the score can effectively improve the output reliability of the large language model.

[0052] Furthermore, the thought chain template proposed by the present invention enables the large language model to effectively utilize context information instead of being disturbed by redundant information. Its templated questions and regularized answers improve the reliability and effectiveness of the model output.

[0053] Furthermore, the present invention designs a variant method of the beam search method by swapping the order of two candidate nodes, which is more in line with the non-causal relationship between the information summaries of the two candidate nodes.

[0054] Furthermore, the present invention considers the model prediction probability and self-assessment score of each link in the thinking chain in the scoring process of the thinking chain, thereby improving the global optimality of the reasoning of the entire thinking chain.

[0055] Furthermore, the process of scoring any link in the thought chain of the present invention focuses on allowing the large language model to self-evaluate the answer to the link based on all historical conversations, which has the advantage of improving the reliability of the output of the large language model. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a schematic diagram of the method flow of the present invention. DETAILED DESCRIPTION

[0057] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments to facilitate a clear understanding of the present invention, but they do not constitute a limitation on the present invention.

[0058] Example 1

[0059] like Figure 1As shown, the present invention provides a method for constructing a classification system from text, characterized in that it includes the following steps:

[0060] Generate candidate entity nodes from text;

[0061] Perform relationship detection on any two candidate entity nodes;

[0062] Generate a text classification system based on all relationship detection results.

[0063] Specifically, a large language model is used to generate candidate entity nodes from text.

[0064] Specifically, a large language model is used to perform relationship detection on any two candidate entity nodes.

[0065] Specifically, the maximum spanning tree algorithm is used to transform all relationship detection results into a classification system.

[0066] Specifically, the process of using a large language model to generate candidate entity nodes from text includes: allowing the large language model to generate initial candidate nodes based on the text; using the large language model to determine the matching degree of the initial candidate nodes and their corresponding text information; for each initial candidate node, allowing the large language model to generate candidate entity nodes based on the corresponding text information according to the matching degree between the candidate node and the corresponding text information. The matching degree is used to indicate the degree to which the candidate node and its corresponding text are in line with the context, fine and accurate.

[0067] Preferably, the large language model is used to locate the text information corresponding to the initial candidate node, the text information and its corresponding initial candidate node are input into the large language model, and the large language model outputs the corresponding conclusion; the conclusion is any one of the three types of match / mismatch / existence of a better solution (true / false / better answer), and the large language model further selects candidate entity nodes based on the output conclusion, and forms a double verification mechanism by re-judging the matching degree of the initial candidate node and its corresponding text information.

[0068] Specifically, for any initial candidate node, the process of generating a candidate entity node includes:

[0069] If the matching degree with the corresponding text information is not a match, the large language model is made to generate a new candidate node as a candidate entity node according to the corresponding text information;

[0070] If the matching degree with the corresponding text information is a match, the large language model is used to refine the corresponding text information as a candidate entity node;

[0071] If the matching degree with the corresponding text information is that there is a better solution, the large language model is used to generate a new candidate node according to the corresponding text information and compare it with the initial candidate node, and the better node is selected as the candidate entity node.

[0072] Specifically, the context-learning prompting technology is used to enable the large language model to generate initial candidate nodes based on the text.

[0073] Specifically, the process of using a large language model to perform relationship detection on all candidate entity nodes includes: for any two candidate entity nodes, using the large language model to generate several corresponding thought chains for superior-female relationship judgment according to the set thought chain template and scoring each thought chain; selecting the induced result corresponding to the thought chain with the highest score as the relationship detection result corresponding to the two candidate entity nodes.

[0074] Specifically, the thought chain template is as follows: define two candidate entity nodes as a first candidate entity node and a second candidate entity node respectively; summarize the information of the two candidate entity nodes respectively; and determine the hierarchical relationship between the two candidate entity nodes according to the information of the two candidate entity nodes.

[0075] Specifically, the hierarchical relationship between the two candidate entity nodes is: the first candidate entity node is a second candidate entity node; or the second candidate entity node is a first candidate entity node; in the latter case, there is no inheritance relationship between the first candidate entity node and the second candidate entity node.

[0076] Specifically, the process of using a large language model to perform relationship detection on all candidate entity nodes also includes: for two candidate entity nodes, using the large language model to obtain the corresponding thinking chain for judging the hierarchical relationship between the two candidate entity nodes when they are sorted differently according to the set thinking chain template, and selecting the induced result corresponding to the thinking chain with the highest score in the thinking chain generated by the two sorting methods as the relationship detection result corresponding to the two candidate entity nodes.

[0077] Specifically, the process of scoring any thought chain includes: scoring each link of the thought chain; and generating a scoring result of the thought chain according to the scoring result of each link.

[0078] Specifically, the process of scoring any link in the thinking chain includes: inputting the previous dialogue of this link into the large language model, requiring the large language model to judge whether the answer to this link is "reasonable", and outputting the model prediction probability of a "reasonable" answer as the score of this link.

[0079] Preferably, using a large language model to perform relationship detection on any two candidate entity nodes specifically includes the following steps:

[0080] 1) For any two terms (candidate entity nodes) and their information (text information corresponding to the candidate entity nodes) (term1, I (term1); term2, I (term2)), form a term pair; design a prompt sentence according to the designed thought chain template, and use a variant beam search method to let the large language model generate a thought chain for judging the hyponym relationship of the term pair under this prompt. The modular thought chain template is as follows:

[0081] 1. Summarize the information of term 1. The large language model generates several answers to the question "summarize the information of the first candidate node" and selects the top k answers with the highest model prediction probability.

[0082] Second, the large language model further summarizes the information of term 2 based on the selected k answers as the historical dialogue and obtains the corresponding k answers;

[0083] 3. The large language model determines the hierarchical relationship between term1 and term2 based on the summary information in each of the k answers obtained in the second step: term1 is a term2 / term2 is a term1 / term1 and term2 do not have a hierarchical relations, and selects the k answers with the highest predicted probabilities, thus obtaining k*k thought chains.

[0084] The standard beam search method generates the top k answers with the highest model prediction probability at each step. The variant beam search method specifically swaps two terms as a replacement based on the standard beam search.

[0085] 2) Swap the order of the two terms and repeat the above steps to finally obtain 2k*k candidate thought chains;

[0086] 3) Use the self-evaluation method to score each link of each thinking chain. Specifically, input the previous dialogue of this link into the large language model, and ask it to judge whether the answer to this link is "reasonable". The model prediction probability of outputting a "reasonable" answer is used to score the credibility of this link. The scoring function is as follows:

[0087] C(r t )=P LM (A|Prompt C ,p 1:t ,r 1:t )

[0088] Among them, P LM The model predicts the probability, and the answer "reasonable" is A. Prompt C is the prompt statement for this step, p 1:tis the prompt statement from the first to the tth step, r 1:t is the model output from the first to the tth step.

[0089] 4) Score each thinking chain. The scoring function is as follows:

[0090]

[0091] Among them, λ is the balance parameter between the model prediction probability and credibility.

[0092] 5) Select the one with the highest score from the 2k*k candidate thought chains, and use the induced result as the judgment of the hierarchical relationship between the two terms.

[0093] Preferably, all relationship detection results are converted into a classification system using a maximum spanning tree algorithm, as follows:

[0094] 1) Use the maximum spanning tree algorithm to prune the classification system formed by the existing results, which is an acyclic directed graph. The algorithm outputs all the relationship pairs after pruning, and the classification system can be obtained based on all the term relationship pairs.

[0095] Example 2

[0096] The present invention provides a system for constructing a classification system from text, comprising a candidate entity node generation module, a relationship detection module and a classification system generation module; wherein:

[0097] The candidate entity node generation module is used to generate candidate entity nodes from text;

[0098] The relationship detection module is used to perform relationship detection on any two candidate entity nodes;

[0099] The classification system generation module is used to generate a text classification system based on all relationship detection results.

[0100] Specifically, the candidate entity node generation module is used to generate candidate entity nodes from text using a large language model.

[0101] Specifically, the relationship detection module is used to use a large language model to perform relationship detection on any two candidate entity nodes.

[0102] Specifically, the classification system generation module is used to convert all relationship detection results into a classification system using a maximum spanning tree algorithm.

[0103] Specifically, the process of the candidate entity node generation module using the large language model to generate candidate entity nodes from the text includes: allowing the large language model to generate initial candidate nodes based on the text; using the large language model to determine the matching degree of the initial candidate nodes and their corresponding text information; for each initial candidate node, allowing the large language model to generate a candidate entity node based on its corresponding text information according to its matching degree with the corresponding text information.

[0104] Specifically, the matching degree includes matching, mismatching, and existence of a better solution; for any initial candidate node, the process of generating a candidate entity node includes:

[0105] If the matching degree with the corresponding text information is not a match, the large language model is made to generate a new candidate node as a candidate entity node according to the corresponding text information;

[0106] If the matching degree with the corresponding text information is a match, the large language model is used to refine the corresponding text information as a candidate entity node;

[0107] If the matching degree with the corresponding text information is that there is a better solution, the large language model is used to generate a new candidate node according to the corresponding text information and compare it with the initial candidate node, and the better node is selected as the candidate entity node.

[0108] Specifically, the candidate entity node generation module adopts the prompt technology of context learning to enable the large language model to generate initial candidate nodes based on the text.

[0109] Specifically, the process in which the relationship detection module uses a large language model to perform relationship detection on all candidate entity nodes includes: for any two candidate entity nodes, using the large language model to generate several corresponding thought chains for judging the hierarchical relationship according to the set thought chain template and scoring each thought chain; selecting the induced result corresponding to the thought chain with the highest score as the relationship detection result corresponding to the two candidate entity nodes.

[0110] Specifically, the thought chain template is as follows: define two candidate entity nodes as a first candidate entity node and a second candidate entity node respectively; summarize the information of the two candidate entity nodes respectively; and determine the hierarchical relationship between the two candidate entity nodes according to the information of the two candidate entity nodes.

[0111] Specifically, the hierarchical relationship between the two candidate entity nodes is: the first candidate entity node is a second candidate entity node; or the second candidate entity node is a first candidate entity node; in the latter case, there is no inheritance relationship between the first candidate entity node and the second candidate entity node.

[0112] Specifically, the process in which the relationship detection module uses a large language model to perform relationship detection on all candidate entity nodes also includes: for two candidate entity nodes, respectively using the large language model to obtain the corresponding thinking chain for judging the hierarchical relationship between the two candidate entity nodes when they are sorted differently according to the set thinking chain template, and selecting the induced result corresponding to the thinking chain with the highest score in the thinking chain generated by the two sorting methods as the relationship detection result corresponding to the two candidate entity nodes.

[0113] Specifically, the process of scoring any thought chain includes: scoring each link of the thought chain; and generating a scoring result of the thought chain according to the scoring result of each link.

[0114] Specifically, the process of scoring any link in the thinking chain includes: inputting the previous dialogue of this link into the large language model, requiring the large language model to judge whether the answer to this link is "reasonable", and outputting the model prediction probability of a "reasonable" answer as the score of this link.

[0115] Example 3

[0116] The present invention provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for constructing a classification system from text as described in the above technical solution is implemented.

[0117] Example 4

[0118] The present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method of constructing a classification system from text as described in the above technical solution by executing the computer instructions.

[0119] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0120] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0121] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0123] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

[0124] The contents not described in detail in this specification belong to the prior art known to professional and technical personnel in this field.

Claims

1. A method for constructing a classification system from text, characterized in that: The following steps are involved: Generate candidate entity nodes from text; Perform relationship detection on any two candidate entity nodes; Generate a text classification system based on all relationship detection results.

2. The method according to claim 1, characterized in that: A large language model is used to generate candidate entity nodes from text.

3. The method according to claim 1, characterized in that: A large language model is used to detect the relationship between any two candidate entity nodes.

4. The method according to claim 1, characterized in that: The maximum spanning tree algorithm is used to transform all relationship detection results into a classification system.

5. The method according to claim 2, characterized in that: The process of generating candidate entity nodes from text using a large language model includes: allowing the large language model to generate initial candidate nodes based on the text; using the large language model to determine the matching degree between the initial candidate nodes and their corresponding text information; for each initial candidate node, allowing the large language model to generate a candidate entity node based on its corresponding text information according to its matching degree with the corresponding text information.

6. The method according to claim 5, characterized in that: The matching degree includes matching, mismatching and existence of a better solution; For any initial candidate node, the process of generating a candidate entity node includes: If the matching degree with the corresponding text information is not a match, the large language model is made to generate a new candidate node as a candidate entity node according to the corresponding text information; If the matching degree with the corresponding text information is a match, the large language model is used to refine the corresponding text information as a candidate entity node; If the matching degree with the corresponding text information is that there is a better solution, the large language model is used to generate a new candidate node according to the corresponding text information and compare it with the initial candidate node, and the better node is selected as the candidate entity node.

7. The method according to claim 5, characterized in that: Using contextual learning hint technology, the large language model generates initial candidate nodes based on the text.

8. The method according to claim 3, characterized in that: The process of using a large language model to perform relationship detection on all candidate entity nodes includes: for any two candidate entity nodes, using the large language model to generate several corresponding thought chains for superior-female relationship judgment according to the set thought chain template and scoring each thought chain; selecting the induced result corresponding to the thought chain with the highest score as the relationship detection result corresponding to the two candidate entity nodes.

9. The method according to claim 8, characterized in that: The thought chain template is as follows: two candidate entity nodes are defined as a first candidate entity node and a second candidate entity node respectively; information of the two candidate entity nodes is summarized respectively; and the superior-female relationship of the two candidate entity nodes is determined according to the information of the two candidate entity nodes.

10. The method according to claim 9, characterized in that: The hierarchical relationship between the two candidate entity nodes is: the first candidate entity node is a second candidate entity node; or the second candidate entity node is a first candidate entity node; in the latter case, there is no inheritance relationship between the first candidate entity node and the second candidate entity node.

11. The method according to claim 8, characterized in that: The process of using a large language model to perform relationship detection on all candidate entity nodes also includes: for two candidate entity nodes, using the large language model to obtain the corresponding thinking chain for judging the hierarchical relationship between the two candidate entity nodes when they are sorted differently according to the set thinking chain template, and selecting the induced result corresponding to the thinking chain with the highest score in the thinking chain generated by the two sorting methods as the relationship detection result corresponding to the two candidate entity nodes.

12. The method according to claim 8, characterized in that: The process of scoring any thought chain includes: scoring each link of the thought chain; generating the scoring result of the thought chain according to the scoring result of each link.

13. The method according to claim 12, characterized in that: The process of scoring any link in the thought chain includes: inputting the previous dialogue of this link into the large language model, requiring the large language model to judge whether the answer to this link is "reasonable", and outputting the model prediction probability of a "reasonable" answer as the score of this link.

14. A system for constructing a classification system from text, characterized in that: It includes a candidate entity node generation module, a relationship detection module and a classification system generation module; among which, The candidate entity node generation module is used to generate candidate entity nodes from text; The relationship detection module is used to perform relationship detection on any two candidate entity nodes; The classification system generation module is used to generate a text classification system based on all relationship detection results.

15. The system for constructing a classification system from text according to claim 14, characterized in that: The candidate entity node generation module is used to generate candidate entity nodes from text using a large language model.

16. The system for constructing a classification system from text according to claim 14, characterized in that: The relationship detection module is used to use a large language model to perform relationship detection on any two candidate entity nodes.

17. The system for constructing a classification system from text according to claim 14, characterized in that: The classification system generation module is used to convert all relationship detection results into a classification system using the maximum spanning tree algorithm.

18. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for constructing a classification system from text as described in any one of claims 1 to 13 is implemented.

19. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for constructing a classification system from text as described in any one of claims 1 to 13 by executing the computer instructions.