Methods, apparatus, equipment and storage media for generating knowledge catalogs for knowledge bases
By combining directory generation with tag generation in the knowledge base, and utilizing the joint loss function and feedback mapping matrix, the inconsistency problem caused by independent generation of directories and tags is solved, and efficient and accurate updating of the knowledge directory is achieved.
Patent Information
- Application Number
- CN202611263005.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-11-17
AI Technical Summary
In existing technologies, knowledge base directory generation and tag generation are usually carried out independently, resulting in a lack of consistency between the directory and tags. It is difficult to distill human review experience into optimization signals that the system can use, and it is difficult to incrementally accommodate new topics, resulting in high computational costs and easy disturbance to the stable directory.
The directory generation and tag generation are placed in the same process. The joint loss function is used to evaluate the generation results of each round. The user review operation is converted into parameter update quantity through a preset feedback mapping matrix to update the initial directory tree, ensuring that the directory structure and tag system are mutually constrained in the iteration.
It improves the accuracy of knowledge catalog generation and updates by converting manual review operations into parameterized signals to drive subsequent catalog updates, thus solving the inconsistency problem caused by the independent generation of catalogs and tags and improving the accuracy of generation and updates.
Smart Images

Figure CN123115501A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic digital data processing technology, and in particular to a method, apparatus, device and storage medium for generating a knowledge catalog for a knowledge base. Background Technology
[0002] As the size of documents in the enterprise knowledge base continues to grow and business themes continue to evolve, the directory structure of the knowledge base needs to be automatically generated without relying on manual pre-construction of a complete system, and can adaptively adjust the directory structure when incremental documents are added in the future, so as to maintain the directory's ability to collect documents.
[0003] In existing technologies, directory generation and tag generation are typically performed as two independent tasks sequentially. The directory structure only reflects the topic clustering results of documents, while the tag system reflects the business attribute dimensions of documents. During the manual review stage, user operations are only recorded as the final editing result. For low-quality classifications or new topic clusters formed by newly added documents, existing solutions often adopt a full-scale reconstruction approach for adjustment, resulting in high computational costs and easy disturbance to already stable directory nodes. This makes semantic conflicts easily arise between the initial directory and tags, making it difficult to distill manual review experience into continuously callable optimization signals for the system, and new topics cannot be incrementally inherited and are forced to be classified into irrelevant directories. Summary of the Invention
[0004] The main objective of this application is to provide a method, apparatus, device, and storage medium for generating a knowledge catalog for a knowledge base, aiming to solve the technical problem of how to improve the accuracy of knowledge catalog generation and updating.
[0005] To achieve the above objectives, this application proposes a knowledge catalog generation method for knowledge bases, the method comprising: Get a snapshot of the catalog and knowledge documents; The knowledge documents are parsed and semantically represented to obtain candidate topic clusters; Based on the directory snapshot and the candidate topic clusters, generate candidate directory nodes and a candidate tag system associated with the candidate directory nodes; Based on the candidate directory nodes and the candidate tag system, determine the stage directory tree; The quality of the stage directory tree, the candidate directory nodes, and the candidate label system is evaluated according to a preset joint loss function to obtain the current joint loss value. When the current joint loss value is less than the historical joint loss value in the directory snapshot and the stage directory tree meets the preset stopping condition, the stage directory tree is used as the initial directory tree; The user's review operation on the initial directory tree is converted into parameter update quantity according to the preset feedback mapping matrix; The initial directory tree is updated according to the parameter update amount to obtain the target directory tree.
[0006] In one embodiment, generating candidate directory nodes and a candidate tag system associated with the candidate directory nodes based on the candidate topic clusters includes: When the directory snapshot is not in the initialization state, extract the historical directory tree, historical tag system, directory generation constraints, and tag generation constraints from the directory snapshot; Candidate directory nodes are generated based on the candidate topic clusters, the historical directory tree, the historical tag system, and the directory generation constraints; Obtain the directory level and document business content corresponding to the candidate directory node; Based on the tag generation constraints, the candidate directory nodes, the directory hierarchy, and the document business content, a candidate tag system associated with the candidate directory nodes is generated.
[0007] In one embodiment, generating candidate directory nodes based on the candidate topic clusters, the historical directory tree, the historical tag system, and the directory generation constraints includes: Based on the candidate topic clusters, representative documents and topic cluster concepts are obtained; Based on the directory generation constraints, the candidate topic clusters, the representative documents, the topic cluster concepts, and the historical tag system, generate topic directory nodes; Candidate directory nodes are determined based on the topic directory nodes and the historical directory nodes in the historical directory tree.
[0008] In one embodiment, the step of evaluating the quality of the stage directory tree, the candidate directory nodes, and the candidate label system according to a preset joint loss function to obtain the current joint loss value includes: Based on the stage directory tree, the directory depth, node load, and branch distribution are obtained; The directory structure imbalance is obtained based on the directory depth, the node load, and the branch distribution. Based on the business theme of the candidate directory node and the candidate tag system corresponding to the candidate directory node, the directory-tag consistency score is obtained; Based on the candidate directory nodes and the candidate tag system, document coverage, directory differentiation, hierarchical rationality, tag consistency, and tag completeness are obtained. The overall quality score of the directory is obtained based on the document coverage, directory differentiation, hierarchical rationality, tag consistency, and tag completeness. The directory structure imbalance, the directory-tag consistency score, and the directory overall quality score are input into a preset joint loss function to obtain the current joint loss value.
[0009] In one embodiment, after performing quality evaluation on the stage directory tree, the candidate directory nodes, and the candidate label system according to a preset joint loss function to obtain the current joint loss value, the method further includes: Extract historical joint loss values from the catalog snapshot; When the current joint loss value is greater than or equal to the historical joint loss value, the source of quality degradation is determined based on the document coverage, the directory distinguishability, the hierarchical rationality, the tag consistency, and the tag completeness, and the directory generation constraints and the tag generation constraints in the directory snapshot are updated based on the source of quality degradation. When the current joint loss value is less than the historical joint loss value and the stage directory tree does not meet the preset stopping condition, the directory snapshot is updated based on the stage directory tree, the candidate label system, and the current joint loss value; The updated directory snapshot is used to return to the step of generating candidate directory nodes and a candidate tag system associated with the candidate directory nodes based on the directory snapshot and the candidate topic clusters.
[0010] In one embodiment, the step of converting the user's review operation on the initial directory tree into parameter update quantities according to a preset feedback mapping matrix includes: Obtain a preset feedback mapping matrix, feedback timeliness, and user review operations on the initial directory tree, wherein the review operations include operation type and update object; The audit operation is converted into a feedback mapping value according to the preset feedback mapping matrix; The feedback credibility is obtained based on the consistency of the review operations of different users, the historical high-confidence feedback operations of the updated object, and the user's permission role; Based on the feedback mapping value, the feedback timeliness, and the feedback reliability, the parameter update amount is obtained.
[0011] In one embodiment, after updating the initial directory tree according to the parameter update amount to obtain the target directory tree, the method further includes: Retrieve the feedback event table, the newly added document, and multiple target directory nodes of the target directory tree; The semantics of the target node are obtained based on the document semantics, tag semantics, and directory name semantics of the target directory node; Based on the newly added document, the semantics of the newly added document are obtained; Based on the semantics of the newly added document and the semantics of the target node, a semantic matching score is obtained; Based on the feedback event table, the candidate classification scores of the newly added document and each of the target directory nodes are obtained; When the candidate classification score of the target directory node is greater than or equal to the preset classification score threshold and the target directory node meets the preset reliability conditions, the target directory node is used as the recommended directory node. Based on the candidate classification scores of each of the recommended directory nodes, the directory node to which the newly added document belongs is determined from each of the recommended directory nodes.
[0012] In one embodiment, obtaining the candidate classification scores of the new document and each of the target directory nodes based on the feedback event table includes: The directory stability of the target directory node and the historical adjustment records of the tag system corresponding to the target directory node are determined from the feedback event table. The newly added document is semantically matched with the documents under the target directory node to obtain the document semantic matching result; Based on the document semantic matching results, the target historical documents are determined from the documents under the target directory node; The manual adjustment records of the target historical document are determined from the feedback event table; Based on the directory stability, the historical adjustment records, and the manual adjustment records, a feedback correction score is obtained; The candidate classification score is obtained based on the semantic matching score and the feedback correction score.
[0013] In one embodiment, after obtaining the candidate classification scores of the new document and each of the target directory nodes based on the feedback event table, the method further includes: When the candidate classification scores of each of the target directory nodes are lower than the preset classification score threshold, the newly added document will be regarded as a low-scoring document. The percentage of low-scoring documents is obtained based on the number of newly added documents and the number of low-scoring documents within the preset incremental monitoring time window; When the proportion of low-scoring documents is greater than or equal to a preset proportion threshold, the low-scoring documents are clustered to obtain low-scoring document topic clusters; The low-scoring document topic clusters and the target directory nodes are matched for similarity to obtain the semantic similarity of each target directory node; When the number of low-scoring documents exceeds a preset trigger threshold, the directory subtree to be reconstructed is determined based on the target directory nodes whose semantic similarity is greater than or equal to the preset similarity threshold. The target directory tree is reconstructed based on the subtree to be reconstructed and the low-scoring document topic clusters.
[0014] In addition, to achieve the above objectives, this application also proposes a knowledge catalog generation device for knowledge bases, the knowledge catalog generation device for knowledge bases including: an input module for acquiring catalog snapshots and knowledge documents; The parsing module is used to parse and semantically represent the knowledge document to obtain candidate topic clusters; The collaborative generation module is used to generate candidate directory nodes and a candidate tag system associated with the candidate directory nodes based on the directory snapshot and the candidate topic clusters; The directory tree generation module is used to determine the stage directory tree based on the candidate directory nodes and the candidate tag system; The loss module is used to perform quality evaluation on the stage directory tree, the candidate directory nodes and the candidate label system according to a preset joint loss function, and obtain the current joint loss value; The judgment module is used to take the stage directory tree as the initial directory tree when the current joint loss value is less than the historical joint loss value in the directory snapshot and the stage directory tree meets the preset stopping condition. The conversion module is used to convert the user's review operation on the initial directory tree into parameter update quantities according to the preset feedback mapping matrix; The update module is used to update the initial directory tree according to the parameter update amount to obtain the target directory tree.
[0015] In addition, to achieve the above objectives, this application also proposes a knowledge catalog generation device for knowledge bases, 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 knowledge catalog generation method for knowledge bases as described above.
[0016] 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 when the computer program is executed by a processor, it implements the steps of the knowledge catalog generation method for knowledge base as described above.
[0017] 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 knowledge catalog generation method for knowledge base as described above.
[0018] One or more technical solutions proposed in this application have at least the following technical effects: The process involves: acquiring a directory snapshot and knowledge documents; parsing and semantically representing the knowledge documents to obtain candidate topic clusters; generating candidate directory nodes and a candidate tag system associated with the candidate directory nodes based on the directory snapshot and the candidate topic clusters; determining a stage directory tree based on the candidate directory nodes and the candidate tag system; evaluating the quality of the stage directory tree, the candidate directory nodes, and the candidate tag system using a preset joint loss function to obtain a current joint loss value; using the stage directory tree as an initial directory tree when the current joint loss value is less than the historical joint loss value in the directory snapshot and the stage directory tree meets a preset stopping condition; converting the user's review operation on the initial directory tree into parameter update amounts based on a preset feedback mapping matrix; and updating the initial directory tree based on the parameter update amounts to obtain a target directory tree. By integrating directory generation and tag generation into the same process and evaluating the results of each round using a joint loss function, the directory structure and tag system are mutually constrained during iteration, resolving the inconsistency issue caused by independent directory and tag generation. Furthermore, by saving the stage directory tree as the initial directory tree when the joint loss value decreases and a stopping condition is met, the higher-quality version from multiple rounds of generation is solidified. Finally, by converting user review operations on the initial directory tree into parameter update values according to a preset feedback mapping matrix and updating the initial directory tree based on these parameter update values, different operation types have a differentiated impact on subsequent classifications. Through these methods, manual review operations are transformed into parameterized signals that drive subsequent directory updates, thereby improving the accuracy of knowledge directory generation and updates. Attached Figure Description
[0019] 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.
[0020] 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.
[0021] Figure 1 This is a flowchart illustrating an embodiment of the knowledge catalog generation method for knowledge bases in this application. Figure 2 This is a schematic diagram of the joint generation process provided in Embodiment 1 of the knowledge catalog generation method for knowledge bases in this application; Figure 3 This is a schematic diagram of the manual review and feedback learning process provided in Embodiment 1 of the knowledge catalog generation method for knowledge bases in this application; Figure 4 This is a schematic diagram of a partial reconstruction process provided in Embodiment 1 of the knowledge catalog generation method for knowledge bases in this application; Figure 5 This is a flowchart illustrating Embodiment 2 of the knowledge catalog generation method for knowledge bases in this application; Figure 6 This is a schematic diagram of the specific process for the knowledge catalog generation method for knowledge bases in this application, as shown in Embodiment 2. Figure 7 This is a schematic diagram of the module structure of a knowledge catalog generation device for a knowledge base according to an embodiment of this application; Figure 8 This is a schematic diagram of the device structure of the hardware operating environment involved in the knowledge catalog generation method for knowledge base in this embodiment of the application.
[0022] 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
[0023] 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.
[0024] 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.
[0025] The main solution of this application embodiment is as follows: Obtain a directory snapshot and knowledge documents; parse and semantically represent the knowledge documents to obtain candidate topic clusters; generate candidate directory nodes and a candidate tag system associated with the candidate directory nodes based on the directory snapshot and the candidate topic clusters; determine a stage directory tree based on the candidate directory nodes and the candidate tag system; perform quality evaluation on the stage directory tree, the candidate directory nodes, and the candidate tag system according to a preset joint loss function to obtain a current joint loss value; when the current joint loss value is less than the historical joint loss value in the directory snapshot and the stage directory tree meets a preset stopping condition, use the stage directory tree as the initial directory tree; convert the user's review operation on the initial directory tree into parameter update amounts according to a preset feedback mapping matrix; update the initial directory tree according to the parameter update amounts to obtain the target directory tree.
[0026] In this embodiment, for ease of description, the following description will focus on a knowledge catalog generation system oriented towards a knowledge base.
[0027] In existing technologies, directory generation and tag generation are typically performed as two independent tasks, one after the other. The directory structure only reflects the topic clustering results of documents, while the tag system reflects the business attribute dimensions of documents. During the manual review stage, user operations are only recorded as the final editing result. For low-quality classifications or new topic clusters formed by newly added documents, existing solutions often use a full reconstruction approach for adjustment, resulting in high computational costs and easy disturbance to already stable directory nodes. This makes it easy for semantic conflicts to arise between the initial directory and tags, making it difficult to distill manual review experience into continuously callable optimization signals for the system. New topics cannot be incrementally inherited and are forced to be assigned to unrelated directories.
[0028] This application provides a solution that addresses the inconsistency problem caused by independent generation of directories and tags by placing directory generation and tag generation in the same process and evaluating the results of each round using a joint loss function. This mutual constraint between the directory structure and tag system during iteration solves the problem of inconsistency caused by independent generation of directories and tags. Furthermore, by saving the stage directory tree as the initial directory tree when the joint loss value decreases and a stopping condition is met, the higher-quality version from multiple rounds of generation is solidified. Finally, by converting user review operations on the initial directory tree into parameter update values according to a preset feedback mapping matrix and updating the initial directory tree based on these parameter update values, different operation types have a differentiated impact on subsequent classifications. Due to these methods, manual review operations are transformed into parameterized signals that drive subsequent directory updates, thereby improving the accuracy of knowledge directory generation and updates.
[0029] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of implementing the above functions, a knowledge catalog generation system for knowledge bases, etc. The following description uses a knowledge catalog generation system for knowledge bases as an example to illustrate this embodiment and the subsequent embodiments.
[0030] Based on this, embodiments of this application provide a knowledge catalog generation method for knowledge bases, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the knowledge catalog generation method for knowledge bases in this application.
[0031] In this embodiment, the knowledge catalog generation method for knowledge base includes steps S10 to S80: Step S10: Obtain a catalog snapshot and knowledge documents; It should be noted that a catalog snapshot is a complete system state saved during the generation of a historical catalog, while a knowledge document is an electronic document that is to be processed or classified.
[0032] Specifically, the directory snapshot includes the historical directory tree structure, historical tag system, historical document classification results, historical quality evaluation results, and historical directory generation constraints and tag generation constraints. For example, during the cold start phase, the directory snapshot is empty or in an initial state, and the system directly receives the document collection imported by the user as knowledge documents. During the incremental operation phase, the directory snapshot is the directory structure saved from the previous stable version, and the knowledge documents are the newly added business documents.
[0033] Understandably, by obtaining catalog snapshots and knowledge documents, subsequent catalog generation can continue to iterate based on historical stable results, avoiding building from scratch each time.
[0034] Step S20: Parse and semantically represent the knowledge document to obtain candidate topic clusters; It should be noted that knowledge document parsing is the process of converting unstructured or semi-structured raw documents into structured information, while semantic representation is the process of converting document content into computable feature vectors.
[0035] Specifically, such as Figure 2 As shown, the knowledge document undergoes format parsing and content cleaning, including identifying the document's heading levels, chapter relationships, and paragraph boundaries, and removing interfering content such as headers, footers, table of contents, duplicate headings, formatting noise, and disclaimers. The cleaned document is then segmented according to semantic boundaries or fixed-length windows to obtain document blocks. Finally, a summary, core concepts, and semantic vectors are generated for each document block, and documents are clustered based on the similarity between semantic vectors, aggregating semantically similar documents into a candidate topic cluster. Figure 2 The initial concept cluster in the semantic vector space. For example, if multiple documents are close in distance in the semantic vector space and their core concepts all involve business information such as "financial products", "risk level", and "customer suitability", then these documents can form a candidate topic cluster.
[0036] Understandably, by parsing and semantically representing knowledge documents and clustering them into candidate topic clusters, the subsequent catalog generation can be organized based on the inherent semantic relationships between documents, avoiding the workload of manual sorting.
[0037] Step S30: Based on the directory snapshot and the candidate topic cluster, generate candidate directory nodes and a candidate tag system associated with the candidate directory nodes; It should be noted that candidate directory nodes are hierarchical nodes to be included in the directory tree, and the candidate tag system is a set of business attribute tags associated with candidate directory nodes.
[0038] Understandably, by using directory snapshots as constraints, the generation of candidate directory nodes can leverage the constraints of historical directory structures and historical tag systems, avoiding structural drift caused by regeneration each time, thereby improving the stability of directory generation.
[0039] In one feasible implementation, step S30 may include: when the directory snapshot is not in an initial state, extracting the historical directory tree, historical tag system, directory generation constraints, and tag generation constraints from the directory snapshot; generating candidate directory nodes based on the candidate topic clusters, the historical directory tree, the historical tag system, and the directory generation constraints; obtaining the directory level and document business content corresponding to the candidate directory nodes; and generating a candidate tag system associated with the candidate directory nodes based on the tag generation constraints, the candidate directory nodes, the directory level, and the document business content.
[0040] It should be noted that directory generation constraints are parameters used to control the way directory nodes are generated, tag generation constraints are parameters used to control the way tag systems are generated, the historical directory tree is the directory hierarchy structure saved in the previous stable version, and the historical tag system is the set of tags saved in the previous stable version and their association with the directory.
[0041] Specifically, when the directory snapshot is in its initial state, it contains no historical directory tree structure, no historical tag system, no historical document classification results, and no historical quality evaluation results. Furthermore, the directory generation constraints and tag generation constraints are all at their initial default values. The system directly clusters candidate topic clusters based on the semantic representation of the knowledge documents, and then generates initial candidate directory nodes and candidate tag systems based on these candidate topic clusters.
[0042] When the directory snapshot is not in an initial state, the system extracts the historical directory tree, historical tag system, directory generation constraints, and tag generation constraints from the directory snapshot. Then, based on the representative documents and core concepts of the candidate topic clusters, combined with the structural relationships of the historical directory tree, the tag distribution of the historical tag system, and the merging or splitting tendencies in the directory generation constraints, candidate directory nodes for this round are generated. Next, the hierarchical position of each candidate directory node in the directory tree, as well as the business theme and business attributes of the documents under that node, are obtained. Finally, the tag generation constraints, the candidate directory node itself, the directory hierarchy of the candidate directory node, and the business boundaries of the documents under that node are used as input conditions for tag generation to generate a candidate tag system associated with the candidate directory node.
[0043] Further, generating candidate directory nodes based on the candidate topic clusters, the historical directory tree, the historical tag system, and the directory generation constraints includes: obtaining representative documents and topic cluster concepts based on the candidate topic clusters; generating topic directory nodes based on the directory generation constraints, the candidate topic clusters, the representative documents, the topic cluster concepts, and the historical tag system; and determining candidate directory nodes based on the topic directory nodes and historical directory nodes in the historical directory tree.
[0044] It should be noted that the representative document is a document selected from the candidate topic cluster that can reflect the main semantics of the topic cluster. The topic cluster concept is a summary of the business topics of the candidate topic cluster, and the topic directory node is a directory node directly generated based on the candidate topic cluster.
[0045] Specifically, from each candidate topic cluster, several documents with the closest semantic distance to the cluster center are selected as representative documents, and the frequently occurring core concepts in that topic cluster are extracted as topic cluster concepts. Based on the directory generation constraints, candidate topic clusters, representative documents, topic cluster concepts, and the historical tagging system, topic directory nodes corresponding to that topic cluster are generated. For example, if there is a high tendency to merge in the directory generation constraints, multiple semantically similar topic directory nodes are merged into one. The generated topic directory nodes are then matched and merged with existing historical directory nodes in the historical directory tree. Topic directory nodes with semantic consistency with historical directory nodes directly inherit the name and level of the historical directory nodes, while newly added topic directory nodes are added as new nodes, thus determining the final candidate directory nodes for this round.
[0046] For example, suppose the input document set includes documents such as retail credit product brochures, credit card marketing plans, corporate credit approval guidelines, and wealth management product risk disclosure statements. The system first generates multiple candidate topic clusters based on document semantics. One topic cluster primarily involves documents related to "financial services," and its representative documents include retail credit product brochures and wealth management product risk disclosure statements. The topic cluster concept is "financial services." When generating candidate directory nodes corresponding to this topic cluster, the system reads that the merging tendency parameter in the directory generation constraint is low and, based on the tag distribution in the historical tag system, finds that the historical tag set corresponding to this topic cluster contains multiple business attribute dimensions such as "financial services," "corporate clients," "wealth management," and "funds," with a relatively dispersed tag distribution. Since the directory generation constraint indicates a strong splitting tendency in the current round, the system splits this topic directory node into two candidate directory nodes: "retail business" and "wealth management." The system then identifies the "Retail Business" directory node as a first-level sub-node, revealing that the business content of documents under this node includes retail credit products and credit card marketing. Similarly, the system identifies the "Wealth Management" directory node as a first-level sub-node, revealing that the business content of documents under this node includes wealth management products and fund products. Based on the medium granularity parameter in the tag generation constraints, the system generates associated tag systems such as "Customer Type," "Credit Rating," and "Product Term" using the "Retail Business" directory node, its directory level, and document business content as input. It also generates associated tag systems such as "Customer Risk Rating," "Product Type," and "Applicable Channels" using the "Wealth Management" directory node, its directory level, and document business content as input. In the next iteration, the system checks that the tags under the "Retail Business" directory node are concentrated on "Credit Rating" and "Product Term," and that the document content is highly homogeneous, indicating that the current granularity of this directory is appropriate and requires no adjustment. However, the system also checks that the "Wealth Management" directory node contains tags such as "Fund Net Asset Value" and "Rate of Return," which are highly relevant to the "Wealth Management Products" theme, but the tag set is quite complex, suggesting that this directory may still need further splitting or optimization of its tag granularity. Based on this, the system updates the splitting tendency parameter in the directory generation constraints and performs further splitting on the directory node in subsequent rounds. Through these multiple iterations, the directory structure gradually converges to a state that reasonably reflects the distribution of document topics under the constraints of the tag system.
[0047] In this embodiment, by simultaneously referencing the historical directory tree and historical tag system of candidate topic clusters when generating candidate directory nodes, the newly generated directory nodes not only reflect the topic distribution of new documents, but also maintain connection with the historical stable directory structure, thus solving the problem of difficulty in integrating new topics with old directories in incremental scenarios.
[0048] The above are merely feasible implementations of step S30 provided in this embodiment. This embodiment does not specifically limit the specific implementation of step S30.
[0049] Step S40: Determine the stage directory tree based on the candidate directory nodes and the candidate tag system.
[0050] It should be noted that the stage directory tree is a tree structure organized by candidate directory nodes according to hierarchical relationships.
[0051] Specifically, after determining the parent-child hierarchical relationship between candidate directory nodes, a complete stage directory tree is formed, and the candidate tag system corresponding to the node is attached to each candidate directory node.
[0052] Understandably, organizing candidate directory nodes into a stage directory tree allows the hierarchical relationship of the directory structure and the document classification path to be determined, facilitating subsequent quality evaluation.
[0053] Step S50: Evaluate the quality of the stage directory tree, the candidate directory nodes, and the candidate label system according to the preset joint loss function to obtain the current joint loss value.
[0054] It should be noted that the preset joint loss function is a multi-index evaluation function used to comprehensively assess the quality of the directory tree structure, the consistency of directory tags, and the overall quality.
[0055] Specifically, the directory depth, document load of each directory node, and node distribution at each level are extracted from the stage directory tree, and the directory structure imbalance is determined based on the directory depth, node load, and branch distribution. The directory-tag consistency score is determined based on the correspondence between the business themes of candidate directory nodes and the business attributes of the candidate tag system. Document coverage, directory differentiation, hierarchical rationality, tag consistency, and tag completeness are determined from the candidate directory nodes and candidate tag system, and the above five indicators are normalized and weighted to form the overall directory quality score. The directory structure imbalance, directory-tag consistency score, and overall directory quality score are input into a preset joint loss function to obtain the current joint loss value.
[0056] Understandably, by jointly evaluating the stage directory tree, candidate directory nodes, and candidate tag system, the directory structure and tag system are tested under the same evaluation criteria, thus avoiding inconsistencies caused by the independent optimization of the directory and tags.
[0057] Step S60: When the current joint loss value is less than the historical joint loss value in the directory snapshot and the stage directory tree meets the preset stopping condition, the stage directory tree is used as the initial directory tree.
[0058] It should be noted that when the directory snapshot is not in an initialization state, the historical joint loss value is the joint loss value corresponding to the previous stable version saved in the directory snapshot; when the directory snapshot is in an initialization state, the historical joint loss value can be set to a preset initial value, which is greater than the joint loss value achievable in any round of generation. This ensures that the stage directory trees generated in the first round can be accepted as initial directory trees if the current joint loss value is less than the historical joint loss value, or the stage of comparing the current joint loss value with the historical joint loss value can be skipped, and the initial directory snapshot can be directly established with the joint loss value of this round. The comparison between the current joint loss value and the historical joint loss value can be performed again from the next round. The preset stopping condition is a standard used to determine that the directory structure has reached a stable state.
[0059] Specifically, such as Figure 2 As shown, the system extracts historical joint loss values from the directory snapshot and compares the current joint loss value L(t) with the historical joint loss value L(t-1). If the current joint loss value L(t) is less than the historical joint loss value L(t-1), it indicates that the quality of the directory structure generated in the current round is better than the previous stable version. Simultaneously, it determines whether the stage directory tree meets preset stopping conditions. Stopping conditions include the directory structure change rate being lower than a preset threshold, the number of iterations reaching a preset upper limit, or all quality evaluation sub-indicators meeting the standards. When both conditions are met, the stage directory tree is output as the initial directory tree.
[0060] Understandably, by saving the stage directory tree as the initial directory tree only when the joint loss value decreases and the stopping condition is met, the generated results are solidified only when their quality improves and tends to stabilize, thus avoiding the misuse of low-quality directories caused by random fluctuations as the final results.
[0061] Step S70: Convert the user's review operation on the initial directory tree into parameter update quantity according to the preset feedback mapping matrix.
[0062] It should be noted that the review operation is the adjustment behavior performed by the user when reviewing the initial directory tree, and the parameter update amount is the quantitative correction value generated by the review operation on the system's relationship and structural parameters.
[0063] Understandably, by using a preset feedback mapping matrix to convert review operations into parameter update quantities, different operation types such as moving documents, modifying tags, merging directories, and splitting directories can have targeted effects on document directory association, directory tag association, and directory structure parameters, thus avoiding insufficient feedback accuracy caused by treating all review operations equally.
[0064] In one feasible implementation, step S70 may include: obtaining a preset feedback mapping matrix, feedback timeliness, and user review operations on the initial directory tree, wherein the review operation includes an operation type and an update object; converting the review operation into a feedback mapping value according to the preset feedback mapping matrix; obtaining feedback credibility based on the consistency of review operations of different users, the historical high-confidence feedback operations of the update object, and the user's permission role; and obtaining the parameter update amount based on the feedback mapping value, the feedback timeliness, and the feedback credibility.
[0065] It should be noted that the preset feedback mapping matrix is a set of rules describing the mapping relationship between different manual review operation types and different system update objects. Feedback timeliness is the effective period of feedback signals as they decay over time. Operation types include CRUD operations such as moving knowledge documents from the first directory node to the second directory node, adding tags to knowledge documents associated with a directory node, deleting tags from knowledge documents associated with a directory node, merging at least two directory nodes, splitting a directory node, and adjusting the hierarchy of directory nodes. Update objects include the association relationship between documents and directory nodes, the association relationship between directory nodes and the tag system, and directory structure parameters. Directory structure parameters may include clustering parameters, directory merging parameters, directory splitting parameters, and hierarchy generation constraints.
[0066] For example, the mapping form of the preset feedback mapping matrix can be referred to Table 1 below.
[0067] Table 1
[0068] Specifically, after receiving a user's review operation on the initial directory tree, the system extracts the operation type and the updated object from the review operation. Then, based on the entries corresponding to the operation type and the updated object in the preset feedback mapping matrix, it determines the feedback mapping value corresponding to the review operation. This value indicates the direction and degree of enhancement or attenuation of the operation on the corresponding updated object. Furthermore, it comprehensively determines the feedback credibility based on whether different users' historical review operations on the updated object are consistent, whether the updated object has historical high-confidence feedback operations, and the current user's permissions and role. Finally, the feedback mapping value, feedback credibility, and feedback timeliness are multiplied to obtain the parameter update amount. For example, when a high-privilege user moves a document from directory A to directory B, the feedback credibility corresponding to this operation is high, and the feedback timeliness is recent. The resulting parameter update amount will reduce the association strength between the document and directory A, and increase the association strength with directory B.
[0069] In this embodiment, the parameter update amount can be expressed as: ΔP = Conf_user × M_feedback(op, target) × T_decay Where ΔP represents the parameter change of the updated object, target represents the updated object, which can be a document-directory association W_dn, a directory-tag association W_nt, or directory structure parameters such as directory merging parameters, directory splitting parameters, or hierarchical generation constraints; Conf_user represents the feedback credibility, including the credibility of the feedback user or feedback event; M_feedback(op,target) represents the feedback mapping value jointly determined by the operation type op and the updated object target; and T_decay represents the time validity or decay factor of the feedback signal. This formula does not restrict the unique calculation method, but rather illustrates that when the system absorbs manual feedback, it simultaneously considers the operation type, the updated object, the feedback credibility, and the feedback timeliness, thereby avoiding writing all manual operations with equal weight into the subsequent classification logic.
[0070] According to such Figure 3 As illustrated in this embodiment, the system acquires a preset feedback mapping matrix, feedback timeliness, and user review operations on the initial directory tree. These review operations can include operation types such as confirming the directory, moving documents, adding tags, deleting tags, modifying tags, merging directories, splitting directories, and adjusting directory levels, as well as update objects such as document-directory relationships, directory-tag relationships, and directory structure parameters. Based on the mapping entries between the operation type and the update object in the preset feedback mapping matrix, the review operation is converted into a corresponding feedback mapping value. This feedback mapping value indicates the direction and degree of enhancement or attenuation of the operation on the update object. Simultaneously, based on different users' actions on the same update object... The reliability of feedback is determined by comprehensively considering factors such as the consistency of the review operations, the existence of historical high-confidence feedback operations on the updated object, and the user's permissions and roles. If multiple users make the same adjustments to the same updated object, the reliability of the feedback is increased; if the current operation conflicts with historical high-confidence feedback operations, the reliability of the feedback is decreased. The feedback mapping value, the timeliness of the feedback, and the reliability of the feedback are then integrated to obtain the parameter update amount. The document-directory association matrix, the directory-tag association matrix, and the clustering, splitting, and merging parameters are updated according to this parameter update amount. The updated matrices and parameters are used for automatic classification of newly added documents, tag recommendation, and local reconstruction judgment.
[0071] For example, suppose a user performs an approval operation on the initial directory tree, moving document d from directory node A to directory node B. The system obtains the mapping entries between the "Move Document" operation type and the "Document-Directory Association" update object in the preset feedback mapping matrix. These mapping entries record that the feedback mapping value of the move document operation in the decay direction of the document-directory association of the original directory node is negative, and the feedback mapping value in the enhancement direction of the document-directory association of the target directory node is positive. The absolute values of the decay and enhancement are both preset values. Therefore, the system converts this approval operation into a feedback mapping value that decays the association between document d and directory node A and a feedback mapping value that enhances the association between document d and directory node B.
[0072] When determining the credibility of feedback, the system checks the user role performing the operation. Assuming the user has knowledge base management permissions at a high level, the initial credibility is set to 0.9. The system further searches the historical feedback event table and finds a high-confidence feedback operation between document d and directory node B in a previous review. This operation was confirmed by multiple expert users that document d should be assigned to directory node B. Therefore, the current operation is consistent with the historical high-confidence feedback operation, further increasing the initial credibility. Simultaneously, the system searches for other users who have performed different adjustment operations on the relationship between document d and directory node A or directory node B. If no conflicting records are found and the current operation is consistent with historical records, the final feedback credibility is determined to be 0.95. The system also retrieves the feedback validity period setting, setting the validity period of this type of feedback to 60 days from the current time. After 60 days, the feedback signal linearly decays to 0.1 over time. The system multiplies the feedback mapping value, feedback timeliness, and feedback credibility to obtain the parameter update amount. This parameter update amount enhances the recommendation priority between the newly added documents and the directory node B when classifying them, as documents with a semantic similarity greater than a preset threshold with document d.
[0073] In this embodiment, by setting a feedback mapping matrix, feedback credibility, and feedback timeliness, manual review operations from different sources and with different levels of reliability can have a differentiated impact on the system, thus solving the problem of low-quality feedback contaminating subsequent classification results.
[0074] In one feasible implementation, step S70 may include: obtaining a feedback event table, a new document, and multiple target directory nodes of the target directory tree; obtaining target node semantics based on the document semantics, tag semantics, and directory name semantics of the target directory nodes; obtaining new document semantics based on the new document; obtaining a semantic matching score based on the new document semantics and the target node semantics; obtaining candidate classification scores between the new document and each of the target directory nodes based on the feedback event table; when the candidate classification score of the target directory node is greater than or equal to a preset classification score threshold and the target directory node meets a preset reliability condition, designating the target directory node as a recommended directory node; and determining the directory node to which the new document belongs from each of the recommended directory nodes based on the candidate classification scores of each of the recommended directory nodes.
[0075] It should be noted that the feedback event table is used to record feedback events generated during the historical manual review process, the candidate classification score is used to represent the overall fit of the newly added document into each target directory node, and the pre-set reliability conditions are used to avoid forcibly classifying the document into an unsuitable directory because the candidate classification score is relatively high but the overall fit is insufficient.
[0076] Specifically, after the system obtains a new document, it generates a semantic vector for the new document. For each target directory node in the target directory tree, the semantic vectors of all documents under that node, the semantic vectors of the tag system associated with that node, and the semantic vector of the node name are fused together to form the target node semantics for that target directory node. The formula is as follows: v(N_j) = a × mean(v(d_i)) + b × mean(v(t_k)) + c × v(name_j) Where v(N_j) represents the semantic representation of directory node N_j, v(d_i) represents the semantic representation of the document under this directory node, v(t_k) represents the semantic representation of the tag under this directory node, v(name_j) represents the semantic representation of the directory node name, and a, b, and c are configurable weights.
[0077] Then, the semantic similarity between the newly added document and the target node is calculated to obtain a semantic matching score. Next, based on the historical adjustment records of the target directory node in the feedback event table, the directory stability of the node, and the historical adjustment records of the corresponding tags of the node, a feedback correction score is determined. The semantic matching score and the feedback correction score are then merged to obtain a candidate classification score for the newly added document to be placed in the target directory node. The formula for calculating the candidate classification score is as follows: Score(d_i, N_j) = α × S_sem(d_i, N_j) + β × S_fb(d_i, N_j) Wherein, Score(d_i, N_j) represents the candidate classification score between the new document d_i and the target directory node N_j, S_sem(d_i, N_j) represents the semantic matching score between the new document d_i and the target directory node N_j, and S_fb(d_i, N_j) represents the feedback correction score formed by the feedback mapping matrix, document-directory association records, and directory-tag association records. α and β are configurable weights. S_fb(d_i, N_j) can be determined jointly based on the manual adjustment records of historical documents semantically similar to the new document d_i on the target directory node N_j, the historical enhancement or decay records of the associated tags of the target directory node N_j, and the stability of the target directory node N_j in recent reviews.
[0078] After performing the above calculations on all target directory nodes, the target directory nodes whose candidate classification scores are greater than or equal to the preset classification score threshold and meet the preset reliability conditions are selected as recommended directory nodes, and the candidate with the highest classification score among the recommended directory nodes is selected as the directory node to which the new document belongs.
[0079] Further, obtaining the candidate classification scores of the new document and each of the target directory nodes based on the feedback event table includes: determining the directory stability of the target directory node and the historical adjustment records of the tag system corresponding to the target directory node from the feedback event table; performing semantic matching between the new document and the documents under the target directory node to obtain document semantic matching results; determining the target historical document from the documents under the target directory node based on the document semantic matching results; determining the manual adjustment records of the target historical document from the feedback event table; obtaining a feedback correction score based on the directory stability, the historical adjustment records, and the manual adjustment records; and obtaining a candidate classification score based on the semantic matching score and the feedback correction score.
[0080] It should be noted that directory stability refers to the frequency with which the target directory node is confirmed, adjusted, or reorganized during the historical review process. Historical adjustment records refer to the records of the tag system corresponding to the target directory node being added, deleted, or modified during the historical review process. Target historical documents are existing documents under the directory node with the highest semantic similarity to the newly added documents. Manual adjustment records are the records of the target historical documents being moved, reclassified, or confirmed for reclassification during the historical review process.
[0081] Specifically, the number of times the target directory node was manually confirmed, moved, merged, or split within a preset historical period is counted from the feedback event table. The fewer the number of times and the more the confirmation, the higher the directory stability. Simultaneously, records of the tag system corresponding to the target directory node being added, deleted, or modified during historical review processes are extracted from the feedback event table. Then, the semantic vector of the newly added document is matched one-to-one with the semantic vectors of all existing documents under the target directory node, and the document with the highest semantic similarity is selected as the target historical document. Next, records are retrieved from the feedback event table regarding whether the target historical document was moved to another directory by the user during historical review processes, whether its classification was confirmed by the user, and whether its tags were modified by the user. The directory stability, historical adjustment records of the tag system, and manual adjustment records of the target historical document are weighted and fused to obtain a feedback correction score. Finally, the semantic matching score and the feedback correction score are weighted and summed to obtain the candidate classification score.
[0082] Further, after obtaining the candidate classification scores of the new document and each of the target directory nodes based on the feedback event table, the method further includes: when the candidate classification scores of each of the target directory nodes are all lower than a preset classification score threshold, classifying the new document as a low-scoring document; obtaining the proportion of low-scoring documents based on the number of new documents and the number of low-scoring documents within a preset incremental monitoring time window; when the proportion of low-scoring documents is greater than or equal to a preset proportion threshold, clustering the low-scoring documents to obtain low-scoring document topic clusters; performing similarity matching between the low-scoring document topic clusters and the target directory nodes to obtain the semantic similarity of each of the target directory nodes; when the number of low-scoring documents is greater than a preset trigger number threshold, determining the directory subtree to be reconstructed based on the target directory nodes with semantic similarity greater than or equal to the preset similarity threshold; and reconstructing the target directory tree based on the directory subtree to be reconstructed and the low-scoring document topic clusters.
[0083] It should be noted that the incremental monitoring time window is the time range used to statistically analyze the classification of newly added documents and the distribution of low-scoring documents. The low-scoring document topic cluster is a set of topics formed by clustering documents with classification scores below a preset threshold. The directory subtree to be reconstructed is a set of directory nodes that are semantically related to the low-scoring document topic cluster and require local structural adjustments.
[0084] Specifically, when the candidate classification scores of a newly added document and all target directory nodes are lower than the preset classification score threshold, the newly added document is marked as a low-scoring document. Within the preset incremental monitoring time window, the total number of newly added documents and the number of low-scoring documents among them are counted. The ratio of the number of low-scoring documents to the total number of newly added documents is calculated as the low-scoring document percentage. The formula for expressing the low-scoring document percentage is as follows: R_low = N_low / N_total Where N_low represents the number of low-scoring documents within the window period, and N_total represents the total number of newly added documents within the window period.
[0085] When the proportion of low-scoring documents is greater than or equal to a preset proportion threshold, clustering is performed on all low-scoring documents to obtain a low-scoring document topic cluster G_new. Then, the similarity between the semantic representation v(G_new) of the low-scoring document topic cluster and the semantic representation v(N_j) of the target node of each target directory node is calculated, resulting in the semantic similarity max cos(v(G_new), v(N_j)) between each target directory node and the low-scoring document topic cluster. When the total number of low-scoring documents is greater than a preset trigger number threshold N_new_topic, target directory nodes with semantic similarity greater than or equal to a preset similarity threshold θ_similar, along with their parent nodes, child nodes, and sibling nodes, are selected to form the directory subtree to be reconstructed. Then, based on the low-scoring document topic cluster, the directory nodes and tag system of the directory subtree to be reconstructed are regenerated and optimized.
[0086] In this embodiment, low-scoring documents are clustered to obtain low-scoring document topic clusters, and the directory subtree to be reconstructed is determined based on semantic similarity, so that the reconstruction scope is limited to the truly affected local area. At the same time, reconstruction is only triggered when the number of low-scoring documents exceeds a preset trigger threshold, avoiding frequent reconstruction caused by the abnormal classification of individual documents.
[0087] According to such Figure 4As illustrated in this embodiment, after the system obtains the feedback event table, the new document, and multiple target directory nodes of the target directory tree, it fuses the target node semantics of each target directory node based on the document semantics of the document under each target directory node, the tag semantics of the tag system associated with the target directory node, and the directory name semantics of the target directory node, and generates new document semantics based on the new document; based on the similarity between the new document semantics and the target node semantics, it obtains the semantic matching score between the new document and each target directory node; based on the directory stability of the target directory node recorded in the feedback event table during the historical review process, the target... The historical adjustment records of the tag system corresponding to the directory node and the manual adjustment records of the target historical documents that semantically match the new document are used to determine the feedback correction score. The semantic matching score and the feedback correction score are then merged to obtain the candidate classification score for the new document to be assigned to each of the target directory nodes. When the candidate classification score of a target directory node is greater than or equal to a preset classification score threshold and the target directory node meets a preset reliability condition, the target directory node is used as a recommended directory node. Based on the candidate classification scores of each recommended directory node, the directory node to which the new document belongs is determined from each of the recommended directory nodes, thus completing the automatic classification of the new document and recording the classification score.
[0088] After obtaining the candidate classification scores of the newly added document and each of the target directory nodes, when the candidate classification scores of each of the target directory nodes are all lower than the preset classification score threshold, the newly added document is marked as a low-scoring document and written into the incremental monitoring time window; within the incremental monitoring time window, the total number of newly added documents and the number of low-scoring documents are counted, and the ratio of the number of low-scoring documents to the total number of newly added documents is calculated as the low-scoring document proportion; when the low-scoring document proportion is greater than or equal to the preset proportion threshold, it is determined that the reconstruction trigger condition is met, and all low-scoring documents within the incremental monitoring time window are clustered to obtain at least one low-scoring document topic cluster.
[0089] When the reconstruction triggering conditions are met and the corresponding directory subtree in the target directory tree is not in the reconstruction cooling-off period, or when the total number of low-scoring documents exceeds the preset triggering number threshold and breaks the cooling-off period limit, the semantic similarity between the semantic representation of the topic cluster of the low-scoring document and the semantics of the target node of each target directory node is calculated; based on each target directory node whose semantic similarity is greater than or equal to the preset similarity threshold, the target directory node and its parent node, child node and sibling node are included in the candidate reconstruction range based on the semantic diffusion radius, thereby determining the directory subtree to be reconstructed; the directory node and tag system of the directory subtree to be reconstructed is partially regenerated and optimized, and a structure locking flag is set for the stable directory subtrees in the target directory tree that are not included in the directory subtree to be reconstructed to keep their directory node names, directory hierarchy relationships, existing document ownership and the association between directories and tags unchanged, and finally the partial reconstruction result is output.
[0090] The above are merely feasible implementations of step S70 provided in this embodiment. This embodiment does not specifically limit the specific implementation of step S70.
[0091] Step S80: Update the initial directory tree according to the parameter update amount to obtain the target directory tree.
[0092] It should be noted that the target directory tree is the final structure obtained by adjusting the parameters of the initial directory tree.
[0093] Specifically, the parameter update amount obtained in step S70 is applied to the relationship between documents and directory nodes, the relationship between directory nodes and the tag system, and the directory structure parameters, so that the document classification, tag distribution, and hierarchical structure of the initial directory tree are enhanced or weakened in the direction corresponding to the manual review operation, resulting in the updated target directory tree.
[0094] For example, suppose in step S70, the user performs an approval operation to move document d from directory node A to directory node B, thus generating three sets of parameter update amounts: The first set of parameter update amounts applies to the document-directory association relationship, indicating that the association strength between document d and directory node A is reduced from 0.8 to 0.1, and the association strength between document d and directory node B is increased from 0.2 to 0.9; the second set of parameter update amounts applies to the directory node-tag association relationship, indicating that the weight of tag t associated with directory node B is increased from 0.3 to 0.7; the third set of parameter update amounts applies to the directory structure parameters, indicating that the merging tendency parameter for similar documents is increased. The system applies the first set of parameter update amounts to the document-directory association matrix, updating the association value between document d and directory node A to 0.1 and the association value between document d and directory node B to 0.9; the system applies the second set of parameter update amounts to the directory-tag association matrix, updating the association weight between directory node B and tag t to 0.7; the system applies the third set of parameter update amounts to the directory structure parameters, updating the value of the merging tendency parameter. After the above updates, document d in the initial directory tree is reassigned to directory node B. The recommendation priority of tag t in the tag system associated with directory node B increases. Simultaneously, the system will have a higher tendency to merge similar documents in subsequent classifications to avoid generating overly detailed directories, ultimately resulting in the updated target directory tree. In another scenario, when the same type of review operation (e.g., multiple documents being moved from directory A to directory B) occurs repeatedly, the system accumulates multiple parameter updates. These updates have a cumulative effect on the document-directory association, making the boundary between directory A and directory B clearer after multiple enhancements. Subsequent new documents with semantically similar characteristics to these documents will be directly recommended for inclusion in directory B, thereby reducing repetitive manual adjustments.
[0095] Understandably, by updating the initial directory tree with updated parameters, the experience gained from manual review is quantified and incorporated into the directory structure. When classifying new documents, the corrected relationships in the target directory tree can be directly reused, reducing repetitive manual adjustments.
[0096] This embodiment provides a knowledge directory generation method for a knowledge base, which involves: acquiring a directory snapshot and knowledge documents; parsing and semantically representing the knowledge documents to obtain candidate topic clusters; generating candidate directory nodes and a candidate tag system associated with the candidate directory nodes based on the directory snapshot and the candidate topic clusters; determining a stage directory tree based on the candidate directory nodes and the candidate tag system; evaluating the quality of the stage directory tree, the candidate directory nodes, and the candidate tag system based on a preset joint loss function to obtain a current joint loss value; when the current joint loss value is less than the historical joint loss value in the directory snapshot and the stage directory tree meets a preset stopping condition, using the stage directory tree as the initial directory tree; converting user review operations on the initial directory tree into parameter update amounts based on a preset feedback mapping matrix; and updating the initial directory tree based on the parameter update amounts to obtain a target directory tree. By integrating directory generation and tag generation into the same process and evaluating the results of each round using a joint loss function, the directory structure and tag system are mutually constrained during iteration, resolving the inconsistency issue caused by independent directory and tag generation. Furthermore, by saving the stage directory tree as the initial directory tree when the joint loss value decreases and a stopping condition is met, the higher-quality version from multiple rounds of generation is solidified. Finally, by converting user review operations on the initial directory tree into parameter update values according to a preset feedback mapping matrix and updating the initial directory tree based on these parameter update values, different operation types have a differentiated impact on subsequent classifications. Through these methods, manual review operations are transformed into parameterized signals that drive subsequent directory updates, thereby improving the accuracy of knowledge directory generation and updates.
[0097] 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 that in 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 5 The knowledge catalog generation method for knowledge bases further includes steps S51 to S56 in step S50: Step S51: Based on the stage directory tree, obtain the directory depth, node load, and branch distribution; It should be noted that directory depth is the path length from the root node to the leaf node in the directory tree, node load is the number of documents categorized under each directory node, and branch distribution is the distribution of the number of nodes at each level.
[0098] Specifically, the process begins by traversing the root node of the stage directory tree, counting the depth of each leaf node's level. For each directory node, the total number of documents directly or indirectly belonging to that node is counted as its load value. The number of directory nodes at each level of the directory tree is then counted, forming a branch distribution.
[0099] It is understandable that by obtaining directory depth, node load, and branch distribution, the subsequent calculation of directory structure imbalance can comprehensively evaluate the balance of the directory tree from three dimensions: depth, load, and breadth.
[0100] Step S52: Based on the directory depth, the node load, and the branch distribution, obtain the directory structure imbalance degree; It should be noted that the directory structure imbalance is a quantitative indicator used to evaluate whether the directory tree has unreasonable structures such as excessively deep local areas, excessively heavy load on individual nodes, or uneven distribution of branches.
[0101] Specifically, depth variance is calculated based on the directory depth of each leaf node; a larger depth variance indicates a greater difference in depth between branches of the directory tree. Load variance is calculated based on the node load of each directory node; a larger load variance indicates a more uneven distribution of documents across different directory nodes. Hierarchical distribution deviation is calculated based on the number of nodes at each level; a larger deviation indicates a more uneven hierarchical structure of the directory tree. The depth variance, load variance, and hierarchical distribution deviation are then normalized and weighted and fused to obtain the directory structure imbalance degree.
[0102] Understandably, by quantifying the imbalance in the directory structure, the system can automatically identify whether there are structural problems in the directory tree, providing a basis for judgment in subsequent merging, splitting, or regenerating directory nodes.
[0103] Step S53: Based on the business theme of the candidate directory node and the candidate tag system corresponding to the candidate directory node, obtain the directory-tag consistency score.
[0104] It should be noted that the directory-tag consistency score is a quantitative indicator used to evaluate whether the business theme expressed by the directory node is consistent with the tag system corresponding to that node.
[0105] Specifically, for each candidate directory node, the business topic type expressed by the node is extracted, and the business attribute types of all tags in the corresponding candidate tag system are extracted. The matching degree between the business topic type and the business attribute types of each tag is calculated, and the proportion of tags with complete matches is counted. The higher this proportion, the higher the directory-tag consistency score. For directory nodes with obviously mismatched tags, the consistency score of the node is reduced accordingly based on the proportion of mismatched tags.
[0106] Understandably, by quantifying the directory-tag consistency score, the system can identify whether the directory and tag are expressed collaboratively within the same business boundary, thus avoiding the directory and tag expressing contradictory semantic information separately.
[0107] Step S54: Based on the candidate directory nodes and the candidate tag system, obtain the document coverage, directory differentiation, hierarchical rationality, tag consistency, and tag completeness.
[0108] It should be noted that document coverage reflects how many knowledge documents can be categorized into specific directory nodes; directory differentiation reflects the clarity of business boundaries between different directory nodes; hierarchical rationality reflects whether the depth of the directory tree and the node load are appropriate; tag consistency reflects whether the document tag distribution under the same directory node is stable; and tag completeness reflects whether the tag system covers the main business concepts in the document.
[0109] Specifically, document coverage is calculated by dividing the number of documents assigned to at least one candidate directory node by the total number of knowledge documents. Directory distinguishability is calculated by the average semantic distance between the semantic representations of each candidate directory node; a larger average distance indicates higher distinguishability. Hierarchical rationality is determined by a combination of the average depth of the directory tree and the balance of node load. Tag consistency is calculated by averaging the ratio of the intersection to the union of the tag sets of documents under the same directory node. Tag completeness is determined by the proportion of core concepts appearing in knowledge documents that are covered by the tag system.
[0110] Understandably, by quantifying the quality of directories and tags from five dimensions—coverage, differentiation, rationality, consistency, and completeness—the overall quality score can comprehensively reflect the multifaceted performance of the current directory and tagging system.
[0111] Step S55: Obtain the overall quality score of the directory based on the document coverage, directory differentiation, hierarchical rationality, tag consistency, and tag completeness.
[0112] It should be noted that the overall quality score of the directory is a weighted fusion of five indicators: document coverage, directory differentiation, hierarchical rationality, tag consistency, and tag completeness. The formula for calculating the overall quality score of the directory is as follows: Q_quality=w1×Coverage+w2×Dist+w3×H_level+w4×TagConsistency+w5×Completeness Here, Coverage represents document coverage, Dist represents directory differentiation, H_level represents hierarchical rationality, TagConsistency represents tag consistency, Completeness represents tag completeness, and w1 to w5 are configurable weights.
[0113] Specifically, document coverage, directory differentiation, hierarchical rationality, tag consistency, and tag completeness are normalized to ensure that all metrics fall within the same numerical range. Then, corresponding weight coefficients are assigned according to the importance of each metric to the business scenario. The normalized metrics are multiplied by their respective weights and summed to obtain the overall directory quality score.
[0114] Understandably, by integrating the five dimensions into a comprehensive quality score, the subsequent calculation of the joint loss value can comprehensively consider the quality of various aspects of the catalog and labeling system.
[0115] Step S56: Input the directory structure imbalance, the directory-tag consistency score, and the directory overall quality score into a preset joint loss function to obtain the current joint loss value.
[0116] It should be noted that the preset joint loss function is an evaluation function that weights and fuses the directory structure imbalance score, directory-tag consistency score, and directory overall quality score to obtain the comprehensive loss value, as shown below: L(t)=α·I_tree + β·(1-C_consistency) + γ·(1-Q_quality) Where I_tree represents the directory structure imbalance, C_consistency represents the directory-tag consistency score, and Q_quality represents the overall directory quality score.
[0117] Specifically, the directory structure imbalance is normalized; the greater the imbalance, the higher the directory structure imbalance value. The directory-tag consistency score and the overall directory quality score are weighted and summed with the normalized structural imbalance value according to their respective weights to obtain the current joint loss value. The smaller the joint loss value, the higher the overall quality of the directory structure and tag system generated in the current round.
[0118] Understandably, by incorporating directory structure imbalance, directory-tag consistency score, and overall directory quality score into the same joint loss function, the directory structure and tagging system are jointly tested under the same evaluation framework, thus avoiding the problem of optimizing a single indicator but decreasing the overall effect.
[0119] In one feasible implementation, step S56 may include: extracting historical joint loss values from the directory snapshot; when the current joint loss value is greater than or equal to the historical joint loss value, determining the source of quality degradation based on the document coverage, the directory distinguishability, the hierarchical rationality, the tag consistency, and the tag completeness, and updating the directory generation constraints and the tag generation constraints in the directory snapshot based on the source of quality degradation; when the current joint loss value is less than the historical joint loss value and the stage directory tree does not meet the preset stopping condition, updating the directory snapshot based on the stage directory tree, the candidate tag system, and the current joint loss value; and returning to execute the step of generating candidate directory nodes and candidate tag systems associated with the candidate directory nodes based on the directory snapshot and the candidate topic clusters based on the updated directory snapshot.
[0120] It should be noted that the sources of quality degradation are the specific quality dimensions that cause the current joint loss value to not decrease compared to the historical joint loss value, including reduced document coverage, reduced directory differentiation, reduced hierarchy rationality, reduced tag consistency, or reduced tag completeness.
[0121] Specifically, the historical joint loss value corresponding to the previous stable version is extracted from the directory snapshot, and the current joint loss value is compared with the historical joint loss value. If the current joint loss value is greater than or equal to the historical joint loss value, it indicates that the quality of the directory structure generated in this round has degraded compared to the previous stable version. Then, the changes in the five indicators of document coverage, directory distinguishability, hierarchical rationality, tag consistency, and tag completeness relative to the previous stable version are checked one by one to determine the specific indicator dimension that caused the degradation. Then, the directory generation constraints or tag generation constraints in the directory snapshot are adjusted according to the source of degradation. If the degradation is caused by directory structure-related issues, the merging or splitting tendency in the directory generation constraints is increased; if the degradation is caused by tag-related dimensions, the tag granularity or tag generation range in the tag generation constraints is adjusted. If the current joint loss value is less than the historical joint loss value but the stage directory tree has not yet met the preset stopping condition, it indicates that the quality of the current round's results has improved but has not yet stabilized. Then, the stage directory tree, candidate tag system, and current joint loss value of the current round are saved to the directory snapshot, replacing the original historical version, and then the process returns to step S30 to continue the next round of generation iteration.
[0122] In this embodiment, by identifying the source of quality degradation when the joint loss value has not decreased and adjusting the generation constraints accordingly, subsequent generation rounds can specifically correct degradation problems. By updating the catalog snapshot and continuing iteration when the joint loss value decreases but the stopping condition is not met, the process of continuous quality improvement can be gradually preserved and inherited. The above are merely feasible implementations of step S56 provided in this embodiment, and this embodiment does not specifically limit the specific implementation of step S56.
[0123] This embodiment provides a knowledge directory generation method for knowledge bases. Based on the staged directory tree, the method obtains directory depth, node load, and branch distribution; based on the directory depth, node load, and branch distribution, it obtains directory structure imbalance; based on the business themes of the candidate directory nodes and the corresponding candidate tag system, it obtains directory-tag consistency scores; based on the candidate directory nodes and the candidate tag system, it obtains document coverage, directory differentiation, hierarchical rationality, tag consistency, and tag completeness; based on the document coverage, directory differentiation, hierarchical rationality, tag consistency, and tag completeness, it obtains a comprehensive directory quality score; and by inputting the directory structure imbalance, directory-tag consistency score, and comprehensive directory quality score into a preset joint loss function, it obtains the current joint loss value. By quantifying the directory depth, node load, and branch distribution of the stage directory tree to obtain the directory structure imbalance, the structural rationality of the directory tree itself can be automatically evaluated, avoiding the problem of unreasonable classification paths caused by an excessively deep or shallow directory structure. By fusing the directory-tag consistency score and the comprehensive directory quality score obtained by integrating multi-dimensional indicators with the directory structure imbalance in the same joint loss function, the directory structure, the relationship between directories and tags, and the overall quality of the directory tag system are examined under the same evaluation framework. This avoids the overall incoordination caused by the independent optimization of the directory structure and tag system, thus enabling the directory structure and tag system to converge together under unified quality constraints in multiple iterations, improving the overall quality of the final directory structure.
[0124] For example, to help understand the implementation flow of the knowledge catalog generation method for knowledge bases obtained by combining this embodiment with the first embodiment described above, please refer to... Figure 6 , Figure 6 A simplified flowchart of a knowledge catalog generation method for knowledge bases is provided, specifically: After receiving the knowledge document from the document input layer, the system performs format parsing, text cleaning, semantic segmentation, vectorization, summary generation, and core concept extraction on the knowledge document to obtain its semantic representation. Based on this semantic representation, candidate topic clusters are constructed. In the directory-tag joint generation module, when the directory snapshot is not in an initialized state, the system extracts the historical directory tree, historical tag system, directory generation constraints, and tag generation constraints from the directory snapshot. Candidate directory nodes are generated based on the candidate topic clusters, the historical directory tree, the historical tag system, and the directory generation constraints. Representative documents and tags are obtained based on the candidate topic clusters. The concept of topic clusters is used to generate topic directory nodes based on the directory generation constraints, candidate topic clusters, representative documents, the concept of topic clusters, and the historical tag system. Candidate directory nodes are then determined based on the topic directory nodes and historical directory nodes in the historical directory tree. The directory level and document business content corresponding to the candidate directory nodes are then obtained. A candidate tag system associated with the candidate directory nodes is generated based on the tag generation constraints, the candidate directory nodes, the directory level, and the document business content. After determining the stage directory tree based on the candidate directory nodes and the candidate tag system, the process proceeds to the quality assessment and snapshot rollback module.
[0125] In the quality assessment and snapshot rollback module, directory depth, node load, and branch distribution are obtained based on the stage directory tree. Directory structure imbalance is obtained based on the directory depth, node load, and branch distribution. Directory-tag consistency score is obtained based on the business themes of the candidate directory nodes and the corresponding candidate tag system. Document coverage, directory differentiation, hierarchical rationality, tag consistency, and tag completeness are obtained based on the candidate directory nodes and the candidate tag system. A comprehensive directory quality score is obtained based on the document coverage, directory differentiation, hierarchical rationality, tag consistency, and tag completeness. The directory structure imbalance, directory-tag consistency score, and comprehensive directory quality score are input into a preset joint loss function to obtain the current joint loss value. Historical joint loss values are extracted from the directory snapshot and applied to the current joint loss function. When the current joint loss value is greater than or equal to the historical joint loss value, the source of quality degradation is determined based on the document coverage, the directory distinguishability, the hierarchical rationality, the tag consistency, and the tag completeness. The directory generation constraints and tag generation constraints in the directory snapshot are updated based on the source of quality degradation. When the current joint loss value is less than the historical joint loss value and the stage directory tree does not meet the preset stopping condition, the directory snapshot is updated based on the stage directory tree, the candidate tag system, and the current joint loss value. The step of generating candidate directory nodes and candidate tag systems based on the directory snapshot and the candidate topic clusters is returned to the updated directory snapshot. When the current joint loss value is less than the historical joint loss value in the directory snapshot and the stage directory tree meets the preset stopping condition, the stage directory tree is output as the initial directory tree to the manual review and feedback learning module.
[0126] In the manual review and feedback learning module, a preset feedback mapping matrix, feedback timeliness, and user review operations on the initial directory tree are obtained. The review operations include operation types and update objects. Operation types include confirming the directory, moving documents, adding tags, deleting tags, modifying tags, merging directories, splitting directories, and adjusting directory levels. Update objects include document-directory relationships, directory-tag relationships, and directory structure parameters. The review operations are converted into feedback mapping values based on the preset feedback mapping matrix. Feedback credibility is obtained based on the consistency of review operations among different users, historical high-confidence feedback operations of the update objects, and the user's permission roles. Parameter update amounts are obtained based on the feedback mapping values, feedback timeliness, and feedback credibility. The initial directory tree is updated based on the parameter update amounts to obtain a target directory tree, and the directory tree, tag system, document classification results, and pending review list are output from the result output layer. When new documents continuously enter the system, a feedback event table, new documents, and multiple target directory nodes of the target directory tree are obtained. Target node semantics are obtained based on the document semantics, tag semantics, and directory name semantics of each target directory node. Based on the new documents... Upon receiving the semantics of a newly added document, a semantic matching score is obtained based on the semantics of the newly added document and the semantics of the target node. Candidate classification scores for the newly added document and each of the target directory nodes are obtained based on the feedback event table. The directory stability of the target directory node and the historical adjustment records of the tag system corresponding to the target directory node are determined from the feedback event table. The newly added document is semantically matched with the documents under the target directory node to obtain a document semantic matching result. Based on the document semantic matching result, target historical documents are determined from the documents under the target directory node. Manual adjustment records of the target historical documents are determined from the feedback event table. A feedback correction score is obtained based on the directory stability, the historical adjustment records, and the manual adjustment records. A candidate classification score is obtained based on the semantic matching score and the feedback correction score. When the candidate classification score of the target directory node is greater than or equal to a preset classification score threshold and the target directory node meets a preset reliability condition, the target directory node is designated as a recommended directory node. The directory node to which the newly added document belongs is determined from each of the recommended directory nodes based on the candidate classification scores of each of the recommended directory nodes. Automatic classification is completed and written to the incremental monitoring window.When the candidate classification scores of all target directory nodes are lower than a preset classification score threshold, the newly added document is considered a low-scoring document. The proportion of low-scoring documents is calculated based on the number of newly added documents and the number of low-scoring documents within a preset incremental monitoring time window. When the proportion of low-scoring documents is greater than or equal to a preset proportion threshold, a partial reconstruction is triggered. The low-scoring documents are clustered to obtain low-scoring document topic clusters. Similarity matching is performed between the low-scoring document topic clusters and the target directory nodes to obtain the semantic similarity of each target directory node. When the number of low-scoring documents exceeds a preset trigger number threshold, the target directory nodes with semantic similarity greater than or equal to a preset similarity threshold are used to determine the directory subtree to be reconstructed based on the semantic diffusion radius. Local regeneration of directory nodes and tag systems is performed on the directory subtree to be reconstructed. A structure locking flag is set for stable directory subtrees in the target directory tree that are not included in the directory subtree to be reconstructed. The partial reconstruction result is output to the result output layer.
[0127] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the knowledge catalog generation method for knowledge bases in this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0128] This application also provides a knowledge catalog generation device for knowledge bases; please refer to [reference needed]. Figure 7 The knowledge catalog generation device for knowledge bases includes: Input module 10 is used to obtain directory snapshots and knowledge documents; Parsing module 20 is used to parse and semantically represent the knowledge document to obtain candidate topic clusters; The collaborative generation module 30 is used to generate candidate directory nodes and a candidate tag system associated with the candidate directory nodes based on the directory snapshot and the candidate topic clusters. The directory tree generation module 40 is used to determine the stage directory tree based on the candidate directory nodes and the candidate tag system; Loss module 50 is used to perform quality evaluation on the stage directory tree, the candidate directory node and the candidate label system according to a preset joint loss function, and obtain the current joint loss value; The judgment module 60 is used to take the stage directory tree as the initial directory tree when the current joint loss value is less than the historical joint loss value in the directory snapshot and the stage directory tree meets the preset stopping condition. The conversion module 70 is used to convert the user's review operation on the initial directory tree into parameter update quantities according to the preset feedback mapping matrix; The update module 80 is used to update the initial directory tree according to the parameter update amount to obtain the target directory tree.
[0129] The knowledge catalog generation apparatus for knowledge bases provided in this application employs the knowledge catalog generation method for knowledge bases in the above embodiments, and can solve the technical problem of how to improve the accuracy of knowledge catalog generation and updating. Compared with the prior art, the beneficial effects of the knowledge catalog generation apparatus for knowledge bases provided in this application are the same as those of the knowledge catalog generation method for knowledge bases provided in the above embodiments, and other technical features in the knowledge catalog generation apparatus for knowledge bases are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0130] The collaborative generation module 30 is also used to extract the historical directory tree, historical tag system, directory generation constraints and tag generation constraints from the directory snapshot when the directory snapshot is not in the initialization state. Candidate directory nodes are generated based on the candidate topic clusters, the historical directory tree, the historical tag system, and the directory generation constraints; Obtain the directory level and document business content corresponding to the candidate directory node; Based on the tag generation constraints, the candidate directory nodes, the directory hierarchy, and the document business content, a candidate tag system associated with the candidate directory nodes is generated.
[0131] The collaborative generation module 30 is further configured to obtain representative documents and topic cluster concepts based on the candidate topic clusters; Based on the directory generation constraints, the candidate topic clusters, the representative documents, the topic cluster concepts, and the historical tag system, generate topic directory nodes; Candidate directory nodes are determined based on the topic directory nodes and the historical directory nodes in the historical directory tree.
[0132] The loss module 50 is also used to obtain the directory depth, node load and branch distribution based on the stage directory tree; The directory structure imbalance is obtained based on the directory depth, the node load, and the branch distribution. Based on the business theme of the candidate directory node and the candidate tag system corresponding to the candidate directory node, the directory-tag consistency score is obtained; Based on the candidate directory nodes and the candidate tag system, document coverage, directory differentiation, hierarchical rationality, tag consistency, and tag completeness are obtained. The overall quality score of the directory is obtained based on the document coverage, directory differentiation, hierarchical rationality, tag consistency, and tag completeness. The directory structure imbalance, the directory-tag consistency score, and the directory overall quality score are input into a preset joint loss function to obtain the current joint loss value.
[0133] The loss module 50 is also used to extract historical joint loss values from the directory snapshot; When the current joint loss value is greater than or equal to the historical joint loss value, the source of quality degradation is determined based on the document coverage, the directory distinguishability, the hierarchical rationality, the tag consistency, and the tag completeness, and the directory generation constraints and the tag generation constraints in the directory snapshot are updated based on the source of quality degradation. When the current joint loss value is less than the historical joint loss value and the stage directory tree does not meet the preset stopping condition, the directory snapshot is updated based on the stage directory tree, the candidate label system, and the current joint loss value; The updated directory snapshot is used to return to the step of generating candidate directory nodes and a candidate tag system associated with the candidate directory nodes based on the directory snapshot and the candidate topic clusters.
[0134] The conversion module 70 is also used to obtain a preset feedback mapping matrix, feedback timeliness, and user review operation on the initial directory tree, wherein the review operation includes operation type and update object; The audit operation is converted into a feedback mapping value according to the preset feedback mapping matrix; The feedback credibility is obtained based on the consistency of the review operations of different users, the historical high-confidence feedback operations of the updated object, and the user's permission role; Based on the feedback mapping value, the feedback timeliness, and the feedback reliability, the parameter update amount is obtained.
[0135] The update module 80 is also used to obtain the feedback event table, the newly added document, and multiple target directory nodes of the target directory tree; The semantics of the target node are obtained based on the document semantics, tag semantics, and directory name semantics of the target directory node; Based on the newly added document, the semantics of the newly added document are obtained; Based on the semantics of the newly added document and the semantics of the target node, a semantic matching score is obtained; Based on the feedback event table, the candidate classification scores of the newly added document and each of the target directory nodes are obtained; When the candidate classification score of the target directory node is greater than or equal to the preset classification score threshold and the target directory node meets the preset reliability conditions, the target directory node is used as the recommended directory node. Based on the candidate classification scores of each of the recommended directory nodes, the directory node to which the newly added document belongs is determined from each of the recommended directory nodes.
[0136] The update module 80 is also used to determine the directory stability of the target directory node and the historical adjustment records of the tag system corresponding to the target directory node from the feedback event table; The newly added document is semantically matched with the documents under the target directory node to obtain the document semantic matching result; Based on the document semantic matching results, the target historical documents are determined from the documents under the target directory node; The manual adjustment records of the target historical document are determined from the feedback event table; Based on the directory stability, the historical adjustment records, and the manual adjustment records, a feedback correction score is obtained; The candidate classification score is obtained based on the semantic matching score and the feedback correction score.
[0137] The update module 80 is further configured to classify the newly added document as a low-scoring document when the candidate classification scores of each of the target directory nodes are all lower than the preset classification score threshold. The percentage of low-scoring documents is obtained based on the number of newly added documents and the number of low-scoring documents within the preset incremental monitoring time window; When the proportion of low-scoring documents is greater than or equal to a preset proportion threshold, the low-scoring documents are clustered to obtain low-scoring document topic clusters; The low-scoring document topic clusters and the target directory nodes are matched for similarity to obtain the semantic similarity of each target directory node; When the number of low-scoring documents exceeds a preset trigger threshold, the directory subtree to be reconstructed is determined based on the target directory nodes whose semantic similarity is greater than or equal to the preset similarity threshold. The target directory tree is reconstructed based on the subtree to be reconstructed and the low-scoring document topic clusters.
[0138] This application provides a knowledge catalog generation device for a knowledge base, comprising: 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, the instructions being executed by the at least one processor to enable the at least one processor to execute the knowledge catalog generation method for a knowledge base as described in Embodiment 1 above.
[0139] The following is for reference. Figure 8This document illustrates a structural diagram of a knowledge catalog generation device suitable for implementing embodiments of this application. The knowledge catalog generation device in this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), tablets, PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 8 The knowledge catalog generation device for knowledge bases shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0140] like Figure 8 As shown, a knowledge catalog generation device for a knowledge base 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 based on a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the knowledge catalog generation device for a knowledge base. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the knowledge catalog generation device for a knowledge base to communicate wirelessly or wiredly with other devices to exchange data. Although a knowledge catalog generation device for a knowledge base with various systems is shown in the figure, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.
[0141] 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 ROM 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.
[0142] The knowledge catalog generation device for knowledge bases provided in this application, employing the knowledge catalog generation method for knowledge bases in the above embodiments, can solve the technical problem of how to improve the accuracy of knowledge catalog generation and updating. Compared with the prior art, the beneficial effects of the knowledge catalog generation device for knowledge bases provided in this application are the same as those of the knowledge catalog generation method for knowledge bases provided in the above embodiments, and other technical features in this knowledge catalog generation device for knowledge bases are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.
[0143] 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.
[0144] 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.
[0145] 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 knowledge catalog generation method for a knowledge base in the above embodiments.
[0146] 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, 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, 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.
[0147] The aforementioned computer-readable storage medium may be included in a knowledge catalog generation device for a knowledge base; or it may exist independently and not be assembled into a knowledge catalog generation device for a knowledge base.
[0148] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by a knowledge catalog generation device oriented towards a knowledge base, the knowledge catalog generation device causes the following: it acquires a catalog snapshot and knowledge documents; it parses and semantically represents the knowledge documents to obtain candidate topic clusters; it generates candidate catalog nodes and a candidate tag system associated with the candidate catalog nodes based on the catalog snapshot and the candidate topic clusters; it determines a stage catalog tree based on the candidate catalog nodes and the candidate tag system; it performs a quality evaluation on the stage catalog tree, the candidate catalog nodes, and the candidate tag system based on a preset joint loss function to obtain a current joint loss value; when the current joint loss value is less than the historical joint loss value in the catalog snapshot and the stage catalog tree meets a preset stopping condition, it uses the stage catalog tree as an initial catalog tree; it converts the user's review operation on the initial catalog tree into parameter update amounts based on a preset feedback mapping matrix; and it updates the initial catalog tree based on the parameter update amounts to obtain a target catalog tree.
[0149] 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).
[0150] 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.
[0151] 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.
[0152] 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 knowledge catalog generation method for a knowledge base, thereby solving the technical problem of how to improve the accuracy of knowledge catalog generation and updating. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the knowledge catalog generation method for a knowledge base provided in the above embodiments, and will not be repeated here.
[0153] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the knowledge catalog generation method for a knowledge base as described above.
[0154] The computer program product provided in this application can solve the technical problem of how to improve the accuracy of knowledge catalog generation and updating. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the knowledge catalog generation method for knowledge bases provided in the above embodiments, and will not be repeated here.
[0155] 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 method for generating a knowledge catalog for a knowledge base, characterized in that, The method includes: Get a snapshot of the catalog and knowledge documents; The knowledge documents are parsed and semantically represented to obtain candidate topic clusters; Based on the directory snapshot and the candidate topic clusters, candidate directory nodes and a candidate tag system associated with the candidate directory nodes are generated; Based on the candidate directory nodes and the candidate tag system, determine the stage directory tree; The quality of the stage directory tree, the candidate directory nodes, and the candidate label system is evaluated according to a preset joint loss function to obtain the current joint loss value. When the current joint loss value is less than the historical joint loss value in the directory snapshot and the stage directory tree meets the preset stopping condition, the stage directory tree is used as the initial directory tree; The user's review operation on the initial directory tree is converted into parameter update quantity according to the preset feedback mapping matrix; The initial directory tree is updated according to the parameter update amount to obtain the target directory tree.
2. The method as described in claim 1, characterized in that, The step of generating candidate directory nodes and a candidate tag system associated with the candidate directory nodes based on the candidate topic clusters includes: When the directory snapshot is not in the initialization state, extract the historical directory tree, historical tag system, directory generation constraints, and tag generation constraints from the directory snapshot; Candidate directory nodes are generated based on the candidate topic clusters, the historical directory tree, the historical tag system, and the directory generation constraints; Obtain the directory level and document business content corresponding to the candidate directory node; Based on the tag generation constraints, the candidate directory nodes, the directory hierarchy, and the document business content, a candidate tag system associated with the candidate directory nodes is generated.
3. The method as described in claim 2, characterized in that, The step of generating candidate directory nodes based on the candidate topic clusters, the historical directory tree, the historical tag system, and the directory generation constraints includes: Based on the candidate topic clusters, representative documents and topic cluster concepts are obtained; Based on the directory generation constraints, the candidate topic clusters, the representative documents, the topic cluster concepts, and the historical tag system, generate topic directory nodes; Candidate directory nodes are determined based on the topic directory nodes and the historical directory nodes in the historical directory tree.
4. The method as described in claim 1, characterized in that, The step of evaluating the quality of the stage directory tree, the candidate directory nodes, and the candidate label system according to a preset joint loss function to obtain the current joint loss value includes: Based on the stage directory tree, the directory depth, node load, and branch distribution are obtained; The directory structure imbalance is obtained based on the directory depth, the node load, and the branch distribution. Based on the business theme of the candidate directory node and the candidate tag system corresponding to the candidate directory node, the directory-tag consistency score is obtained; Based on the candidate directory nodes and the candidate tag system, document coverage, directory differentiation, hierarchical rationality, tag consistency, and tag completeness are obtained. The overall quality score of the directory is obtained based on the document coverage, directory differentiation, hierarchical rationality, tag consistency, and tag completeness. The directory structure imbalance, the directory-tag consistency score, and the directory overall quality score are input into a preset joint loss function to obtain the current joint loss value.
5. The method as described in claim 4, characterized in that, After evaluating the quality of the stage directory tree, the candidate directory nodes, and the candidate label system according to a preset joint loss function to obtain the current joint loss value, the method further includes: Extract historical joint loss values from the catalog snapshot; When the current joint loss value is greater than or equal to the historical joint loss value, the source of quality degradation is determined based on the document coverage, the directory distinguishability, the hierarchical rationality, the tag consistency, and the tag completeness, and the directory generation constraints and the tag generation constraints in the directory snapshot are updated based on the source of quality degradation. When the current joint loss value is less than the historical joint loss value and the stage directory tree does not meet the preset stopping condition, the directory snapshot is updated based on the stage directory tree, the candidate label system, and the current joint loss value; The updated directory snapshot is used to return to the step of generating candidate directory nodes and a candidate tag system associated with the candidate directory nodes based on the directory snapshot and the candidate topic clusters.
6. The method as described in claim 1, characterized in that, The step of converting the user's review operation on the initial directory tree into parameter update quantities according to the preset feedback mapping matrix includes: Obtain a preset feedback mapping matrix, feedback timeliness, and user review operations on the initial directory tree, wherein the review operations include operation type and update object; The audit operation is converted into a feedback mapping value according to the preset feedback mapping matrix; The feedback credibility is obtained based on the consistency of the review operations of different users, the historical high-confidence feedback operations of the updated object, and the user's permission role; Based on the feedback mapping value, the feedback timeliness, and the feedback reliability, the parameter update amount is obtained.
7. The method as described in claim 1, characterized in that, After updating the initial directory tree according to the parameter update amount to obtain the target directory tree, the process further includes: Retrieve the feedback event table, the newly added document, and multiple target directory nodes of the target directory tree; The semantics of the target node are obtained based on the document semantics, tag semantics, and directory name semantics of the target directory node; Based on the newly added document, the semantics of the newly added document are obtained; Based on the semantics of the newly added document and the semantics of the target node, a semantic matching score is obtained; Based on the feedback event table, the candidate classification scores of the newly added document and each of the target directory nodes are obtained; When the candidate classification score of the target directory node is greater than or equal to the preset classification score threshold and the target directory node meets the preset reliability conditions, the target directory node is used as the recommended directory node. Based on the candidate classification scores of each of the recommended directory nodes, the directory node to which the newly added document belongs is determined from each of the recommended directory nodes.
8. The method as described in claim 7, characterized in that, The step of obtaining the candidate classification scores of the newly added document and each of the target directory nodes based on the feedback event table includes: The directory stability of the target directory node and the historical adjustment records of the tag system corresponding to the target directory node are determined from the feedback event table. The newly added document is semantically matched with the documents under the target directory node to obtain the document semantic matching result; Based on the document semantic matching results, the target historical documents are determined from the documents under the target directory node; The manual adjustment records of the target historical document are determined from the feedback event table; Based on the directory stability, the historical adjustment records, and the manual adjustment records, a feedback correction score is obtained; The candidate classification score is obtained based on the semantic matching score and the feedback correction score.
9. The method as described in claim 7, characterized in that, After obtaining the candidate classification scores of the new document and each of the target directory nodes based on the feedback event table, the process further includes: When the candidate classification scores of each of the target directory nodes are lower than the preset classification score threshold, the newly added document will be regarded as a low-scoring document. The percentage of low-scoring documents is obtained based on the number of newly added documents and the number of low-scoring documents within the preset incremental monitoring time window; When the proportion of low-scoring documents is greater than or equal to a preset proportion threshold, the low-scoring documents are clustered to obtain low-scoring document topic clusters; The low-scoring document topic clusters and the target directory nodes are matched for similarity to obtain the semantic similarity of each target directory node; When the number of low-scoring documents exceeds a preset trigger threshold, the directory subtree to be reconstructed is determined based on the target directory nodes whose semantic similarity is greater than or equal to the preset similarity threshold. The target directory tree is reconstructed based on the subtree to be reconstructed and the low-scoring document topic clusters.
10. A knowledge catalog generation device for knowledge bases, characterized in that, The device includes: The input module is used to obtain directory snapshots and knowledge documents; The parsing module is used to parse and semantically represent the knowledge document to obtain candidate topic clusters; The collaborative generation module is used to generate candidate directory nodes and a candidate tag system associated with the candidate directory nodes based on the directory snapshot and the candidate topic clusters; The directory tree generation module is used to determine the stage directory tree based on the candidate directory nodes and the candidate tag system; The loss module is used to perform quality evaluation on the stage directory tree, the candidate directory nodes and the candidate label system according to a preset joint loss function, and obtain the current joint loss value. The judgment module is used to take the stage directory tree as the initial directory tree when the current joint loss value is less than the historical joint loss value in the directory snapshot and the stage directory tree meets the preset stopping condition; The conversion module is used to convert the user's review operation on the initial directory tree into parameter update quantities according to the preset feedback mapping matrix; The update module is used to update the initial directory tree according to the parameter update amount to obtain the target directory tree.
