Structured text classification method, apparatus, device, and product

CN123031701APending Publication Date: 2026-11-03SHENZHEN ZHONGYUN NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611531777.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-30
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing structured text classification methods suffer from several problems when classifying objects such as database fields, metadata units, and business term fragments. These problems include excessively long decision chains, high latency caused by the need for logical entry points to carry the entire classification tree context, hierarchical error propagation, position and co-occurrence biases caused by sample order deviations, and a lack of mechanisms to inject conclusions of completed objects in the same batch into subsequent inferences. This results in inconsistent conclusions for similar objects and increased verification costs.

Method used

By topologically shrinking the classification tree structure, target layer nodes are obtained, and a legal path connection table is constructed. Structured text objects are segmented and rearranged according to a preset batch size. Candidate retrieval is performed through the target layer nodes. Based on a large language model, dynamic semantic anchors, the legal path connection table, and the local candidate path set, a text classification result is generated.

Benefits of technology

It achieves reliable and consistent text classification results with limited overhead, solves the problem of lack of effective constraints on the decision-making process in existing methods, and improves the efficiency of structured text classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123031701A_ABST
    Figure CN123031701A_ABST
Patent Text Reader

Abstract

The application discloses a structured text classification method and device, equipment and product, relates to the technical field of hierarchical classification, and the method is applied to a classification system, topological contraction is performed on a classification tree structure to obtain a target layer node and construct a legal path connection table, then the structured text objects to be classified are split and rearranged according to a preset batch size, candidate retrieval is performed on the rearrangement result through the target layer node obtained in advance, a local candidate path set is obtained, and joint reasoning is performed based on a dynamic semantic anchor point, the legal path connection table and the local candidate path set, constraints are applied from an output side, reliable and consistent text classification results are obtained with limited cost, and the problem that when an open independent classification is performed on a structured text object by using an existing method, effective constraints on a decision process are lacked, and it is difficult to obtain reliable and consistent conclusions with limited cost is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of hierarchical classification technology, and in particular to a structured text classification method, apparatus, device, and product. Background Technology

[0002] Hierarchical text classification (HTC) utilizes the parent-child hierarchical relationship between categories to map objects to target nodes in a tree or directed acyclic graph. It is widely used in knowledge organization, data governance, cataloging and other scenarios. Existing implementations mainly use a top-down approach that proceeds layer by layer from the root node, classifying each layer based on the set of child nodes of the current node, or a global approach that encodes hierarchical information into a unified model, modeling label dependencies during the training phase.

[0003] However, the above-mentioned solutions have obvious drawbacks when used for structured text objects such as database fields, metadata units, and business term fragments. First, the layer-by-layer judgment chain is too long, and the logical entry point needs to carry the entire classification tree context, resulting in high token consumption and latency. Errors in upper-layer judgments can lead to hierarchical error propagation. Second, objects often enter the pipeline according to the original table structure or import order, resulting in high homogeneity among adjacent samples, which can easily induce position and co-occurrence biases. Moreover, performing large-scale open classification directly in deep categories faces challenges such as candidate inflation, excessively long prompts, and an excessively large decision space, making convergence difficult. Finally, objects are often treated as independent prediction tasks, lacking a mechanism to inject the conclusions of completed objects in the same batch into subsequent inferences, leading to inconsistent conclusions for similar objects and increased verification costs.

[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0005] The main objective of this application is to provide a method, apparatus, device, and product for structured text classification, which aims to solve the technical problem that existing methods, when performing open and independent classification of structured text objects, lack effective constraints on the decision-making process and are difficult to obtain reliable and consistent conclusions with limited overhead.

[0006] To achieve the above objectives, this application proposes a structured text classification method, which includes: The classification tree structure is topologically shrunk to obtain the target layer nodes, and a valid path connection table is constructed based on the parent-child relationship between several nodes in the classification tree structure. The structured text objects to be classified are segmented and rearranged according to the preset batch size to obtain the segmentation results. The segmentation results are then used to perform candidate retrieval through the target layer nodes to obtain a local candidate path set. Based on the pre-acquired dynamic semantic anchors, the legal path connection table, and the local candidate path set, the structured text objects are jointly inferred through a large language model to obtain text classification results. The steps for acquiring the dynamic semantic anchors include: collecting the final structured text objects that have completed classification inference within the same batch and the final classification results corresponding to the final structured text objects; converting the final structured text objects and the final classification results into dynamic semantic anchors; and writing the dynamic semantic anchors into the anchor reference pool.

[0007] In one embodiment, the step of topologically shrinking the classification tree structure to obtain the target layer nodes includes: A depth analysis was performed on the classification tree structure to obtain the hierarchical depth of several nodes; The maximum depth of the classification tree structure is determined by the level depth, and several nodes whose level depth does not meet the standard are removed according to the maximum depth value to obtain candidate nodes; The candidate nodes are traversed by the maximum depth value to obtain the leaf class candidate layer nodes, and the parent class candidate layer nodes are extracted from the candidate nodes according to the parent node identifier of the leaf class candidate layer nodes. The target layer node is obtained by summing the candidate nodes of the leaf class and the candidate nodes of the parent class.

[0008] In one embodiment, the step of constructing a valid path connection table based on the parent-child relationships between several nodes in the classification tree structure includes: Obtain the node identifier, parent node identifier, and node semantic description of several leaf class candidate layer nodes in the target layer node, and obtain the node identifier and node semantic description of several parent class candidate layer nodes in the target layer node; The parent node identifiers of the leaf candidate layer nodes are compared with the node identifiers of the parent candidate layer nodes. Leaf candidate layer nodes whose parent node identifiers match the node identifiers of the parent candidate layer nodes are combined with the parent candidate layer nodes to form node relationship pairs, thus obtaining several node relationship pairs. By sequentially concatenating the aforementioned node relationships, several legal node paths are obtained. These legal node paths and their corresponding node semantic descriptions are then associated to obtain a legal path connection table.

[0009] In one embodiment, the step of segmenting and rearranging the structured text objects to be classified according to a preset batch size to obtain the segmentation result includes: The structured text objects to be classified are divided into windows according to the preset batch size to obtain several original batches; Assign batch identifiers and random seeds to the aforementioned original batches; The structured text objects corresponding to the original batches are rearranged using the random seed-driven pseudo-random rearrangement algorithm to obtain several rearranged batches. Record the batch identifier, object identifier, and arrangement order of the several rearranged batches to obtain the segmentation result.

[0010] In one embodiment, the step of performing candidate retrieval on the segmentation result through the target layer nodes to obtain a local candidate path set includes: Obtain the object semantic descriptions corresponding to several structured text objects in the segmentation result, and perform semantic embedding calculation on the object semantic descriptions to obtain embedding vectors; Extract several legal node paths from the legal path connection table through the target layer nodes, and perform vector representation on the node semantic descriptions corresponding to the several legal node paths to obtain path vectors; The path vector and the embedding vector are used to calculate the similarity to obtain a similarity score; The similarity scores are used to filter the legal node paths to obtain a local candidate path set.

[0011] In one embodiment, the step of performing joint reasoning on the structured text object using a large language model based on pre-acquired dynamic semantic anchors, the legal path connection table, and the local candidate path set to obtain the text classification result includes: The prompt information is obtained by summarizing the local candidate path set, the legal path connection table, and the dynamic semantic anchors. The prompt information is reasoned through the large language model to obtain candidate classification paths, and the candidate classification paths are verified through the legal path connection table. When there are nodes in the candidate classification paths that do not belong to the legal path connection table, the candidate classification paths in the local candidate path set are selected based on the similarity scores. By replacing the candidate classification path with the alternative classification path, the text classification result is obtained.

[0012] In one embodiment, after the step of selecting candidate classification paths from the local candidate path set based on the similarity score, the method further includes: When there are no alternative classification paths in the local candidate path set, the structured text object is marked as an abnormal object; Write the object identifier, embedding vector, and local candidate path set of the abnormal object into the manual review queue; Calculate the similarity between the embedding vectors of several abnormal objects in the manual review queue, and group the abnormal objects with similarity greater than a preset clustering threshold into the same set to obtain a candidate new category set; When the number of abnormal objects in the candidate new category set exceeds a preset threshold, a suggestion to add a new node is generated.

[0013] Furthermore, to achieve the above objectives, this application also proposes a structured text classification device, which is applied to a classification system including a classification tree structure, and the device includes: A construction module is used to perform topological shrinking on the classification tree structure to obtain target layer nodes, and to construct a legal path connection table based on the parent-child relationship between several nodes in the classification tree structure. The retrieval module is used to segment and rearrange the structured text objects to be classified according to a preset batch size to obtain segmentation results, and to perform candidate retrieval on the segmentation results through the target layer nodes to obtain a local candidate path set; The inference module is used to perform joint inference on the structured text object based on the pre-acquired dynamic semantic anchors, the legal path connection table, and the local candidate path set through a large language model to obtain the text classification result. The step of acquiring the dynamic semantic anchors includes: collecting the final structured text objects that have completed classification inference in the same batch and the final classification result corresponding to the final structured text objects, converting the final structured text objects and the final classification result into dynamic semantic anchors, and writing the dynamic semantic anchors into the anchor reference pool.

[0014] In addition, to achieve the above objectives, this application also proposes a structured text classification device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the structured text classification method as described above.

[0015] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and which, when executed by a processor, implements the steps of the structured text classification method described above.

[0016] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the structured text classification method as described above.

[0017] One or more technical solutions proposed in this application have at least the following technical effects: This application proposes a structured text classification method, apparatus, device, and product. The method is applied to a classification system, which includes a classification tree structure. The method obtains target layer nodes by topologically shrinking the classification tree structure and constructs a legal path connection table based on the parent-child relationships between several nodes in the classification tree structure. The method then segments and rearranges the structured text objects to be classified according to a preset batch size to obtain segmentation results. Candidate retrieval is performed on the segmentation results through the target layer nodes to obtain a local candidate path set. Based on pre-acquired dynamic semantic anchors, the legal path connection table, and the local candidate path set, joint reasoning is performed on the structured text objects using a large language model to obtain text classification results. The step of obtaining the dynamic semantic anchors includes: collecting the final structured text objects that have completed classification reasoning within the same batch and the corresponding final classification results; converting the final structured text objects and final classification results into dynamic semantic anchors; and writing the dynamic semantic anchors into an anchor reference pool. Therefore, the classification tree structure is topologically shrunk to obtain target layer nodes and a legal path connection table is constructed. Then, the structured text objects to be classified are segmented and rearranged according to a preset batch size. The rearranged results are then used to perform candidate retrieval through the previously obtained target layer nodes to obtain a local candidate path set. Finally, based on dynamic semantic anchors, the legal path connection table, and the local candidate path set, joint reasoning is performed to apply constraints from the output side. This allows for the acquisition of reliable and consistent text classification results with limited overhead. This solves the problem that existing methods lack effective constraints on the decision-making process when performing open and independent classification of structured text objects, making it difficult to obtain reliable and consistent conclusions with limited overhead. This improves the efficiency of structured text classification. Attached Figure Description

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

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating an embodiment of the structured text classification method of this application. Figure 2 This is a flowchart illustrating Embodiment 2 of the structured text classification method of this application. Figure 3 This is a schematic diagram of the module structure of the structured text classification device according to an embodiment of this application; Figure 4 This is a schematic diagram of the device structure of the hardware operating environment involved in the structured text classification method in the embodiments of this application.

[0021] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0022] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0023] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0024] The main solution of this application embodiment is as follows: perform depth analysis on the classification tree structure to obtain the level depth of several nodes; determine the maximum depth value of the classification tree structure through the level depth, remove the nodes whose level depth does not meet the standard according to the maximum depth value, and obtain candidate nodes; traverse the candidate nodes through the maximum depth value to obtain leaf class candidate layer nodes, and extract the parent class candidate layer nodes from the candidate nodes according to the parent node identifier of the leaf class candidate layer nodes; summarize the leaf class candidate layer nodes and the parent class candidate nodes to obtain the target layer nodes. Obtain the node identifiers, parent node identifiers, and semantic descriptions of several leaf-type candidate layer nodes in the target layer node, and obtain the node identifiers and semantic descriptions of several parent-type candidate layer nodes in the target layer node. Compare the parent node identifiers of the leaf-type candidate layer nodes with the node identifiers of the parent-type candidate layer nodes. Combine the leaf-type candidate layer nodes whose parent node identifiers match the node identifiers of the parent-type candidate layer nodes with the parent-type candidate layer nodes to form node relationship pairs, obtaining several node relationship pairs. Sequentially concatenate the several node relationship pairs to obtain several legal node paths, and associate the several legal node paths with the corresponding node semantic descriptions to obtain a legal path connection table. Window the structured text objects to be classified according to a preset batch size to obtain several original batches. Assign batch identifiers and random seeds to the several original batches. Rearrange the structured text objects corresponding to the several original batches using a pseudo-random rearrangement algorithm driven by the random seed to obtain several rearranged batches. Record the batch identifiers, object identifiers, and arrangement order of the several rearranged batches to obtain the segmentation result. Obtain the semantic descriptions of several structured text objects corresponding to the segmentation results, and perform semantic embedding calculations on the object semantic descriptions to obtain embedding vectors; extract several legal node paths from the legal path connection table through the target layer nodes, and represent the node semantic descriptions corresponding to the several legal node paths as vectors to obtain path vectors; calculate the similarity between the path vectors and the embedding vectors to obtain a similarity score; filter the several legal node paths using the similarity score to obtain a local candidate path set. Collect the final structured text objects that have completed classification reasoning within the same batch and the final classification results corresponding to the final structured text objects, convert the final structured text objects and the final classification results into dynamic semantic anchors, and write the dynamic semantic anchors into the anchor reference pool.The system summarizes the local candidate path set, the legal path connection table, and dynamic semantic anchors to obtain prompt information. It then uses the large language model to infer the prompt information, obtaining candidate classification paths, which are then validated using the legal path connection table. When a node in the candidate classification path does not belong to the legal path connection table, a candidate classification path is selected from the local candidate path set based on the similarity score. The candidate classification path is then replaced by the candidate classification path to obtain the text classification result. When no candidate classification path exists in the local candidate path set, the structured text object is marked as an anomalous object. The object identifier, embedding vector, and local candidate path set of the anomalous object are written into a manual review queue. The similarity between the embedding vectors of several anomalous objects in the manual review queue is calculated, and anomalous objects with a similarity greater than a preset clustering threshold are grouped into the same set to obtain a new candidate category set. When the number of anomalous objects in the new candidate category set exceeds a preset number threshold, a new node suggestion is generated. This invention addresses the problem that existing methods for open-ended independent classification of structured text objects lack effective constraints on the decision-making process, making it difficult to obtain reliable and consistent conclusions with limited overhead. It achieves structured text classification and improves classification efficiency. Based on this invention, addressing the issue that current text classification methods often treat objects as independent prediction tasks, lacking a mechanism to inject conclusions from completed objects into subsequent inferences, leading to inconsistent conclusions for similar objects, increased verification costs, and low efficiency, this invention designs a structured text classification method. The effectiveness of this method is verified during the classification of structured text, and the efficiency of structured text classification using this invention is significantly improved.

[0025] In this embodiment, for ease of description, the structured text classification device will be used as the execution subject in the following description.

[0026] Due to limitations in existing hierarchical classification methods and large language model inference, the efficiency of structured text classification needs improvement. One issue is the excessively long decision chain. Current implementations often classify from the root node down layer by layer, with each layer carrying the entire classification tree context. This not only results in high token consumption and response latency but also causes hierarchical error propagation due to upper-level errors, leading to a decrease in the efficiency of structured text classification. Another issue is sample order bias. Structured text objects to be classified often enter the pipeline according to their original table structure or import order. The high homogeneity of adjacent samples easily induces position and co-occurrence biases. The efficiency of structured text classification will also decrease significantly. Furthermore, there is the issue of candidate inflation. Directly performing large-scale open classification in deep categories faces challenges such as candidate inflation, excessively long prompts, and an excessively large decision space that makes convergence difficult. This also affects the efficiency of structured text classification. Therefore, in current batch classification scenarios, especially in the processing of database fields, metadata units, and business term fragments, consistency within a batch is also a challenge. Since each object is often treated as an independent prediction task, there is a lack of a mechanism to inject the conclusions of completed objects in the same batch into subsequent inferences, resulting in inconsistent conclusions for similar objects, increased verification costs, and decreased efficiency.

[0027] This application provides a solution that topologically shrinks the classification tree structure to obtain target layer nodes and constructs a legal path connection table. Then, the structured text objects to be classified are segmented and rearranged according to a preset batch size. Candidate retrieval is performed on the rearranged results using the previously obtained target layer nodes to obtain a local candidate path set. Then, based on dynamic semantic anchors, the legal path connection table, and the local candidate path set, joint reasoning is performed to apply constraints from the output side. This achieves reliable and consistent text classification results with limited overhead, solving the problem that existing methods lack effective constraints on the decision-making process when performing open independent classification of structured text objects, making it difficult to obtain reliable and consistent conclusions with limited overhead. This improves the efficiency of structured text classification.

[0028] Based on this, embodiments of this application provide a structured text classification method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the structured text classification method of this application.

[0029] In this embodiment, the structured text classification method is applied to a classification system, the classification system including a classification tree structure, and the method includes steps S01~S03: Step S01: Perform topological shrinkage on the classification tree structure to obtain the target layer nodes, and construct a legal path connection table based on the parent-child relationship between several nodes in the classification tree structure; Before describing the solution in this embodiment, it should be clear that in the existing technology for structured text classification, the layer-by-layer judgment link is too long. The logical entry point needs to carry the context of the entire classification tree, resulting in high token consumption and latency. Errors in the upper layer cause hierarchical error propagation. Secondly, objects often enter the pipeline according to the original table structure or import order, and the high homogeneity of adjacent samples can easily induce position and co-occurrence biases. Moreover, directly performing large-scale open classification in deep categories faces candidate expansion, excessively long prompt words, and an excessively large decision space, making convergence difficult. Finally, objects are often treated as independent prediction tasks, and there is a lack of a mechanism to inject the conclusions of completed objects in the same batch into subsequent inferences, resulting in inconsistent conclusions for similar objects and increased verification costs.

[0030] Therefore, in order to solve the above problems, this embodiment automatically traverses all nodes of the entire classification tree after completing the legality verification and level initialization of the classification tree structure of the classification system, accurately counts the level depth parameters of each node, locates the maximum depth position of the classification tree, and thereby filters out the set of target level nodes that are closest to the end discrimination level.

[0031] Based on the natural parent-child topological relationships of the classification tree, the affiliation relationships of nodes at each target level are sorted out, and all legal parent-child matching relationships of nodes are systematically organized. Finally, a standardized legal path connection table that can be used for subsequent reasoning and verification is generated. The traditional root-to-leaf full-link step-by-step judgment mode is abandoned throughout the process, and the problem of hierarchical error propagation is avoided from the architectural level.

[0032] Step S02: The structured text objects to be classified are segmented and rearranged according to the preset batch size to obtain the segmentation results, and the segmentation results are retrieved by the target layer nodes to obtain a local candidate path set; Meanwhile, the classification system receives a massive amount of structured text objects to be classified in real time, including various semantic objects such as database fields, metadata units, business terms, and text summaries. It completes batch encapsulation according to the preset batch window size and the longest waiting timeout threshold, and at the same time, it completes the sample rearrangement within the batch through a pseudo-random algorithm driven by a random seed, breaking up the inherent continuous order of the original business data.

[0033] Based on the preprocessed discrete sample batch data, combined with the aforementioned locked classification tree target layer nodes, semantic candidate retrieval is carried out for all objects to be classified. Candidate path screening is completed based on semantic similarity, and invalid and low-relevance category paths are eliminated. Finally, a concise and highly matched local candidate path set is obtained, which completely solves the technical pain points of original sample position bias and category candidate expansion.

[0034] Step S03: Based on the pre-acquired dynamic semantic anchors, the legal path connection table, and the local candidate path set, joint reasoning is performed on the structured text object through a large language model to obtain the text classification result. The step of acquiring the dynamic semantic anchors includes: collecting the final structured text objects that have completed classification reasoning in the same batch and the final classification result corresponding to the final structured text objects, converting the final structured text objects and the final classification result into dynamic semantic anchors, and writing the dynamic semantic anchors into the anchor reference pool.

[0035] During the successive reasoning process of batch samples, the final structured text objects that have completed classification reasoning within the same batch and the final classification results corresponding to the final structured text objects are collected. The final structured text objects and the final classification results are transformed into dynamic semantic anchors and written into the anchor reference pool to continuously update the anchor reference pool. The structured text objects that have completed classification reasoning and whose classification results are verified by the legal path connection table are recorded as the final structured text objects, and the classification results corresponding to the final structured text objects are recorded as the final classification results.

[0036] By integrating real-time generated dynamic semantic anchors, pre-built legal path connection tables, and filtered local candidate path sets, multi-constraint fusion prompt word content is constructed and input into a large language model to complete joint semantic reasoning.

[0037] During the inference process, the model simultaneously undergoes dual calibration of topological hard constraints and semantic soft constraints. While preserving the model's semantic correction capabilities, it achieves consistent convergence of classification results for similar text objects within a batch, and outputs the final compliant structured text classification results.

[0038] Specifically, step S01 above, which involves topologically shrinking the classification tree structure to obtain the target layer nodes, includes: Step S011: Perform depth analysis on the classification tree structure to obtain the hierarchical depth of several nodes; Step S012: Determine the maximum depth value of the classification tree structure through the level depth, and remove several nodes whose level depth does not meet the standard according to the maximum depth value to obtain candidate nodes; Step S013: Traverse the candidate nodes through the maximum depth value to obtain the leaf class candidate layer nodes, and extract the parent class candidate layer nodes from the candidate nodes according to the parent node identifier of the leaf class candidate layer nodes. Step S014: Summarize the leaf-type candidate layer nodes and the parent-type candidate layer nodes to obtain the target layer node.

[0039] After completing the legality verification of the classification tree structure and eliminating abnormal structures such as loop nodes, isolated nodes, and illegal skip-level parent-child relationships, the full tree node level depth parsing is initiated. Then, all nodes of the classification tree are traversed layer by layer, and the level depth value corresponding to each node is marked one by one. The depth parameters of the root node, intermediate level nodes, and terminal level nodes are accurately recorded. The maximum depth value of the entire classification tree is determined by numerical comparison.

[0040] Using the maximum depth value as the screening criterion, all intermediate redundant nodes whose layer depth does not reach the preset end discrimination standard are filtered out, and only valid candidate nodes near the end of the classification tree are retained, thus completing the initial screening of core discrimination nodes.

[0041] Based on the determined maximum depth parameter, a second traversal is performed on the filtered candidate nodes to accurately locate all nodes at the maximum depth. These nodes are defined as leaf class candidate layer nodes. At the same time, the unique parent node identifier corresponding to each leaf class candidate layer node is extracted. Based on the parent node identifier, the corresponding upper-level nodes are selected and the results are summarized to obtain all parent class candidate layer nodes.

[0042] Finally, all leaf class candidate layer nodes and parent class candidate layer nodes are integrated and summarized to form the target layer node used for model inference. This completes the core operation of class tree topology shrinkage, which simplifies the originally lengthy whole tree inference chain into focused inference at the last two core layers, greatly compressing the inference context and token consumption, and blocking the downward cascading of upper-layer errors from the source.

[0043] Although the core classification reasoning is only carried out within the target layer nodes, the system can rely on the pre-stored full tree parent-child topological mapping relationship to backtrack layer by layer from the target layer nodes upwards, restore and generate the complete hierarchical path from the root node to the leaf node, and output the full path classification result that conforms to the hierarchical classification specification, ensuring the integrity of the output format of the external interface.

[0044] More specifically, step S01 above, the step of constructing a valid path connection table based on the parent-child relationships between several nodes in the classification tree structure, includes: Step S015: Obtain the node identifier, parent node identifier, and node semantic description of several leaf class candidate layer nodes in the target layer nodes, and obtain the node identifier and node semantic description of several parent class candidate layer nodes in the target layer nodes. Step S016: Compare the parent node identifiers of the plurality of leaf candidate layer nodes with the node identifiers of the plurality of parent candidate layer nodes, and combine the leaf candidate layer nodes whose parent node identifiers match the node identifiers of the parent candidate layer nodes and the parent candidate layer nodes into node relationship pairs to obtain a plurality of node relationship pairs. Step S017: Sequentially concatenate the several node relationships to obtain several legal node paths, and associate the several legal node paths with the node semantic descriptions corresponding to the several legal node paths to obtain a legal path connection table.

[0045] After completing the selection of target layer nodes in the classification tree, a standardized construction process for the legal path connection table is initiated to ensure that all paths conform to the inherent hierarchical rules of the classification tree.

[0046] First, the core attribute information of all leaf-type candidate layer nodes in the target layer is extracted in batches, including the unique identifier of each node, the corresponding parent node identifier, and the node-specific semantic description text. At the same time, the node identifier and semantic description content of all parent-type candidate layer nodes are extracted simultaneously, thus collecting the topological and semantic basic data of the target layer nodes in a complete manner.

[0047] The parent node identifier of all leaf candidate layer nodes is precisely compared with the node identifier of the parent candidate layer nodes one by one. Node combinations with completely matching identifiers are selected. Each successfully matched parent node and leaf node constitutes a valid hierarchical node relationship pair. All compliant node relationship pairs are generated in batches.

[0048] Following the top-down hierarchical logic of the classification tree, all node relationships are sequentially spliced ​​together to form multiple complete and compliant parent-child hierarchical node paths. At the same time, each legal node path is associated and bound with the corresponding node semantic description information.

[0049] Finally, a fully covered and verifiable legal path connection table is generated. In this embodiment, the connection table serves as the core hard constraint standard for subsequent LLM inference output, which limits the model output path to exist only within the preset legal range throughout the entire process, completely avoiding the generation of illegal category paths and model illusion problems.

[0050] When the business side updates the classification tree structure, causing changes in the target layer nodes and the legal parent-child relationships, the system automatically triggers the version switching process, recalculates the target layer node set and the legal path connection table, and synchronously updates the corresponding vector index. The old version of the classification tree topology data, connection table and index are retained as read-only snapshots for subsequent auditing and problem playback.

[0051] If the new version of the classification tree detects topological anomalies such as illegal parent-child relationships across layers, missing parent nodes for leaf nodes, or conflicting node depth definitions during the verification process, the system will refuse to enable the new version and output a configuration alarm to notify administrators to correct the topology structure.

[0052] Further, step S02 above, which involves segmenting and rearranging the structured text objects to be classified according to a preset batch size to obtain the segmentation result, includes: Step S021: The structured text objects to be classified are divided into windows according to the preset batch size to obtain several original batches; Step S022: Assign batch identifiers and random seeds to the plurality of original batches; Step S023: The structured text objects corresponding to the original batches are rearranged using the random seed-driven pseudo-random rearrangement algorithm to obtain several rearranged batches. Step S024: Record the batch identifier, object identifier, and arrangement order of the several rearranged batches to obtain the segmentation result.

[0053] After the structured text objects to be classified are accessed into the system, a pre-processing exception check is first performed. If the object is found to lack necessary semantic description text, have an abnormal encoding format, or have a semantic content length exceeding a preset threshold, the exception state is directly marked and sent to the exception branch, and it will not enter the subsequent embedding calculation and large language model inference process. Objects that pass the check are written to the batch processing buffer. After the exception filtering is completed, they enter the standardized batch arrangement and rearrangement process.

[0054] The system uses a preset fixed batch window size to process the massive influx of structured text objects to be classified through sliding window processing, splitting them into several independent batches of original samples. Each batch contains a fixed number of objects to be classified, while retaining the original semantic information and unique identifier of the objects.

[0055] Each split original batch is assigned a unique batch identifier and a random seed. The batch identifier is used to trace the entire batch processing flow, and the random seed serves as the sole benchmark parameter for sample rearrangement, ensuring that the rearrangement process is reproducible and auditable.

[0056] The system's built-in pseudo-random rearrangement algorithm is invoked, driven by the exclusive random seed of the corresponding batch, to globally shuffle and rearrange the order of all structured text objects in the original batch. Only the sample processing sequence is changed, without modifying or adding to any sample's original semantic content or data structure, effectively breaking up the original continuous homogeneous distribution of business data.

[0057] After the rearrangement operation is completed, the system automatically records the batch identifier of each rearrangement batch, the unique identifier of all objects, and the final sample arrangement order, and archives them into the batch audit log to form a complete batch segmentation result.

[0058] If only a single object to be classified is detected within a batch, the system automatically skips the reordering process and marks it as SINGLETON_BATCH to avoid invalid calculations. If duplicate objects to be classified are identified within the batch, deduplication is performed based on the latest timestamp or business priority strategy. Throughout the entire processing lifecycle, the batch sequentially transitions through four states: OPEN, SEALED, SHUFFLED, and DISPATCHED, with each state transition being synchronously written to the batch audit log.

[0059] When the random source in the actual operating environment does not support the reordering through seed, the system directly persists the reordered object identifier sequence as the audit basis for the batch processing order, supporting the playback and review of subsequent batch processing flows.

[0060] The above processing completely eliminates the sample position bias and local co-occurrence bias problems in traditional batch processing, providing a discretized and highly representative sample basis for the accurate generation of subsequent dynamic semantic anchors.

[0061] Furthermore, step S02 above, which involves performing candidate retrieval on the segmentation result through the target layer nodes to obtain a local candidate path set, includes: Step S025: Obtain the object semantic descriptions corresponding to several structured text objects in the segmentation result, and perform semantic embedding calculation on the object semantic descriptions to obtain embedding vectors; Step S026: Extract several legal node paths from the legal path connection table through the target layer node, and perform vector representation on the node semantic descriptions corresponding to the several legal node paths to obtain path vectors; Step S027: Calculate the similarity between the path vector and the embedding vector to obtain a similarity score; Step S028: Filter the several legal node paths using the similarity scores to obtain a local candidate path set.

[0062] Extract the complete semantic description of all structured text objects to be classified from the segmentation results, including field names, annotation text, business summaries, semantic tags and other multi-dimensional information. After unified standardization processing, input it into the pre-trained embedding encoder to complete the global semantic embedding calculation and generate a fixed-dimensional object embedding vector corresponding to each structured text object, which accurately represents the core semantic features of the sample.

[0063] The previously constructed legal path connection table is retrieved, and the semantic description text of the nodes corresponding to all legal node paths in the table is extracted. An embedding algorithm consistent with object encoding is used to perform vector transformation on all path semantic information to generate a path vector corresponding to each legal path, thereby achieving the same-dimensional quantitative representation of sample semantics and category path semantics.

[0064] The cosine similarity algorithm is used to calculate the similarity score between the embedding vector of a single object and all path vectors, thereby quantifying the semantic matching degree between the object to be classified and the path of each category level. The higher the score, the higher the semantic fit.

[0065] Based on the preset configurable Top-K parameters, all legal paths are sorted from high to low according to their similarity scores. The top K highly relevant paths are selected, and redundant category paths with low matching or no relevance are removed. Finally, a local candidate path set is formed. The Top-K parameters are fixed parameters that can be configured manually. During a single task or while the current configuration is in effect, the system uniformly performs candidate path extraction according to the set K value and does not automatically adjust the K value based on the similarity score of individual objects.

[0066] Implementers can manually adjust the K value by considering the total number of candidate paths in the last two layers of the classification tree, the distribution density of leaf nodes in each parent class, the semantic similarity between categories, the Top-K candidate recall rate of validation samples, the upper limit of the context length of the large language model, the consumption of PromptToken, the inference latency requirements, and the constraints of computing resources.

[0067] When the number of categories at the end of the classification tree is large and there are many synonymous categories, and the validation results show that the correct classification path does not enter the Top-K candidate set in the expected proportion, the K value can be appropriately increased to improve the recall rate of the correct path. When the current K value has met the preset candidate recall requirements, but the candidate path occupies too much Prompt length, the token consumption is too high, the model decision space is too wide, or the inference latency exceeds the deployment requirements, the K value can be appropriately reduced to achieve the optimal balance between classification accuracy and inference performance.

[0068] Before deployment, implementers can use validation samples with known correct classification paths to test multiple sets of candidate K values, count the proportion of correct paths entering the candidate set under different K values, and record the corresponding average number of Prompt Tokens, inference latency, and final classification accuracy. The optimal K value is selected from the candidate values ​​that meet the preset candidate recall requirements, token budget, and inference latency requirements, and written into the task configuration, system configuration, or classification tree version configuration. Subsequently, when the classification tree structure, embedded model, business data distribution, or inference resources change, the K value configuration can be retested and updated.

[0069] In addition, this embodiment can also combine keyword matching, node alias matching, and lightweight ranking model scores to complete multi-feature fusion ranking, further adapting to the candidate screening needs of complex industry terms and abbreviation scenarios.

[0070] This embodiment, through the above scheme, specifically obtains target layer nodes by topologically shrinking the classification tree structure, and constructs a legal path connection table based on the parent-child relationships between several nodes in the classification tree structure; it segments and rearranges the structured text objects to be classified according to a preset batch size to obtain segmentation results, and performs candidate retrieval on the segmentation results through the target layer nodes to obtain a local candidate path set; based on the pre-acquired dynamic semantic anchors, the legal path connection table, and the local candidate path set, it performs joint reasoning on the structured text objects through a large language model to obtain text classification results. The step of obtaining the dynamic semantic anchors includes: collecting the final structured text objects that have completed classification reasoning within the same batch and the final classification results corresponding to the final structured text objects, converting the final structured text objects and the final classification results into dynamic semantic anchors, and writing the dynamic semantic anchors into an anchor reference pool. Therefore, the classification tree structure is topologically shrunk to obtain target layer nodes and a legal path connection table is constructed. Then, the structured text objects to be classified are segmented and rearranged according to a preset batch size. The rearranged results are then used to perform candidate retrieval through the previously obtained target layer nodes to obtain a local candidate path set. Finally, based on dynamic semantic anchors, the legal path connection table, and the local candidate path set, joint reasoning is performed to apply constraints from the output side. This allows for the acquisition of reliable and consistent text classification results with limited overhead. This solves the problem that existing methods lack effective constraints on the decision-making process when performing open and independent classification of structured text objects, making it difficult to obtain reliable and consistent conclusions with limited overhead. This improves the efficiency of structured text classification.

[0071] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 In step S03, the structured text classification method further includes steps S031-S034: Based on the pre-acquired dynamic semantic anchors, the legal path connection table, and the local candidate path set, joint reasoning is performed on the structured text object using a large language model to obtain the text classification result. Step S031: Summarize the local candidate path set, the legal path connection table, and the dynamic semantic anchors to obtain the prompt information; Step S032: Reason about the prompt information using the large language model to obtain candidate classification paths, and verify the candidate classification paths using the legal path connection table; Step S033: When there are nodes in the candidate classification paths that do not belong to the legal path connection table, select the candidate classification paths in the local candidate path set based on the similarity score. Step S034: Replace the candidate classification path with the alternative classification path to obtain the text classification result.

[0072] The generated local candidate path set, topological constraint legal path connection table, and dynamic semantic anchor information updated in real time during batch inference are summarized and integrated to construct complete model inference prompt information according to the preset prompt word format specifications.

[0073] Dynamic semantic anchors only select completed samples marked with high confidence from the batch reference pool. If the reference pool is empty, no sample similarity reaches the threshold, or historical results are marked with low confidence, anchor reference content will not be added to the prompt message. If there is a conflict between the dynamic anchor reference fact and the local candidate path set, the prompt message will retain both the candidate path set and the reference fact, and let the large language model weigh and determine it itself.

[0074] The prompts clearly indicate the legal path constraint rules, semantic anchor reference priority, and model output specifications. They also limit the model to prioritize the classification conclusions of similar samples in the same batch, and allow the output of differentiated results when there is sufficient semantic evidence. At the same time, the model is required to output a brief explanation field to explain the reason for the difference when the output result is different from the reference anchor. This ensures the consistency of classification within the batch, avoids the mechanical propagation of local erroneous samples, and preserves the model's semantic correction capability.

[0075] The integrated prompt information is input into the large language model, multi-constraint joint reasoning is initiated, and corresponding candidate classification path results are generated. After the model outputs the results, the system immediately retrieves the legal path connection table to perform topological legality verification, checking one by one whether the node combination and parent-child hierarchy relationship of the candidate classification path completely match the preset topological rules, and determining whether the output path is a legal and valid path.

[0076] If the verification finds that the candidate classification path contains illegal nodes, disordered hierarchical relationships, or is not within the local candidate path set, it is determined that there is a drift error in the current inference result. The system can execute a secondary correction process, that is, append the error reason and constraint rules of this output to the end of the prompt message and re-initiate a large language model inference request. Alternatively, it can directly perform a restricted search within the local candidate path set, retrieve the remaining high similarity candidate classification paths, and complete the path replacement according to the similarity score priority.

[0077] After retrying to correct or replacing abnormal candidate paths with alternative paths, a legality check is performed again to finally generate a standardized text classification result that fully conforms to hierarchical topological constraints and has the highest semantic matching degree.

[0078] If multiple retries continue to output illegal results or seriously conflict with the reference facts, the object will be sent to the manual review queue, and the abnormal cases will be recorded in the optimization sample library for subsequent model and strategy iterations. This will achieve a deep integration of generative model reasoning and structured topological constraints, balancing classification flexibility and result compliance.

[0079] Specifically, after step S033 above, which involves selecting candidate classification paths from the local candidate path set based on the similarity score, the method further includes: Step S0331: When there are no alternative classification paths in the local candidate path set, the structured text object is marked as an abnormal object; Step S0332: Write the object identifier, embedding vector, and local candidate path set of the abnormal object into the manual review queue; Step S0333: Calculate the similarity between the embedding vectors of several abnormal objects in the manual review queue, and group the abnormal objects with similarity greater than the preset clustering threshold into the same set to obtain a candidate new category set; Step S0334: When the number of abnormal objects in the candidate new category set is greater than a preset number threshold, a suggestion to add a new node is generated.

[0080] After completing the alternative classification path screening process, the system initiates the abnormal sample identification, review and category iteration update process to adapt to the unknown category identification needs in complex business scenarios.

[0081] After completing the screening of alternative paths, the resource status of the local candidate path set is immediately determined. If there are no available alternative classification paths in the candidate path set, and all paths cannot match the semantic features of the current object to be classified, the structured text object is determined to be an abnormal classification object, and the abnormal status and abnormal reason are marked simultaneously.

[0082] The unique identifiers, original embedding vectors, all candidate path retrieval records, and batch processing information of all marked abnormal objects are fully entered into the manual review queue to establish a dedicated file for abnormal samples, which facilitates subsequent manual verification, source tracing and review, and model optimization and iteration.

[0083] Continuously monitor abnormal sample data in the manual review queue, extract the embedding vectors of all abnormal objects in batches, calculate the semantic similarity between each abnormal sample through the vector similarity algorithm, and aggregate and classify abnormal samples with similarity values ​​higher than the preset clustering threshold to form multiple candidate new category sets with highly unified semantics, and accurately collect unknown semantic samples of the same type.

[0084] The system counts the number of abnormal samples in each candidate new category set in real time. When the number of samples in a certain set exceeds the preset threshold, it proves that the unknown semantic samples of this type have large-scale business characteristics and are not accidental inference errors. The system automatically generates suggestions for creating new category nodes and outputs core information such as the semantic features of the new category, the basis for sample clustering, and the adaptation level position. This enables dynamic adaptive iterative optimization of the classification tree system and continuously improves the adaptability and coverage of the hierarchical classification system for unknown and long-tail business texts.

[0085] It should be added that the solution in this embodiment includes a variety of flexible and adaptable methods to fully cover the implementation needs of different business scenarios.

[0086] First, the target level of the classification tree topology shrinkage can be adaptively adjusted, not limited to the fixed last two layers. The system can detect the overall width and depth of the classification tree and the distribution density of leaf nodes under each parent node in real time. When it is detected that there are too many leaf categories under some parent categories and the semantic distinction is difficult, the third to last layer is automatically introduced as an auxiliary constraint level. The classification accuracy under the super-large category system is improved through multi-level joint constraints.

[0087] Secondly, the reference scope of dynamic semantic anchors can be expanded. In addition to the sample results that have been inferred within the current batch, a historical high-confidence classification result library can be built to incorporate high-confidence classification results from cross-batch and historical tasks into the anchor reference system, thereby realizing the global reuse of historical experience and significantly improving the consistency and stability of long-term business data classification.

[0088] Third, the candidate path pruning mode can be flexibly upgraded. On the basis of basic embedding vector cosine similarity screening, it can be superimposed with multi-dimensional features such as precise matching of industry keywords, fuzzy hit of category aliases, and scoring of lightweight ranking models to form an intelligent ranking and screening mechanism with multi-feature fusion. This effectively adapts to complex business classification scenarios with a large number of professional terms, abbreviations, and custom fields, and further balances the recall and accuracy of candidate paths.

[0089] Meanwhile, this embodiment completely abandons the traditional top-down full-link inference mode through a hierarchical topology shrinkage mechanism, effectively reducing the token consumption and business response latency of LLM inference, cutting off the hierarchical error propagation problem from the physical link, breaking the position and co-occurrence bias of the original business data through sample diversity shuffle preprocessing, constructing a globally representative sample inference environment, compressing the semantic decision space through embedded vector Top-K dynamic pruning, completely solving the model illusion and decision drift problems caused by deep category expansion, and upgrading single-sample isolated inference to batch consensus-based inference through a soft-constraint dynamic semantic anchor backfilling mechanism. While retaining the model's semantic correction capability, it significantly improves the classification consistency of similar structured text objects, reduces the cost of manual review, and achieves dynamic optimization and upgrading of the classification system by relying on the abnormal sample clustering iteration mechanism, comprehensively improving the stability, accuracy and adaptability of hierarchical text classification in large-scale business scenarios.

[0090] This embodiment, through the above scheme, specifically obtains prompt information by summarizing the local candidate path set, the legal path connection table, and dynamic semantic anchors; it then uses the large language model to infer the prompt information to obtain candidate classification paths, and verifies these candidate classification paths using the legal path connection table; when there are nodes in the candidate classification paths that do not belong to the legal path connection table, it selects alternative classification paths from the local candidate path set based on the similarity score; finally, it replaces the candidate classification paths with the alternative classification paths to obtain the text classification result. Therefore, the classification tree structure is topologically shrunk to obtain target layer nodes and a legal path connection table is constructed. Then, the structured text objects to be classified are segmented and rearranged according to a preset batch size. The rearranged results are then used to perform candidate retrieval through the previously obtained target layer nodes to obtain a local candidate path set. Finally, based on dynamic semantic anchors, the legal path connection table, and the local candidate path set, joint reasoning is performed to apply constraints from the output side. This allows for the acquisition of reliable and consistent text classification results with limited overhead. This solves the problem that existing methods lack effective constraints on the decision-making process when performing open and independent classification of structured text objects, making it difficult to obtain reliable and consistent conclusions with limited overhead. This improves the efficiency of structured text classification.

[0091] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the structured text classification method of this application. Any simple transformations based on this technical concept are within the protection scope of this application.

[0092] This application also provides a structured text classification device; please refer to [reference needed]. Figure 3 The structured text classification device is applied to a classification system, the classification system including a classification tree structure, and the device includes: The construction module 10 is used to perform topological shrinking on the classification tree structure to obtain the target layer nodes, and to construct a legal path connection table based on the parent-child relationship between several nodes in the classification tree structure. The retrieval module 20 is used to segment and rearrange the structured text objects to be classified according to a preset batch size to obtain segmentation results, and to perform candidate retrieval on the segmentation results through the target layer nodes to obtain a local candidate path set; The reasoning module 30 is used to perform joint reasoning on the structured text object based on the pre-acquired dynamic semantic anchors, the legal path connection table, and the local candidate path set through a large language model to obtain the text classification result. The step of acquiring the dynamic semantic anchors includes: collecting the final structured text objects that have completed classification reasoning in the same batch and the final classification result corresponding to the final structured text objects, converting the final structured text objects and the final classification result into dynamic semantic anchors, and writing the dynamic semantic anchors into the anchor reference pool.

[0093] The structured text classification device provided in this application, employing the structured text classification method described in the above embodiments, can solve the technical problem that existing methods, when performing open and independent classification of structured text objects, lack effective constraints on the decision-making process and struggle to obtain reliable and consistent conclusions with limited overhead. Compared with the prior art, the beneficial effects of the structured text classification device provided in this application are the same as those of the structured text classification method provided in the above embodiments, and other technical features in the structured text classification device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0094] This application provides a structured text classification device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the structured text classification method in Embodiment 1 above.

[0095] The following is for reference. Figure 4 The diagram illustrates a structure suitable for implementing the structured text classification device of the embodiments of this application. The structured text classification device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants, tablets, portable multimedia players, and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 4 The structured text classification device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0096] like Figure 4 As shown, the structured text classification device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the structured text classification device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. The communication device 1009 allows the structured text classification device to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows structured text classification devices with various systems, it should be understood that it is not required to implement or possess all of the systems shown. More or fewer systems may be implemented alternatively.

[0097] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0098] The structured text classification device provided in this application, employing the structured text classification method described in the above embodiments, solves the technical problem that existing methods, when performing open and independent classification of structured text objects, lack effective constraints on the decision-making process, making it difficult to obtain reliable and consistent conclusions with limited overhead. Compared with the prior art, the beneficial effects of the structured text classification device provided in this application are the same as those of the structured text classification method provided in the above embodiments, and other technical features of this structured text classification device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0099] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0100] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0101] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the structured text classification method described in the above embodiments.

[0102] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0103] The aforementioned computer-readable storage medium may be included in the structured text classification device; or it may exist independently and not be assembled into the structured text classification device.

[0104] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by a structured text classification device, the structured text classification device performs the following actions: topological shrinking of the classification tree structure to obtain target layer nodes, and constructing a legal path connection table based on the parent-child relationships between several nodes in the classification tree structure; segmenting and rearranging the structured text objects to be classified according to a preset batch size to obtain segmentation results, and performing candidate retrieval on the segmentation results through the target layer nodes to obtain a local candidate path set; and performing joint reasoning on the structured text objects using a large language model based on pre-acquired dynamic semantic anchors, the legal path connection table, and the local candidate path set to obtain text classification results. The step of acquiring the dynamic semantic anchors includes: collecting the final structured text objects that have completed classification reasoning within the same batch and the final classification results corresponding to the final structured text objects, converting the final structured text objects and the final classification results into dynamic semantic anchors, and writing the dynamic semantic anchors into an anchor reference pool.

[0105] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0106] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0107] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0108] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described structured text classification method. This addresses the technical problem that existing methods, when performing open and independent classification of structured text objects, lack effective constraints on the decision-making process, making it difficult to obtain reliable and consistent conclusions with limited overhead. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the structured text classification method provided in the above embodiments, and will not be elaborated upon here.

[0109] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the structured text classification method described above.

[0110] The computer program product provided in this application solves the technical problem that existing methods, when performing open and independent classification of structured text objects, lack effective constraints on the decision-making process, making it difficult to obtain reliable and consistent conclusions with limited overhead. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the structured text classification method provided in the above embodiments, and will not be repeated here.

[0111] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A structured text classification method, characterized in that, The structured text classification method is applied to a classification system, the classification system including a classification tree structure, and the method includes: The classification tree structure is topologically shrunk to obtain the target layer nodes, and a valid path connection table is constructed based on the parent-child relationship between several nodes in the classification tree structure. The structured text objects to be classified are segmented and rearranged according to the preset batch size to obtain the segmentation results. The segmentation results are then used to perform candidate retrieval through the target layer nodes to obtain a local candidate path set. Based on the pre-acquired dynamic semantic anchors, the legal path connection table, and the local candidate path set, the structured text objects are jointly inferred through a large language model to obtain text classification results. The steps for acquiring the dynamic semantic anchors include: collecting the final structured text objects that have completed classification inference within the same batch and the final classification results corresponding to the final structured text objects; converting the final structured text objects and the final classification results into dynamic semantic anchors; and writing the dynamic semantic anchors into the anchor reference pool.

2. The structured text classification method as described in claim 1, characterized in that, The step of topologically shrinking the classification tree structure to obtain the target layer nodes includes: A depth analysis was performed on the classification tree structure to obtain the hierarchical depth of several nodes; The maximum depth of the classification tree structure is determined by the level depth, and several nodes whose level depth does not meet the standard are removed according to the maximum depth value to obtain candidate nodes; The candidate nodes are traversed by the maximum depth value to obtain the leaf class candidate layer nodes, and the parent class candidate layer nodes are extracted from the candidate nodes according to the parent node identifier of the leaf class candidate layer nodes. The target layer node is obtained by summing the candidate nodes of the leaf class and the candidate nodes of the parent class.

3. The structured text classification method as described in claim 1, characterized in that, The step of constructing a valid path connection table based on the parent-child relationships between several nodes in the classification tree structure includes: Obtain the node identifier, parent node identifier, and node semantic description of several leaf class candidate layer nodes in the target layer node, and obtain the node identifier and node semantic description of several parent class candidate layer nodes in the target layer node; The parent node identifiers of the leaf candidate layer nodes are compared with the node identifiers of the parent candidate layer nodes. Leaf candidate layer nodes whose parent node identifiers match the node identifiers of the parent candidate layer nodes are combined with the parent candidate layer nodes to form node relationship pairs, thus obtaining several node relationship pairs. By sequentially concatenating the aforementioned node relationships, several legal node paths are obtained. These legal node paths and their corresponding node semantic descriptions are then associated to obtain a legal path connection table.

4. The structured text classification method as described in claim 1, characterized in that, The step of segmenting and rearranging the structured text objects to be classified according to a preset batch size to obtain the segmentation result includes: The structured text objects to be classified are divided into windows according to the preset batch size to obtain several original batches; Assign batch identifiers and random seeds to the aforementioned original batches; The structured text objects corresponding to the original batches are rearranged using the random seed-driven pseudo-random rearrangement algorithm to obtain several rearranged batches. Record the batch identifier, object identifier, and arrangement order of the several rearranged batches to obtain the segmentation result.

5. The structured text classification method as described in claim 1, characterized in that, The step of performing candidate retrieval on the segmentation result through the target layer nodes to obtain a local candidate path set includes: Obtain the object semantic descriptions corresponding to several structured text objects in the segmentation result, and perform semantic embedding calculation on the object semantic descriptions to obtain embedding vectors; Extract several legal node paths from the legal path connection table through the target layer nodes, and perform vector representation on the node semantic descriptions corresponding to the several legal node paths to obtain path vectors; The path vector and the embedding vector are used to calculate the similarity to obtain a similarity score; The similarity scores are used to filter the legal node paths to obtain a local candidate path set.

6. The structured text classification method as described in claim 5, characterized in that, The step of obtaining text classification results by performing joint reasoning on the structured text object using a large language model based on pre-acquired dynamic semantic anchors, the legal path connection table, and the local candidate path set includes: The prompt information is obtained by summarizing the local candidate path set, the legal path connection table, and the dynamic semantic anchors. The prompt information is reasoned through the large language model to obtain candidate classification paths, and the candidate classification paths are verified through the legal path connection table. When there are nodes in the candidate classification paths that do not belong to the legal path connection table, the candidate classification paths in the local candidate path set are selected based on the similarity scores. By replacing the candidate classification path with the alternative classification path, the text classification result is obtained.

7. The structured text classification method as described in claim 6, characterized in that, After the step of selecting candidate classification paths from the local candidate path set based on the similarity score, the method further includes: When there are no alternative classification paths in the local candidate path set, the structured text object is marked as an abnormal object; Write the object identifier, embedding vector, and local candidate path set of the abnormal object into the manual review queue; Calculate the similarity between the embedding vectors of several abnormal objects in the manual review queue, and group the abnormal objects with similarity greater than a preset clustering threshold into the same set to obtain a candidate new category set; When the number of abnormal objects in the candidate new category set exceeds a preset threshold, a suggestion to add a new node is generated.

8. A structured text classification device, characterized in that, The structured text classification device is applied to a classification system, the classification system including a classification tree structure, and the device includes: A construction module is used to perform topological shrinking on the classification tree structure to obtain target layer nodes, and to construct a legal path connection table based on the parent-child relationship between several nodes in the classification tree structure. The retrieval module is used to segment and rearrange the structured text objects to be classified according to a preset batch size to obtain segmentation results, and to perform candidate retrieval on the segmentation results through the target layer nodes to obtain a local candidate path set; The inference module is used to perform joint inference on the structured text object based on the pre-acquired dynamic semantic anchors, the legal path connection table, and the local candidate path set through a large language model to obtain the text classification result. The step of acquiring the dynamic semantic anchors includes: collecting the final structured text objects that have completed classification inference in the same batch and the final classification result corresponding to the final structured text objects, converting the final structured text objects and the final classification result into dynamic semantic anchors, and writing the dynamic semantic anchors into the anchor reference pool.

9. A structured text classification device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the structured text classification method as described in any one of claims 1 to 7.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the structured text classification method as described in any one of claims 1 to 7.