Structured information processing method, equipment and device, storage medium and program product

By employing a hierarchical clustering mechanism combining target encoding and language models within the graph structure, cross-level category labels are generated, addressing the issue of insufficient accuracy in graph structure retrieval in existing technologies and improving the accuracy and adaptability of downstream tasks.

CN121959072APending Publication Date: 2026-05-01ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511891806.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing technologies have low accuracy in downstream tasks when retrieving graph reference information from graph structures, and hierarchical classification trees have insufficient adaptability and generalization ability.

Method used

A hierarchical clustering mechanism that coordinates structure and semantics is adopted. The nodes in the graph structure are encoded into feature vectors through the target encoding model, and two-level clustering operations are performed. A language model is used to generate cross-level category labels to construct hierarchical category labels to improve retrieval accuracy.

Benefits of technology

It improves the contextual consistency and knowledge controllability of text information retrieved from graph structures, thereby enhancing the accuracy of downstream tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121959072A_ABST
    Figure CN121959072A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a structured information processing method, equipment and device, a storage medium and a program product. A hierarchical clustering mechanism with coordinated structure and semantics is provided, a plurality of nodes in a graph structure are coded into a plurality of feature vectors through a target coding model, and the feature vectors comprise text semantic information and hierarchical structure information between the nodes to lay a foundation for subsequent clustering. According to the method, clustering is carried out on multiple feature vectors and clustering clusters by adopting two-layer clustering operation, and in the hierarchical clustering process, category labels of the clustering clusters are generated through a language model, and the category labels have cross-hierarchical semantic interpretability. The hierarchical category label is generated based on the category label of each cluster, the semantic abstract hierarchical structure from fine granularity to coarse granularity is constructed, the hierarchical structure of the hierarchical category label is clear, the semantic interpretability is high, the context consistency and knowledge controllability of the text information retrieved from the graph structure are improved, and the text information retrieval efficiency is improved. And the accuracy of downstream tasks is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Structured information processing methods, equipment, devices, storage media and program products Technical Field

[0001] This specification relates to the field of information processing technology, and in particular to a structured information processing method, device, apparatus, storage medium, and program product. Background Technology

[0002] A graph structure is a structure for organizing and managing information objects. It possesses both structural and semantic information, providing rich graph reference information for downstream tasks and improving their accuracy. For example, downstream tasks may include content generation tasks or classification tasks.

[0003] To facilitate the retrieval of graph reference information from the graph structure, a hierarchical taxonomy is used to construct the hierarchical classification tree corresponding to the graph structure. Specifically, multiple hierarchical relationship templates (such as "domain-method-task") are predefined. Node information that matches any template is searched in the graph structure and parsed into a local classification tree. By integrating multiple local classification trees, a hierarchical classification tree is obtained.

[0004] Hierarchical classification trees express the hierarchical relationships between nodes in a graph structure. They can be used to quickly and efficiently retrieve graph reference information from the graph structure and then be used to perform downstream tasks.

[0005] In practical applications, it has been found that when downstream tasks are executed based on the graph reference information retrieved in the above manner, the accuracy of the downstream tasks is low. Summary of the Invention

[0006] This specification provides a structured information processing method, device, apparatus, storage medium, and program product to improve the hierarchical structure and semantic consistency of the structured information corresponding to the generated graph structure, enhance the relevance of the graph reference information retrieved from the graph structure, and thereby improve the accuracy of downstream tasks.

[0007] This specification provides a structured information processing method, comprising: obtaining a graph structure pointing to a target task, the graph structure including multiple nodes and edges between at least some of the nodes, the edges representing the relationships between connected nodes, and multiple nodes corresponding to multiple text information; encoding the multiple text information according to the graph structure using a target encoding model to obtain multiple feature vectors; performing a first clustering operation on the multiple feature vectors to obtain multiple first-level clusters, and calling a language model to generate a first-level category label corresponding to any one of the first-level clusters; performing a second clustering operation on the multiple first-level clusters to obtain at least two second-level clusters, and calling a language model to generate a second-level category label corresponding to any one of the second-level clusters; and generating hierarchical category labels based on the first-level category labels and the second-level category labels for retrieving text information adapted to the target task from the graph structure.

[0008] This specification also provides a structured information processing device, including: an acquisition module, an encoding module, a clustering module, and a generation module; the acquisition module is used to acquire a graph structure pointing to a target task, the graph structure including multiple nodes and edges between at least some nodes, the edges representing the association between connected nodes, and multiple nodes corresponding to multiple text information; the encoding module is used to encode the multiple text information according to the graph structure by calling a target encoding model to obtain multiple feature vectors; the clustering module is used to perform a first clustering operation on the multiple feature vectors to obtain multiple first-level clusters; the generation module is used to call a language model to generate a first-level category label corresponding to any first-level cluster; the clustering module is used to perform a second clustering operation on the multiple first-level clusters to obtain at least two second-level clusters; the generation module is used to call a language model to generate a second-level category label corresponding to any second-level cluster; the generation module is used to generate hierarchical category labels based on the first-level category labels and the second-level category labels, for retrieving text information adapted to the target task from the graph structure.

[0009] This specification also provides an electronic device, including: a memory and a processor; the memory is used to store one or more computer instructions; the processor is used to execute one or more computer instructions to perform the steps in the method provided in this specification.

[0010] This specification also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps of the method provided in this specification.

[0011] This specification also provides a computer program product, including: a computer program / instructions, which, when executed by a processor, can implement the steps of the method provided in this specification.

[0012] This specification provides a hierarchical clustering mechanism that coordinates structure and semantics. A target encoding model encodes multiple nodes in a graph structure into multiple feature vectors. These feature vectors include textual semantic information and hierarchical structural information between nodes, laying the foundation for subsequent clustering. A two-layer clustering operation is employed, clustering multiple feature vectors and clusters separately. During hierarchical clustering, a language model generates category labels for each cluster, which possess cross-level semantic interpretability. Based on the category labels of each cluster, hierarchical category labels are generated, constructing a semantic abstraction hierarchy from fine-grained to coarse-grained. Because of the clear hierarchical structure and strong semantic interpretability of these hierarchical category labels, the contextual consistency and knowledge controllability of the textual information retrieved from the graph structure can be improved, thereby enhancing the accuracy of downstream tasks. Attached Figure Description

[0013] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and their descriptions, serving to explain this specification and not constituting an undue limitation thereof. In the drawings: Figure 1 is a schematic flowchart of a structured information generation method provided in an exemplary embodiment of this specification.

[0014] Figure 2 is a flowchart illustrating a structured information generation method provided in another embodiment of this specification.

[0015] Figure 3 is a schematic diagram of the structure of a structured information generation apparatus provided in an exemplary embodiment of this specification.

[0016] Figure 4 is a schematic diagram of the structure of an electronic device provided in an exemplary embodiment of this specification. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.

[0018] It should be noted that, in the cases involving user information in this application's embodiments, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse. The various models involved in this application (including but not limited to language models or large models) comply with relevant laws and standards.

[0019] In order to facilitate the retrieval of graph reference information from the graph structure, a hierarchical classification method is used to construct the hierarchical classification tree corresponding to the graph structure. Specifically, multiple hierarchical relationship templates (such as "domain-method-task") are predefined. Node information that matches any template is searched in the graph structure and parsed into a local classification tree. By integrating multiple local classification trees, a hierarchical classification tree is obtained.

[0020] The generation method of the above-mentioned hierarchical classification tree relies on template matching. When the template matching is inaccurate or the template cannot cover complex scenarios, the method has poor adaptability and is difficult to generalize. The accuracy of downstream tasks based on this hierarchical classification tree is low.

[0021] To address the aforementioned technical problems, some embodiments of this specification provide a hierarchical clustering mechanism that coordinates structure and semantics. This mechanism encodes multiple nodes in a graph structure into multiple feature vectors using a target encoding model. These feature vectors include textual semantic information and hierarchical structural information between nodes, laying the foundation for subsequent clustering. A two-layer clustering operation is employed, clustering multiple feature vectors and clusters separately. During hierarchical clustering, a language model generates category labels for each cluster, which possess cross-level semantic interpretability. Based on the category labels of each cluster, hierarchical category labels are generated, constructing a semantic abstraction hierarchy from fine-grained to coarse-grained. Because this hierarchical category label structure is distinct and semantically interpretable, it improves the contextual consistency and knowledge controllability of textual information retrieved from the graph structure, thereby enhancing the accuracy of downstream tasks.

[0022] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0023] Figure 1 is a flowchart illustrating a structured information processing method provided in an exemplary embodiment of this specification. As shown in Figure 1, the method includes: 101. Obtaining a graph structure pointing to a target task. The graph structure includes multiple nodes and edges between at least some of the nodes. The edges represent the relationships between connected nodes, and the multiple nodes correspond to multiple text information.

[0024] 102. Based on the graph structure, call the target encoding model to encode multiple text information to obtain multiple feature vectors.

[0025] 103. Perform the first clustering operation on multiple feature vectors to obtain multiple first-level clusters, and call the language model to generate the first-level category label corresponding to any first-level cluster.

[0026] 104. Perform a second clustering operation on multiple first-level clusters to obtain at least two second-level clusters, and call the language model to generate the second-level category label corresponding to any second-level cluster.

[0027] 105. Based on the first-level category label and the second-level category label, generate hierarchical category labels for retrieving text information that is compatible with the target task from the graph structure.

[0028] In the embodiments of this specification, the executing entity of the structured information processing method can be a structured information processing device. This device can run on a terminal device, a server device, or a combination of both; there is no limitation on this. For example, the component in the structured information processing device used to execute steps 101 to 104 runs on the terminal device. As another example, the component in the structured information processing device used to execute steps 101 and 102 runs on the terminal device, the terminal device provides multiple feature vectors to the server device, steps 103 to 104 are executed on the server device, and the server device provides the generated structured information (e.g., hierarchical category labels) to the terminal device.

[0029] In the embodiments of this specification, a graph structure, as a type of structured information, is used to describe the structure and semantic information of text information. The graph structure includes multiple nodes and edges. Multiple nodes correspond to multiple pieces of text information, and edges represent the semantic relationships between connected nodes, reflecting the structure of the text information. These semantic relationships may include, but are not limited to, structural relationships, temporal relationships, spatial relationships, functional relationships, and similarity relationships. Structural relationships represent connections at the organizational structure level, temporal relationships represent connections at the time flow level, spatial relationships represent connections at the geographical location level, functional relationships represent connections at the role dependency level, and similarity relationships represent connections at the feature matching level, etc. For example, the graph structure can be implemented as a text-attributed graph (TAG).

[0030] Hierarchical category labels can express the hierarchical relationships between nodes in a graph structure. They enable quick and efficient retrieval of textual information relevant to the target task from the graph structure, thus aiding in task execution. Hierarchical category labels include multi-level information, with the top level representing a more abstract category, and lower levels offering increasingly detailed categories, reflecting a semantic hierarchy from coarse to fine. For example, hierarchical category labels can be implemented as a hierarchical taxonomy tree.

[0031] Hierarchical category labels can be applied in the field of graph retrieval-augmented generation (Graph RAG). In graph retrieval-augmented generation, content generation tasks (such as question answering, summarizing, or recommending) or classification tasks provide graph reference information (such as external semantic context) by retrieving graph structures (such as neighbor nodes, hierarchical concepts, etc. in text attribute graphs), thereby improving the accuracy, context relevance, and knowledge consistency of generated content or classification results.

[0032] Depending on the target task, the graph structure and hierarchical category labels will differ, as will the graph reference information. An example is provided below.

[0033] For example, in academic question-answering and paper recommendation scenarios, the target task can be an academic question-answering task or an academic knowledge recommendation task. The graph structure corresponding to the target task can be an academic knowledge graph, where nodes represent academic topics, such as disciplines, subfields, and specific concepts, and edges represent hierarchical relationships between topics. The hierarchical category labels corresponding to the graph structure can be an academic topic hierarchy tree, such as: discipline → subfield → specific topic, etc. The graph reference information can be papers and their metadata retrieved from the academic knowledge graph based on the academic topic hierarchy tree, such as metadata including title, abstract, author, and citation count. When performing this target task, the graph reference information provides users with question-answering or recommendation services.

[0034] For example, in an e-commerce scenario, the target task could be a product recommendation service or a product search service. The corresponding graph structure for the target task could be a product knowledge graph, which includes product entities and relationships. Product entities include products, attributes, brands, and user reviews, while relationships include belonging, similarity, or purchase association. Hierarchical category tags could be a product category tree, such as main category → subcategory → specific product type. Graph reference information could be product attributes and related information retrieved from the product knowledge graph using the product category tree. Based on this graph reference information, personalized product recommendations are generated for users, assisting in product search and achieving the target task.

[0035] For example, in a financial scenario, the target task could be a financial question-and-answer service. The graph structure corresponding to the target task could be a financial rule knowledge graph. Nodes in the graph could include, but are not limited to, rule clauses, chapters, or concepts, and edges could include, but are not limited to, logical order, referencing relationships, or hierarchical relationships. The hierarchical category labels corresponding to the graph structure could be a rule hierarchy tree, and the graph reference information could be rule information retrieved from the financial rule knowledge graph based on the rule hierarchy tree. For example, according to clause X, a financial institution can submit a service report. Thus, based on the graph reference information, the corresponding financial question-and-answer result service is generated.

[0036] For example, in a medical context, the target task could be a medical question-and-answer service or a medical classification service. The graph structure corresponding to the target task could be a medical knowledge graph, where nodes represent diseases, symptoms, causes, treatments, etc., and edges represent relationships, such as "caused by..." or "treatment". Hierarchical category labels could be a medical knowledge hierarchy tree, such as disease classification → etiology type → specific pathology. Graph reference information could be medical knowledge retrieved from the medical knowledge graph based on the medical knowledge hierarchy tree. For example, when generating a "diabetes" treatment plan, based on the medical knowledge hierarchy tree, the relevant edges of the "diabetes" node in the medical knowledge graph are traversed to extract information such as "cause: insulin resistance" and "treatment: oral hypoglycemic drugs" as graph parameter information.

[0037] In the embodiments of this specification, the structured information processing device encodes the multiple text information items using a target encoding model based on the graph structure to obtain multiple feature vectors. For example, encoding the graph structure with the goal of narrowing the distance between semantically similar nodes and widening the distance between semantically dissimilar nodes can enhance intra-cluster compactness and expand inter-class separability during subsequent clustering, thus improving the quality of structured information. Specifically, the structured information processing device calls the target encoding model based on the graph structure, using the goal of having a greater semantic similarity between nodes with relationships than between nodes without relationships, to encode multiple text information items to obtain multiple feature vectors. Nodes with relationships can be understood as having an edge between them. Nodes without relationships can be understood as having no edge between them. The semantic similarity between nodes can be measured by the cosine similarity, dot product similarity, or Euclidean distance between the corresponding feature vectors of the nodes. For example, a larger dot product similarity between the corresponding feature vectors of two nodes indicates a higher semantic similarity between the two nodes, and a smaller dot product similarity indicates a lower semantic similarity between the two nodes. For example, the smaller the Euclidean distance between the corresponding feature vectors of two nodes, the higher the semantic similarity between the two nodes; the larger the Euclidean distance between the corresponding feature vectors of two nodes, the lower the semantic similarity between the two nodes.

[0038] The embodiments in this specification do not limit the number of model parameters supported by the target encoding model, with the goal of meeting actual needs. For example, the target encoding model can be a deep learning model with relatively few parameters or a deep learning model with a relatively large number of parameters. In terms of model implementation, the target encoding model can include, but is not limited to: pre-trained language model (PLM), graph neural network (GNN), encoder-only architecture, decoder-only architecture, encoder-decoder architecture, self-attention-based architecture, etc.

[0039] In one alternative embodiment, the target encoding model can be implemented as a large language model, which includes an encoder, a decoder, a self-attention layer, and a feed-forward neural network. The encoder is used to understand the semantics of the input text. The decoder is used to generate the output text. The self-attention layer allows words at each position to pay attention to words at other positions in the sentence, thereby better capturing contextual information. The feed-forward neural network performs a non-linear transformation on the representation at each position. In another alternative embodiment, the target encoding model can be implemented using a decoder-only architecture, mainly including a decoder structure; in this architecture, the generation of the text to be filled can be completed through two stages: pre-filling and decoding. Regardless of the model architecture used, when text needs to be generated, the language model can generate the next most likely word from left to right, character by character, based on a given prompt. Different sampling strategies can be applied in this process, such as greedy search, beam search, or temperature-adjusted sampling, to control the diversity of the generated text.

[0040] In the embodiments of this specification, during the clustering process, nodes with high semantic similarity can be merged into the same cluster. The feature vectors obtained by the above encoding encode the nodes in the graph structure into a representation space that includes textual semantics and structural information. In this representation space, nodes with similar semantics have higher semantic similarity in their corresponding feature vectors, while nodes with dissimilar semantics have lower semantic similarity in their corresponding feature vectors. This means that nodes with high semantic similarity in this representation space are close to each other, while nodes with low semantic similarity are far apart from each other.

[0041] Therefore, a first clustering operation is performed on the multiple feature vectors to obtain multiple first-level clusters, and a language model is invoked to generate a first-level category label corresponding to any one of the first-level clusters. A second clustering operation is then performed on the multiple first-level clusters to obtain at least two second-level clusters, and the language model is invoked to generate a second-level category label corresponding to any one of the second-level clusters. For ease of distinction and description, the operation of clustering multiple feature vectors is referred to as the first clustering operation, and the operation of clustering clusters is referred to as the second clustering operation. In other words, the first clustering operation is used to cluster nodes in the graph structure, and the second clustering operation is used to cluster first-level clusters into second-level clusters. The second clustering operation can be performed multiple times, forming a multi-level clustering structure, constituting a tree-like hierarchy. For example, performing the second clustering operation on second-level clusters yields third-level clusters, performing the second clustering operation on third-level clusters yields fourth-level clusters, and so on upwards until N-level clusters are obtained, where N is a positive integer and N≥2.

[0042] The clustering algorithm used to perform the first clustering operation can include, but is not limited to, K-means clustering, density-based clustering (DBSCAN), and clustering based on the Gaussian Mixture Model. The same or different algorithms can be used to perform the second clustering operation.

[0043] The embodiments in this specification do not limit the number of model parameters supported by the language model used, with the goal of meeting actual needs. For example, the language model can be a deep learning model with relatively few parameter rules, or it can be a deep learning model with a relatively large number of model parameters. For an introduction to the implementation of the language model, please refer to the foregoing introduction to the target encoding model, which will not be repeated here. Optionally, the language model can also be implemented as an LLM.

[0044] Specifically, for any first-level cluster, the language model is invoked to generate the corresponding first-level category label for that first-level cluster. For any second-level cluster, the language model is invoked to generate the corresponding second-level category label for that second-level cluster.

[0045] In this context, the category label represents the category information of the cluster. For example, if a cluster includes nodes such as apple, pear, banana, peach, and apricot, then the category label for that cluster could be "fruit". The higher the level of the cluster, the more abstract, generalized, and coarser the category label. For ease of distinction and description, the category label corresponding to a first-level cluster is called the first-level category label, and the category label corresponding to a second-level cluster is called the second-level category label.

[0046] The number of first-level clusters is not limited; it depends on the number of nodes in the specific view structure. The more nodes, the more first-level clusters. For example, the number of first-level clusters can be 256, 1024, or 2048. As the level increases, the number of clusters decreases accordingly. The number of N-level clusters can be 4, 8, or 16, etc.

[0047] Optionally, in addition to generating first-level category labels for any first-level cluster, the language model can also generate summary information for each first-level cluster. This summary information is a brief semantic description. Category labels and summary information help enhance the interpretability of structured information.

[0048] For example, when the language model is implemented as a large language model, the language model corresponds to a first prompt word template. Based on this first prompt word template and the text information corresponding to the nodes in the first-level cluster, a first prompt word is generated. Based on this first prompt word, the language model is called, guiding it to generate the category label and summary information corresponding to the first-level cluster based on the text information corresponding to the nodes in the first-level cluster. The first prompt word is as follows: The following is a set of texts with highly related semantic content. Please generate a concise category label based on their common theme and provide a brief semantic description summary.

[0049] The text is as follows: 1. [Text 1] 2. [Text 2] ... N. [Text N] Please output: - Category label (no more than 10 characters) - Summary description (within 50 characters).

[0050] In the embodiments of this specification, the structured information processing device can generate hierarchical category labels based on the first-level category labels of multiple first-level clusters and the second-level category labels of at least two second-level clusters. Specifically, when performing multiple second-level clustering operations, hierarchical category labels are generated based on the category labels of the first-level clusters, the category labels of the second-level clusters, ..., the category labels of the Nth-level clusters. These hierarchical category labels are used to retrieve text information suitable for the target task from the graph structure. From the bottom layer to the top layer, these hierarchical category labels better reflect the semantic hierarchy of the graph structure, from concrete to abstract and from subdivided to generalized.

[0051] For example, taking a hierarchical classification tree with hierarchical category labels as an example, the first-level clusters are used as leaf nodes of the hierarchical classification tree. Upper-level clusters are constructed sequentially, and connections are established between each cluster and the cluster above it, forming a hierarchical relationship between clusters. Based on the hierarchical relationship between clusters and the category labels of the clusters, a hierarchical classification tree is generated, represented as follows: . in, Represents a hierarchical classification tree. Represents a cluster, Indicates hierarchical relationships.

[0052] .

[0053] in, Indicates the cluster center. Represents clusters Nodes in Corresponding feature vector The cluster center can be a sample node in the cluster, or it can be the mean of the feature vectors corresponding to the nodes in the cluster.

[0054] For example, as shown in Figure 2, an example is illustrated using a graph structure to implement a text attribute graph, a target encoding model to implement a GNN, a language model to implement an LLM, and hierarchical category labels to implement a hierarchical classification tree. In Figure 2, the text attribute graph is a knowledge graph in the field of natural language processing, and the hierarchical category labels are the hierarchical classification tree of this knowledge graph. The root node of the classification tree is Computer Science, and the root node includes Computational Linguistics (CL) nodes and Information Retrieval (IR) nodes. The CL nodes include Natural Language Understanding (NLU) nodes, and the IR nodes include Neural Information Retrieval (NIR) and Recommendation System (RS).

[0055] This illustrated tree embodiment provides a hierarchical clustering mechanism that coordinates structure and semantics. A target encoding model encodes multiple nodes in the graph structure into multiple feature vectors. These feature vectors include textual semantic information and hierarchical structural information between nodes, laying the foundation for subsequent clustering. A two-layer clustering operation is employed, clustering multiple feature vectors and clusters separately. During hierarchical clustering, a language model generates category labels for each cluster, which possess cross-level semantic interpretability. Based on the category labels of each cluster, hierarchical category labels are generated, constructing a semantic abstraction hierarchy from fine-grained to coarse-grained. Due to the clear hierarchical structure and strong semantic interpretability of these hierarchical category labels, the contextual consistency and knowledge controllability of the textual information retrieved from the graph structure can be improved, thereby enhancing the accuracy of downstream tasks.

[0056] In one alternative embodiment, the training method of the target encoding model is not limited. In some implementations, each node in the graph structure is directly converted into a feature vector through a pre-trained model, and clusters are formed based on these feature vectors. For example, the pre-trained model can be implemented as a pre-trained language model. Since the above pre-trained model only considers textual information and does not consider the structural information between nodes, that is, the semantic correlation between textual information, the encoded feature vectors cannot form a spatial structure that is "cluster-friendly" or "has a clear sense of hierarchy".

[0057] Considering that contrastive learning can enhance clustering results, in this embodiment, guided contrastive learning is used to construct a semantically structured representation space, making similar semantic nodes closer together and dissimilar nodes (of different categories) farther apart, laying the foundation for subsequent hierarchical clustering. The following provides a method for training an initial encoding model to obtain a target encoding model: Obtain a sample graph structure, which includes multiple sample nodes and edges between at least some of the sample nodes, where edges represent relationships between connected sample nodes, and multiple sample nodes correspond to multiple sample text information; invoke the initial encoding model to encode the multiple sample text information to obtain multiple sample feature vectors corresponding to the multiple sample nodes; with the semantic similarity between related sample nodes being greater than the semantic similarity between unrelated sample nodes as the optimization objective, construct a contrastive loss function based on the multiple sample feature vectors; iteratively train the initial encoding model based on the contrastive loss function to obtain the target encoding model.

[0058] There are multiple sample graph structures, each consisting of multiple sample nodes and edges between at least some of the sample nodes. For a detailed introduction to sample graph structures, please refer to the preceding section on graph structures; it will not be repeated here.

[0059] The core function of the initial encoding model is to convert the text information corresponding to the nodes in the graph structure into feature vectors. In the initial state, the initial encoding model does not yet have the encoding objective of "the semantic similarity between nodes with a relationship is greater than the semantic similarity between nodes without a relationship". In the embodiments of this specification, the initial encoding model is trained by contrastive learning so that the initial encoding model learns to encode according to the above encoding objective, so that the feature vector obtained by encoding the text information in the graph structure satisfies the above encoding objective, laying the foundation for subsequent hierarchical clustering.

[0060] The implementation method of iteratively training the initial encoding model based on the contrastive loss function to obtain the target encoding model is not limited. For example, the average of the contrastive losses for all nodes is calculated to obtain the total loss for one round of training. The gradient of the total loss with respect to all parameters of the initial encoding model is then calculated using the backpropagation algorithm. This gradient indicates the direction and magnitude in which each parameter should be adjusted to reduce the loss. Using an optimizer (such as Adam), the model parameters are then updated slightly based on the calculated gradient.

[0061] After multiple iterations, the parameters of the initial encoding model are adjusted to an ideal state, thus obtaining the target encoding model. The sample feature vectors generated by the target encoding model can achieve the optimization objective: the semantic similarity between sample nodes with a relationship is greater than the semantic similarity between sample nodes without a relationship. For example, in the feature space, nodes connected by edges can naturally cluster together, while nodes without edges can be far apart.

[0062] The contrastive learning-based training method described above incorporates not only the semantics of the text itself during encoding but also the relationships between nodes in the graph structure. This enables the generation of deeper, more accurate, and more reasoning-capable vector representations. In this process, the target encoding model learns to smooth and reason about semantics based on the graph structure. For downstream tasks, this means the target encoding model possesses preliminary relational reasoning capabilities. For example, predicting which nodes in the graph structure are not yet connected and what potential future relationships might arise. This could be used for recommending friends on social networks or recommending "users who bought this product also bought" in e-commerce. The target encoding model can discover potential, semantically highly similar connections, significantly improving the performance of various downstream machine learning tasks.

[0063] In one optional embodiment, during the encoding of nodes, in addition to considering the relationships between nodes, the initial category label of the node can also be considered. The initial category label represents the category information to which the text information corresponding to the node belongs. All sample nodes in the graph structure have initial category labels, or some sample nodes in the graph structure have initial category labels. Based on this, considering that the category labels and relationships of nodes may not be completely consistent, and some nodes with the same category label may be structurally far apart, in the process of constructing the contrastive loss function, only the structural information between nodes is considered, but also the category labels between nodes, i.e., content similarity. When one type of information is scarce or noisy, the other type of information can serve as a supplement, thereby improving the robustness of the model.

[0064] Based on this, an implementation method is proposed, which aims to optimize the semantic similarity between related sample nodes by being greater than that between unrelated sample nodes by constructing a contrastive loss function based on multiple sample feature vectors. The method includes: using the semantic similarity between sample nodes with the same initial category label as the first optimization objective, and the semantic similarity between related sample nodes as the second optimization objective, and constructing a contrastive loss function based on multiple sample feature vectors by constructing a contrastive loss function based on multiple sample feature vectors.

[0065] Among them, samples with the same initial category label indicate that the two nodes belong to the same class and their feature vectors in the semantic space can be close to each other (high similarity); samples with different initial category labels indicate that the two nodes belong to different classes and their feature vectors can be far apart (low similarity).

[0066] Specifically, if two nodes both have initial category labels and the initial category labels are the same, then the two nodes are determined to have the same initial category label. If two nodes both have initial category labels and the initial category labels are different, then the two nodes are determined to have different initial category labels. If one node has an initial category label and the other node does not have an initial category label, then the two nodes are considered to have different initial category labels.

[0067] The above method compares and learns from both the category attributes and structural information of the nodes, avoiding overfitting or bias caused by a single signal source. At the same time, the information in the two dimensions can complement each other, so that the feature vectors learned by the model can capture more essential and comprehensive semantic information in the data.

[0068] In one optional embodiment, to improve the generalization ability of the target encoding model and make it more robust, graph augmentation and dual-view encoding are employed to create different "views" of the same graph structure to learn node representations that are less affected by noise and have better generalization ability. The constructed feature vectors are more structure-aware, with tight intra-class structures, clear inter-class structures, and better clustering ability.

[0069] Based on this, an implementation method for encoding multiple sample text information by invoking an initial encoding model to obtain multiple sample feature vectors corresponding to multiple sample nodes includes: performing graph augmentation processing on the sample graph structure to obtain a first graph structure and a second graph structure, wherein the graph augmentation processing includes at least one of structural perturbation and feature perturbation; invoking the initial encoding model to encode the first graph structure and the second graph structure respectively to obtain multiple first feature vectors and multiple second feature vectors. Specifically, it can be to encode the sample nodes in the first graph structure and the second graph structure. Here, there is a correspondence between the sample nodes in the first graph structure and the sample nodes in the original graph structure, and there is also a correspondence between the sample nodes in the second graph structure and the sample nodes in the original graph structure.

[0070] Graph augmentation refers to applying controlled random disruptions to the structure of a sample graph, forcing the model to learn the robust, unaffected semantic information inherent within it. Graph augmentation includes structural perturbation and feature perturbation. Considering that the important semantic information in a graph structure does not depend on any specific edge but is inherent in the overall connection pattern, structural perturbation can be applied to the graph structure. Structural perturbation refers to modifying the topological connections (i.e., the set of edges) in the graph structure. Considering that the semantics of a node are determined by the overall distribution of its attributes, rather than a few specific feature dimensions, feature perturbation can be applied to the graph structure. Feature perturbation refers to modifying the content of the textual information of the nodes.

[0071] For example, sample graph structure , where each node Associate a text The edges in the diagram Indicates semantic adjacency. It is a collection of text information corresponding to nodes. The sample graph structure can be represented in matrix form; the sample graph structure can be... . Represents the adjacency matrix, which is composed of edge sets. The generation quantifies the "semantic adjacency" relationship between nodes. Represents a node and There are edges between them, which means there is a relationship between them. Represents the node feature matrix, based on the text set. Generation. The text information of each node sample can be generated based on a pre-trained language model (PLM). It is transformed into a numerical vector (i.e., embedding). each line Indicates the first The initial vector corresponding to each node. and All are positive integers.

[0072] Structural and feature perturbations are applied to the sample graph structure to obtain the first graph structure, denoted as follows: Here, structural and feature perturbations are applied to the sample graph structure to obtain the second graph structure, denoted as follows: Two different structural perturbations and characteristic perturbations are applied. For example, the structural perturbation could be... Some 1s in the string become 0s, generating and... There are some different adjacency matrices in the structure and For example, characteristic perturbations can be targeted at... Some feature values ​​in the image are set to 0 (i.e., masking), thus creating a noisy view at the feature level. and .

[0073] Based on the initial coding model, for and Encode them separately to obtain and . Including multiple first feature vectors corresponding to the structure of the first graph, This includes multiple second feature vectors corresponding to the structure of the first graph.

[0074] Optionally, with the first optimization objective being that the semantic similarity between sample nodes with the same initial category label is greater than the semantic similarity between sample nodes with different initial category labels, and the second optimization objective being that the semantic similarity between sample nodes with a relationship is greater than the semantic similarity between sample nodes without a relationship, the implementation method for constructing a contrastive loss function based on multiple sample feature vectors includes: for any two sample nodes respectively from the first graph structure and the second graph structure, if any two nodes have the same initial category label, or if any two sample nodes do not have an initial category label and there is an edge between any two sample nodes, then any two sample nodes are considered a positive sample pair; if any two sample nodes have different initial category labels, or if any two sample nodes do not have an initial category label and there is no edge between any two sample nodes, then any two sample nodes are considered a negative sample pair; with the semantic similarity of the positive sample pair being greater than the semantic similarity of the negative sample pair as the optimization objective, a contrastive loss function is constructed, where the semantic similarity of the sample pair represents the semantic similarity between the corresponding sample feature vectors of the sample nodes in the sample pair. The above method is a way to construct structure-sensitive embedding representations (feature vectors) based on contrastive learning and similarity guidance, which improves the quality of generated feature vectors and enhances controllability and relevance.

[0075] Here, a positive sample pair indicates that two sample nodes are positive samples of each other. For example, if sample nodes and sample nodes A pair of positive samples represents a sample node. It is a sample node Positive samples, sample nodes It is a sample node Positive samples.

[0076] Specifically, for any two sample nodes from the first graph structure and the second graph structure respectively, if any two nodes have the same initial class label, then the two sample nodes are considered a positive sample pair; if any two sample nodes do not have initial class labels and there is an edge between them, then the two sample nodes are considered a positive sample pair. If any two sample nodes have different initial class labels, then the two sample nodes are considered a negative sample pair; if any two sample nodes do not have initial class labels and there is no edge between them, then the two sample nodes are considered a negative sample pair.

[0077] With the optimization objective of having a greater semantic similarity to positive sample pairs than negative sample pairs, a contrastive loss function is constructed. The semantic similarity of a sample pair represents the semantic similarity between the corresponding sample feature vectors of the sample nodes in the sample pair. The implementation method is not limited.

[0078] For example, based on the positive and negative sample pairs mentioned above, a similarity matrix is ​​constructed, as illustrated in Figure 2. For instance, the similarity matrix is ​​represented as follows: .in, This represents the number of nodes in the sample graph structure, that is, the number of nodes in the first graph structure and the second graph structure. (Based on nodes...) ( (From the first graph structure, nodes) ( (Taking the structure from the second diagram as an example.) and If they have the same initial category label, then determine the similarity matrix. .like and It does not have an initial category label, and That is, in the sample graph structure and If there is an edge, then it is determined. .like and They have different initial category labels, or, and If no edge exists in the sample graph structure, then it is determined that... .

[0079] A contrastive loss function is constructed based on a similarity matrix, multiple first feature vectors, and multiple second feature vectors. This contrastive loss function aims to optimize pairs where the semantic similarity of positive sample pairs is greater than that of negative sample pairs. Represented as: .in, Indicating the structure of the first diagram The transpose of the corresponding first eigenvector, Indicating the structure of the second diagram The corresponding second eigenvector. Hyperparameter Control the separation strength of positive and negative sample pairs.

[0080] The above approach guides embedding learning from both semantic and structural perspectives. It adaptively constructs positive and negative sample pairs (similarity matrix) through edge information and semantic adjacency, which is universal for any graph structure. It also enables the node representation space to have strong clustering characteristics and reflects potential semantic similarity to a certain extent, which facilitates subsequent clustering to form semantically consistent groups.

[0081] In an optional embodiment, the internal structure of the target encoding model is not limited. An illustrative example is provided below. In this embodiment, the target encoding model may employ a Graph Convolutional Network (GCN) architecture, including: an input layer, at least one graph convolutional layer, a non-linear activation layer, and an output layer. The input layer is used to transform multiple nodes in the graph structure into initial feature vectors. Let the graph be denoted as... The number of nodes is The initial node feature matrix is The adjacency matrix is Graph convolutional layers are used to update node vector representations by aggregating information from neighboring nodes. The update formula for a single-layer GCN is: in: This represents the adjacency matrix after adding self-connections; It is a degree matrix; For the first Layer node representation; The weight matrix is ​​trainable. It is a non-linear activation function (such as ReLU). Initially... When passing by After convolution of the layered graph, the final node representation matrix is ​​obtained: For the The final feature vector of each node is denoted as: in It retains the node's own attribute information while incorporating its neighbor relationships and location patterns within the graph structure. The output vectors of multiple nodes can be formed as follows: This matrix represents the final output of the target encoding model and can be directly used for downstream tasks (such as node classification and graph embedding). Through this structure, the model can integrate local and multi-hop neighbor information in the node representation, achieving effective encoding of the graph structure.

[0082] The input layer transforms multiple nodes in the graph structure into multiple initial vectors. The graph convolutional layer updates the vector representation of the current node by aggregating information from neighboring nodes (e.g., those with associations or shared initial class labels). Each node in the graph convolutional layer receives information from its multi-hop neighbors (i.e., more distant neighbors), capturing both local and global patterns in the graph. Convolutional operations on the multiple initial vectors by the graph convolutional layer yield multiple feature vectors corresponding to the nodes. These feature vectors, encoded by the target encoding model, not only preserve the node's own attributes but also deeply integrate its position, semantics, role, and connection patterns with other nodes within the graph structure, providing a powerful representation for downstream tasks such as node classification or content production.

[0083] In one optional embodiment, the implementation of performing a first clustering operation on the plurality of feature vectors to obtain multiple first-level clusters, and calling a language model to generate a first-level category label corresponding to any one of the first-level clusters, is not limited. An example is given below: a first clustering operation is performed based on the semantic similarity between the plurality of feature vectors to obtain multiple first-level clusters; for any one first cluster, a language model is called to generate a first-level category label corresponding to that first-level cluster based on the text information corresponding to each node in that cluster.

[0084] The implementation method for performing the first clustering operation based on the semantic similarity between the multiple feature vectors to obtain multiple first-level clusters is not limited. For example, clustering algorithms can be used, and the clustering algorithms can be found in the aforementioned embodiments, which will not be repeated here. For example, K-means clustering can be used to cluster multiple feature vectors to obtain multiple first-level clusters. The K-means clustering method can be based on a preset number of first-level clusters. The number of first-level clusters can include 1024, 2048, or tens of thousands, and is not limited thereto.

[0085] Specifically, for any first cluster, a language model is invoked to generate a first-level category label corresponding to the first-level cluster based on the text information corresponding to each node in that first-level cluster. The language model generates lower-level, more detailed category labels based on the specific, original text documents within each first-level cluster. For example, the language model maintains a second prompt word template. Based on the second prompt word template and the text information corresponding to the nodes in the first-level cluster, a second prompt word is generated. Based on the second prompt word, the language model is invoked to generate the first-level category label corresponding to the first-level cluster based on the text information corresponding to the nodes in the first-level cluster.

[0086] For example, the second prompt could be: "The following is a set of texts with highly related content. Please generate a concise category label based on their common theme and provide a brief semantic description summary."

[0087] Text sample: 1. [Text 1] 2. [Text 2] ... N. [Text N] Please output: - Category label (e.g., no more than 10 characters) - Summary description (e.g., no more than 50 characters).

[0088] The language model's task is induction and abstraction. Based on the more specific labels already generated in the next layer (sub-cluster), it synthesizes a more generalized and abstract upper-level category label. This abstraction based on lower-level labels ensures the logical coherence of the classification system. The upper-level labels are naturally a summary of the lower-level labels, resulting in a semantically sound taxonomy, rather than a cold, distance-based merging.

[0089] Optionally, the language model is invoked to generate first-level category labels corresponding to the first-level clusters based on the text information corresponding to each node in any of the clusters. This includes: selecting multiple target nodes from any of the first-level clusters based on the semantic similarity between the nodes and the cluster centers; and invoking the language model to aggregate and abstract the text information of each of the multiple target nodes to generate first-level category labels corresponding to any of the first-level clusters. The category labels are highly interpretable and can be used for subsequent retrieval of graph reference information.

[0090] The implementation method of selecting multiple target nodes from any initial cluster based on the semantic similarity between nodes in any initial cluster and the cluster center is not limited. For example, for any initial cluster, the semantic similarity between nodes in that initial cluster and the cluster center is calculated, and a predetermined number of target nodes with high semantic similarity are selected, or target nodes with semantic similarity exceeding a predetermined similarity threshold are selected.

[0091] The implementation method of calling a language model to aggregate and abstract the text information of multiple target nodes to generate category labels corresponding to any first-level cluster is not limited. For example, a second prompt word can be generated based on the text information of multiple target nodes and a second prompt word template. The second prompt word is then input into the language model to aggregate and abstract the text information of multiple target nodes to generate category labels corresponding to any first-level cluster. In addition, summary information of this first-level cluster can also be generated. The category labels and summary information are subsequently used for interpretable display and sample attribution determination.

[0092] Optionally, an example of performing a second clustering operation on the plurality of primary clusters to obtain at least two secondary clusters, and calling the language model to generate a secondary category label corresponding to any secondary cluster, includes: performing a second clustering operation on the plurality of primary clusters based on the cluster centers of each of the plurality of primary clusters to obtain at least two secondary clusters; and for any secondary cluster, calling the language model to generate a secondary category label corresponding to any secondary cluster based on the primary category label corresponding to any secondary cluster.

[0093] Each cluster has a corresponding cluster center. For example, the feature vector corresponding to the cluster center can be the average of the feature vectors in the cluster. Based on the cluster centers of multiple first-level clusters, hierarchical clustering is performed from bottom to top. For example, a second clustering operation is performed on the cluster centers of multiple first-level clusters to obtain multiple second-level clusters, with the number of second-level clusters being less than the number of first-level clusters. Clustering is then performed on the cluster centers of multiple second-level clusters to obtain multiple third-level clusters, with the number of third-level clusters being less than the number of second-level clusters. This clustering is continued until N levels of clusters are obtained.

[0094] Optionally, before performing a second clustering operation on the plurality of primary clusters to obtain at least two secondary clusters, the structured information processing device can also perform post-processing on the primary clusters based on a language model. For example, it can identify semantic anomalies, misclassifications, heterogeneous merging, or refinement needs in the primary clusters based on the language model, and use the natural language interpretation capabilities of the language model to construct a semantically consistent and hierarchically clear classification tree. An example is provided below.

[0095] Example C1 splits the initial clusters with low intra-class cohesion.

[0096] Intra-cluster cohesion measures the similarity or closeness between nodes within the same cluster. For example, intra-cluster cohesion can be the average semantic similarity between each node and the cluster center within a first-order cluster. Intra-cluster cohesion is expressed as: . Represents any node in a first-level cluster. It is the cluster center. This represents a first-level cluster.

[0097] Calculate the intra-cluster cohesion of multiple first-level clusters. If any first-level cluster has an intra-cluster cohesion lower than a set intra-cluster cohesion threshold, indicating low semantic consistency among nodes, the language model is invoked to determine whether to split this first-level cluster. If splitting is determined, the first-level cluster is divided into multiple sub-clusters based on the semantic similarity of nodes within it. These sub-clusters are then used as new first-level clusters and output. The intra-cluster cohesion threshold is used as an example. It could be 75% or 50%, etc.

[0098] For example, the language model maintains a third prompt word template. A third prompt word is generated based on the first-level cluster and the third prompt word template. The language model is then called based on the third prompt word to determine whether to split the first-level cluster, and if so, to identify the multiple first-level clusters resulting from the split, and to delete the first-level cluster.

[0099] For example, the third prompt is as follows: Here are some texts that are grouped into the same category. Please determine if these texts are semantically consistent? Are there multiple semantic topics? If necessary, please suggest a suitable subdivision scheme (e.g., dividing into several sub-clusters, and provide a brief reason).

[0100] Text Sample: 1. [Text 1] 2. [Text 2] ... N. [Text N] Please answer: - Is splitting recommended? (Yes / No) - If splitting, how many sub-clusters are recommended? - Brief description of each sub-cluster? Example C2: Merge duplicate initial clusters with high semantic similarity.

[0101] For multiple first-level clusters, any two first-level clusters form a cluster pair, and the semantic similarity between the cluster centers of any cluster pair is calculated.

[0102] If there are cluster pairs whose semantic similarity between cluster centers is greater than a set similarity threshold, then target text information is selected from the first-level clusters included in the cluster pair, and the language model is invoked to determine whether to merge the cluster pairs based on the semantic similarity of the target text information; if merged, the cluster pair is taken as a new first-level cluster. The set similarity threshold may include, but is not limited to, 90% or 95%.

[0103] For example, for a cluster pair consisting of first-level cluster D1 and first-level cluster D2, the semantic similarity between the cluster center of first-level cluster D1 and the cluster center of first-level cluster D2 is calculated. If the semantic similarity is greater than the similarity threshold, then some nodes corresponding to the first text information are randomly selected from first-level cluster D1, and some nodes corresponding to the second text information are randomly selected from first-level cluster D2. The first text information and the second text information are used as the target text information.

[0104] The semantic model maintains a fourth prompt word template, which can generate a fourth prompt word based on the fourth prompt word template and the target text information. Based on the fourth prompt word, the semantic model is called to determine whether to merge cluster pairs based on the semantic similarity of the target text information. If they are merged, the cluster pairs are used as new initial clusters.

[0105] For example, the fourth prompt could be: Below are texts from two categories. Please determine whether these two categories are semantically highly similar and whether they should be merged into the same category. Please make your judgment based on their themes, keywords, and semantic intent.

[0106] Text information corresponding to sample nodes in cluster E: 1. [Text E1] 2. [Text E2] ... N. [Text EN] Text information corresponding to nodes in cluster E: 1. [Text F1] 2. [Text F2] ... N. [Text FN] Please answer: - Is merging recommended? (Yes / No) - What is the summary of the category labels after merging? - If not merged, where are their semantic boundaries? Example C3, sparse cluster redistribution.

[0107] For any initial cluster, determine if the number of nodes in that first-level cluster is less than a set threshold. The set threshold includes, but is not limited to, 5, 50, or 100 nodes. If a second-level cluster exists with fewer nodes than the set threshold, it indicates that the second-level cluster is an isolated or unstable cluster. Then, for any node in the second-level cluster, the language model is invoked, and based on the similarity between that node and the cluster center of the third-level cluster, the node is reassigned within the third-level cluster. The third-level cluster refers to any first-level cluster other than the second-level cluster.

[0108] For example, each node in the second-level cluster ,calculate The semantic similarity with the cluster centers of other first-level clusters, for example, this semantic similarity is expressed as For example, you can select from that node. First-level clusters of targets with high similarity: , this node Reassign to the target first-level cluster.

[0109] Example C4: Boundary sample node reassignment.

[0110] For any given first-level cluster, outliers are identified based on the similarity between nodes within that cluster and its cluster center. For example, the semantic similarity between nodes and cluster centers is calculated, and a predetermined number of nodes with low semantic similarity are selected as outliers; alternatively, nodes with semantic similarity below a predetermined threshold are selected. This threshold could include, but is not limited to, 20% or 30%. A language model is then invoked to redistribute outliers within the fourth-level cluster based on the corresponding text information, the similarity between the outlier and the cluster center of the fourth-level cluster, and the category label of the fourth-level cluster.

[0111] For example, the language model has a fifth cue word template. Based on this template, the text information corresponding to the outlier, the similarity between the outlier and the cluster center of the fourth-level cluster, and the category label of the fourth-level cluster, a fifth cue word is generated. The language model is then invoked based on this fifth cue word to redistribute the outlier within the fourth-level cluster. The fourth-level cluster consists of other first-level clusters besides the one containing the outlier.

[0112] Below is a text that needs to be categorized, along with descriptions of several candidate categories. Based on the text content, please select the most matching category and briefly explain your reasoning.

[0113] Text to be classified: [Text to be judged] Candidate category labels: 1. Category label: X1 Summary: ... 2. Category label: X2 Summary: ... N. Category label: XN Summary: ... Please answer: - Which category label is the best match? (Output label) - Brief explanation of the reasoning. In Figure 2, examples C1 to C4 are shown as examples. Example C1 shows cluster splitting, example C2 shows cluster merging, example C3 shows redistribution, and example C4 shows outliers. Additionally, Figure 2 also shows examples of category label generation.

[0114] Among them, a language model-driven hierarchical clustering mechanism is introduced. Through semantic correction (label generation), cluster merging and cluster splitting operations, a semantically accurate and logically clear hierarchical classification structure (i.e., hierarchical category labels) can be automatically constructed, with strong generalization ability.

[0115] In an optional embodiment, a method for executing a target task based on hierarchical category labels is also provided, as follows: obtaining service requirement description information pointing to the target task; traversing hierarchical category labels from top to bottom based on the service requirement description information to obtain target category labels that match the service requirement description information; invoking a task processing model to generate service results corresponding to the service requirement description information based on the text information corresponding to the nodes in the first-level cluster corresponding to the target category labels.

[0116] The service requirement description information can be task description information, such as a problem. For example, "I've been experiencing dizziness, loss of appetite, and acid reflux this past week. What's wrong with me?" The service requirement description information points to the target task, namely a medical question-and-answer service. The target task corresponds to a graph structure, such as a medical knowledge graph. The graph structure corresponds to structured information, such as the hierarchical classification tree of the medical knowledge graph. Based on the service requirement description information, the hierarchical category labels are traversed from top to bottom to obtain the target category labels that match the service requirement description information.

[0117] The task processing model is invoked to generate service results corresponding to the service requirement description information based on the text information corresponding to the nodes in the first-level clusters corresponding to the target category labels. Based on the text information corresponding to the nodes in the first-level clusters corresponding to the target category labels, graph reference information adapted to the target task is generated. For example, the text information corresponding to the nodes in the first-level clusters corresponding to the target category labels can be directly used as graph reference information. Alternatively, the matching degree between the text information corresponding to the nodes in the first-level clusters corresponding to the target category labels and the service requirement description information can be calculated, and the text information with the higher matching degree can be selected as graph reference information. The graph reference information and the service requirement description information are then input into the task processing model so that the model can output the service results of the target task.

[0118] The embodiments in this specification do not limit the number of model parameters supported by the task processing model, but aim to meet actual needs. For example, the task processing model can be a deep learning model with relatively few parameter rules, or it can be a deep learning model with a relatively large number of model parameters. For a detailed introduction to deep learning models, please refer to the foregoing embodiments.

[0119] In the embodiments of this specification, nodes in the graph structure are transformed into a vector space using a target encoding model. In the vector space, semantically similar nodes are clustered together, while semantically different nodes are spaced far apart, facilitating the formation of well-structured clusters with clustering friendliness. A language model is used to split, merge, and redistribute the initial clusters, as well as to address intra-cluster heterogeneity and ambiguous boundaries, improving the semantic consistency of the initial clusters. The language model outputs category labels (e.g., natural language cluster labels) and summaries, providing intuitive results that are easy to use for human-computer interaction or knowledge navigation, with high interpretability. The entire process automatically constructs structured information, adapting to different graph structures and scales, supporting dynamic structure updates, and exhibiting strong automation and adaptability. The constructed structured information can be directly embedded into the graph retrieval enhancement generation process, improving generation accuracy, contextual consistency, and knowledge controllability.

[0120] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 101 to 104 can be device A; or the execution subject of steps 101 and 102 can be device A, and the execution subject of step 103 can be device B; and so on.

[0121] Furthermore, some processes described in the above embodiments and accompanying drawings include multiple operations appearing in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.

[0122] In this specification, unless explicitly stated otherwise, "receiving and sending data" does not necessarily mean direct receiving and sending; it can also mean indirect receiving and sending. For example, A receiving data sent by B can be understood as A directly receiving data sent by B, or it can be understood as A indirectly receiving data sent by B through other entities such as C. Similarly, B sending data to A can be understood as B sending data directly to A, or it can be understood as B indirectly sending data to A through other entities such as C. Here, C can be one entity, or it can be two or more entities.

[0123] Figure 3 is a schematic diagram of a structured information generation device provided by an exemplary embodiment of this specification. As shown in Figure 3, the device includes: an acquisition module 31, an encoding module 32, a clustering module 33, and a generation module 34.

[0124] The acquisition module 31 is used to acquire a graph structure pointing to the target task. The graph structure includes multiple nodes and edges between at least some of the nodes, where edges represent the relationships between connected nodes, and multiple nodes correspond to multiple text information. The encoding module 32 is used to encode the multiple text information according to the graph structure by calling the target encoding model to obtain multiple feature vectors. The clustering module 33 is used to perform a first clustering operation on the multiple feature vectors to obtain multiple first-level clusters. The generation module 34 is used to call the language model to generate a first-level category label corresponding to any first-level cluster. The clustering module 33 is used to perform a second clustering operation on the multiple first-level clusters to obtain at least two second-level clusters. The generation module 34 is used to call the language model to generate a second-level category label corresponding to any second-level cluster. The generation module 34 is used to generate hierarchical category labels based on the first-level category labels and the second-level category labels, and is used to retrieve text information that is compatible with the target task from the graph structure.

[0125] For detailed descriptions of the implementation methods and effects of the above-mentioned device, please refer to the foregoing embodiments, which will not be repeated here.

[0126] Figure 4 illustrates a structural diagram of an electronic device provided in an exemplary embodiment of this specification, which is applicable to the structured information generation method provided in the foregoing embodiments. As shown in Figure 4, the electronic device 700 mainly consists of a communication interface 702, a user interface 704, a processor 706, and a memory 708. These components are interconnected and communicate with each other through a system bus, network, or other connection mechanism 410. The communication interface 702 enables the device 700 to communicate with other devices, access networks, and transmission networks through analog or digital modulation. For example, the communication interface 702 may include a chipset and an antenna for wireless communication with a radio access network or access point. In addition, the communication interface 702 may also be a wired interface such as Ethernet, Token Ring, or USB port, or a wireless interface such as Wi-Fi (Wireless Fidelity), Bluetooth, Global Positioning System (GPS), or wide area wireless interface, such as WiMAX (Wireless Maximum) or LTE (Long Term Evolution). Of course, the communication interface 702 may also support other forms of physical layer interfaces and standard or proprietary communication protocols. The communication interface 702 may also include multiple physical communication interfaces, such as a Wi-Fi interface, a Bluetooth interface, and a wide-area wireless interface.

[0127] User interface 704 includes receiving user input and providing output to the user. Therefore, user interface 704 may include input components such as a keypad, keyboard, touch-sensitive or presence-sensitive panel, computer mouse, trackball, joystick, microphone, still camera, and video camera, and output components such as a display screen (which may be combined with a touch-sensitive panel), CRT (Cathode Ray Tube), LCD (Liquid Crystal Display), LED (Light Emitting Diode), display using DLP (Digital Light Processing) technology, printer, and other known or future similar devices. User interface 704 may also generate auditory output via speakers, speaker jacks, audio output ports, audio output devices, headphones, and other known or future similar devices. In some embodiments, user interface 704 may include software, circuitry, or other forms of logic capable of transmitting and receiving data from external user input / output devices. Additionally or alternatively, electronic device 700 may support remote access from other devices via communication interface 702 or another physical interface (not shown). User interface 704 can be configured to receive user input, the position and movement of which can be indicated by an indicator or cursor described herein. User interface 704 can also be configured as a display device for rendering or displaying text fragments.

[0128] Processor 706 may include one or more general-purpose processors and / or special-purpose processors. Memory 708 may include one or more volatile and / or non-volatile memory components and may be integrated wholly or partially with processor 706. Memory 708 may include removable and non-removable components.

[0129] The processor 706 is capable of executing program instructions 718 (e.g., compiled or uncompiled program logic and / or machine code) stored in memory 708 to perform the various functions described herein.

[0130] Memory 708 may contain non-transitory computer-readable media, such as static random-access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. Memory 708 stores program instructions that, when executed by device 700, enable device 700 to perform any of the methods, processes, or functions disclosed in this specification and / or the accompanying drawings. Processor 706 executing program instructions 718 may cause processor 706 to use data 712.

[0131] For example, program instructions 718 may include an operating system 722 (e.g., an operating system kernel, device drivers, and / or other modules) installed on device 700 and one or more applications 720 (e.g., a browser, social application, or game application). Similarly, data 712 may include operating system data 716 and application data 714. Operating system data 716 is primarily accessible to the operating system 722, while application data 714 is primarily accessible to one or more applications 720. Application data 714 may reside in a file system visible or hidden from the user of device 700.

[0132] Application 720 can communicate with operating system 722 through one or more application programming interfaces (APIs). These APIs help application 720 read and / or write application data 714, transmit or receive information via communication interface 702, receive or display information on user interface 704, etc.

[0133] In some terminology, application 720 may be simply referred to as "app". Furthermore, application 720 can be downloaded to device 700 through one or more online app stores or app markets. However, applications can also be installed on device 700 in other ways, such as through a web browser or a physical interface on electronic device 700 (e.g., a USB port).

[0134] Accordingly, embodiments of this specification also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method embodiments. The computer-readable storage medium may be volatile, non-volatile, or a combination thereof, and may be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), flash memory or other memory technologies, CD-ROM, Digital Video Disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium. Accordingly, embodiments of this specification also provide a computer program product comprising a computer program or instructions that, when executed by a processor, cause the processor to implement the steps in the above method embodiments. It should be understood that each step or combination of steps in the above method flow can be implemented by a computer program or instructions. In addition, these computer programs or instructions can be applied to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device, so that the processor of the general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device can be implemented as a means to implement the corresponding functions in the above method embodiments.

[0135] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, product, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, product, or apparatus that includes that element.

[0136] This specification uses specific terms to describe embodiments thereof. Terms such as "an embodiment," "one embodiment," and / or "some embodiments" refer to a particular feature, structure, or characteristic associated with at least one embodiment of this specification. Therefore, it should be emphasized and noted that references to "an embodiment," "one embodiment," or "an alternative embodiment" in different locations throughout this specification do not necessarily refer to the same embodiment. Furthermore, those skilled in the art can combine and integrate the different embodiments or examples described herein, as well as the features of those different embodiments or examples, without contradiction.

[0137] The terminology used in the embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” used in the embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. “Multiple” generally includes at least two, but does not exclude the inclusion of at least one. “A plurality” generally includes at least two, but does not exclude the inclusion of at least one.

[0138] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0139] The above are merely embodiments of this specification and are not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.

Claims

1. A structured information processing method, characterized in that, include: Obtain a graph structure pointing to the target task. The graph structure includes multiple nodes and edges between at least some of the nodes. The edges represent the associations between connected nodes, and the multiple nodes correspond to multiple text information. Based on the graph structure, call the target encoding model to encode the multiple text information to obtain multiple feature vectors. Perform a first clustering operation on the multiple feature vectors to obtain multiple first-level clusters, and call the language model to generate a first-level category label corresponding to any first-level cluster. A second clustering operation is performed on the plurality of primary clusters to obtain at least two secondary clusters, and the language model is called to generate secondary category labels corresponding to any secondary cluster; Based on the primary category labels and the secondary category labels, hierarchical category labels are generated to retrieve text information that is compatible with the target task from the graph structure.

2. The method according to claim 1, characterized in that, Perform a first clustering operation on the multiple feature vectors to obtain multiple first-level clusters, and call a language model to generate a first-level category label corresponding to any one of the first-level clusters. This includes: performing a first clustering operation based on the semantic similarity between the multiple feature vectors to obtain multiple first-level clusters; and for any one of the first clusters, calling a language model to generate a first-level category label corresponding to the first-level cluster based on the text information corresponding to each node in the any one cluster.

3. The method according to claim 2, characterized in that, The process of calling a language model to generate a first-level category label corresponding to the first-level cluster based on the text information corresponding to each node in any of the clusters includes: selecting multiple target nodes from any of the first-level clusters based on the semantic similarity between the nodes in any of the first-level clusters and the cluster center; and calling the language model to aggregate and abstract the text information of each of the multiple target nodes to generate a first-level category label corresponding to any of the first-level clusters.

4. The method according to claim 1, characterized in that, Performing a second clustering operation on the plurality of primary clusters to obtain at least two secondary clusters, and calling the language model to generate a secondary category label corresponding to any secondary cluster, includes: performing a second clustering operation on the plurality of primary clusters based on the cluster centers of each primary cluster to obtain at least two secondary clusters; and for any secondary cluster, calling the language model to generate a secondary category label corresponding to any secondary cluster based on the primary category label corresponding to any secondary cluster.

5. The method according to claim 1, characterized in that, Also includes: Obtain a sample graph structure, which includes multiple sample nodes and edges between at least some of the sample nodes, wherein the edges represent the association between connected sample nodes, and the multiple sample nodes correspond to multiple sample text information; An initial encoding model is invoked to encode the multiple sample text information to obtain multiple sample feature vectors corresponding to the multiple sample nodes; with the semantic similarity between sample nodes with a relationship being greater than the semantic similarity between sample nodes without a relationship as the optimization objective, a contrastive loss function is constructed based on the multiple sample feature vectors; the initial encoding model is iteratively trained based on the contrastive loss function to obtain the target encoding model.

6. The method according to claim 5, characterized in that, At least some of the sample nodes among the plurality of sample nodes have initial category labels; with the semantic similarity between related sample nodes being greater than the semantic similarity between unrelated sample nodes as the optimization objective, a contrastive loss function is constructed based on the plurality of sample feature vectors, including: with the semantic similarity between sample nodes with the same initial category label being greater than the semantic similarity between sample nodes with different initial category labels as the first optimization objective, and with the semantic similarity between related sample nodes being greater than the semantic similarity between unrelated sample nodes as the second optimization objective, a contrastive loss function is constructed based on the plurality of sample feature vectors.

7. The method according to claim 6, characterized in that, The initial encoding model is invoked to encode the multiple sample text information to obtain multiple sample feature vectors corresponding to the multiple sample nodes. This includes: performing graph enhancement processing on the sample graph structure to obtain a first graph structure and a second graph structure, wherein the graph enhancement processing includes at least one of structural perturbation and feature perturbation; and invoking the initial encoding model to encode the first graph structure and the second graph structure respectively to obtain multiple first feature vectors and multiple second feature vectors.

8. The method according to claim 7, characterized in that, The first optimization objective is to ensure that the semantic similarity between sample nodes with the same initial category label is greater than that between sample nodes with different initial category labels. The second optimization objective is to ensure that the semantic similarity between sample nodes with a relationship is greater than that between sample nodes without a relationship. Based on the multiple sample feature vectors, a contrastive loss function is constructed, including: for any two sample nodes from the first graph structure and the second graph structure respectively, if the two sample nodes have the same initial category label, or if the two sample nodes do not have an initial category label and there is an edge between the two sample nodes, then the two sample nodes are considered a positive sample pair; if the two sample nodes have different initial category labels, or if the two sample nodes do not have an initial category label and there is no edge between the two sample nodes, then the two sample nodes are considered a negative sample pair; the contrastive loss function is constructed with the semantic similarity of the positive sample pair being greater than that of the negative sample pair as the optimization objective, and the semantic similarity of the sample pair represents the semantic similarity between the corresponding sample feature vectors of the sample nodes in the sample pair.

9. The method according to claim 1, characterized in that, Before performing a second clustering operation on the plurality of first-level clusters to obtain at least two second-level clusters, the method further includes: if there is a first-level cluster with intra-cluster cohesion lower than a set intra-cluster cohesion threshold, invoking the language model to determine whether to split the first-level cluster; and if splitting is determined, outputting the plurality of sub-clusters corresponding to the first-level cluster as new plurality of first-level clusters; and / or if there is a cluster pair with semantic similarity between cluster centers greater than a set similarity threshold, selecting target text information from the first-level clusters included in the cluster pair, invoking the language model, and determining whether to merge the cluster pair based on the semantic similarity between the target text information; if merged, the cluster pair is used as a new first-level cluster.

10. The method according to claim 1, characterized in that, Before performing a second clustering operation on the multiple first-level clusters to obtain at least two second-level clusters, the method further includes: if there exists a second-level cluster with fewer than a set threshold number of nodes, for any node in the second-level cluster, invoking the language model to reassign the node in the third-level cluster based on the similarity between the node and the cluster center of the third-level cluster; and / or for any first-level cluster, determining outliers in the first-level cluster based on the semantic similarity between the nodes in the first-level cluster and the cluster center; invoking the language model to reassign the outlier in the fourth-level cluster based on the text information corresponding to the outlier, the similarity between the outlier and the cluster center of the fourth-level cluster, and the first-level category labels of the second and other first-level clusters.

11. The method according to any one of claims 1-10, characterized in that, Also includes: Obtain service requirement description information pointing to the target task; based on the service requirement description information, traverse the hierarchical category tags from top to bottom to obtain target category tags that match the service requirement description information. The task processing model is invoked, and based on the text information corresponding to the nodes in the first-level cluster corresponding to the target category label, the service result corresponding to the service requirement description information is generated.

12. A structured information generation device, characterized in that, include: The module includes an acquisition module, an encoding module, a clustering module, and a generation module. The acquisition module is used to acquire a graph structure pointing to the target task. The graph structure includes multiple nodes and edges between at least some of the nodes. The edges represent the associations between connected nodes, and the multiple nodes correspond to multiple text information. The encoding module is used to encode the multiple text information by calling the target encoding model according to the graph structure to obtain multiple feature vectors. The clustering module is used to perform a first clustering operation on the multiple feature vectors to obtain multiple first-level clusters; the generation module is used to call the language model to generate a first-level category label corresponding to any first-level cluster. The clustering module is used to perform a second clustering operation on the plurality of first-level clusters to obtain at least two second-level clusters; the generation module is used to call the language model to generate a second-level category label corresponding to any second-level cluster. The generation module is used to generate hierarchical category labels based on the first-level category labels and the second-level category labels, and to retrieve text information that is compatible with the target task from the graph structure.

13. An electronic device, characterized in that, include: A memory and a processor; the memory is used to store one or more computer instructions; the processor is used to execute the one or more computer instructions for: performing the steps of the method according to any one of claims 1-11.

14. A computer-readable storage medium storing a computer program, characterized in that, When a computer program is executed by a processor, it is able to perform the steps of the method described in any one of claims 1-11.

15. A computer program product, characterized in that, include: A computer program / instruction that, when executed by a processor, enables the implementation of the steps in the method described in any one of claims 1-11.