Sample data construction method, graph model training method and graph data processing method
By combining pre-trained graph models and large language models in graph model training, high-quality label classification results are generated, which solves the problem of sparse label data in graph model training and improves the accuracy and efficiency of graph data analysis and processing.
Patent Information
- Application Number
- CN202510734705.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-09-19
AI Technical Summary
When using graphical models to analyze and process graph data, existing technologies face the problems of sparse label data or missing key data, which leads to limited graphical model training, inaccurate prediction results or overfitting problems, thereby affecting the accuracy and efficiency of analysis and processing.
By obtaining sample graph data and its description text of the target project, the pre-trained graph model is used to generate initial classification results, and the description text of the graph elements and the initial classification results are input into the large language model to generate high-quality label classification results. Finally, sample data is constructed for graph model training.
It effectively expands the sample data, deeply integrates the different features of multimodal information, avoids the limitations of insufficient labeled data on graph model training, improves the graph model's ability to capture complex relationships between entities and implicit text features of target projects, and improves the accuracy and efficiency of analysis and processing.
Smart Images

Figure CN120670843A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of risk prediction technology, and in particular to a sample data construction method, a graph model training method, and a graph data processing method. Background Art
[0002] The growing demand for modeling and analysis of complex data structures in fields such as resource scheduling, traffic network adjustment, and interpersonal relationship management has driven the development of intelligent analysis technology. Analysis based on multi-source data, such as risk prediction, has become a core means to improve decision-making efficiency.
[0003] Currently, the traditional method for analyzing and processing structured graph data is to use traditional statistical methods for prediction. However, this traditional method relies on manual feature extraction and a large amount of labeled data, and cannot accurately identify the complex relationships between entities in each graph data. Therefore, a graph model trained by deep learning methods can be used for analysis and processing.
[0004] However, when using graph models to analyze and process graph data, if the target project's graph data includes sparse label data or key data is missing, the lack of label data can limit the training of the graph model, resulting in inaccurate prediction results or overfitting, which in turn leads to low accuracy and efficiency in analyzing and processing the target project's graph data. Therefore, there is an urgent need for an accurate and comprehensive sample data construction method to better train graph models. Summary of the Invention
[0005] In view of this, embodiments of this specification provide a sample data construction method. One or more embodiments of this specification also involve a graph model training method, a graph data processing method, a sample data construction device, a graph model training device, a graph data processing device, a computing device, a computer-readable storage medium, and a computer program product to address technical deficiencies in the prior art.
[0006] According to a first aspect of an embodiment of this specification, a method for constructing sample data is provided, including:
[0007] Obtain sample graph data of the target project and description text of multiple graph elements in the sample graph data, wherein the multiple graph elements include nodes and edges, the nodes represent entity objects in the target project, and the edges represent association relationships between the entity objects;
[0008] Input the sample graph data into the pre-trained graph model of the target project to obtain initial classification results for multiple graph elements;
[0009] Inputting a description text of a first graphic element and an initial classification result of the first graphic element into a large language model to obtain a label classification result of the first graphic element, wherein the first graphic element is any one of the multiple graphic elements;
[0010] Based on the sample graph data and label classification results of the plurality of graph elements, sample data of the target project is constructed, wherein the sample data is used to train a graph model of the target project.
[0011] According to a second aspect of the embodiments of this specification, a graph model training method is provided, including:
[0012] Obtaining sample data of a target project, wherein the sample data includes sample graph data and label classification results of multiple graph elements in the sample graph data, and the sample data of the target project is constructed based on the above-mentioned sample data construction method;
[0013] Input sample graph data into the graph model to obtain prediction and classification results of multiple graph elements;
[0014] Calculate the loss value based on the predicted classification results and label classification results;
[0015] Based on the loss value, the graph model is trained until the trained target graph model is obtained.
[0016] According to a third aspect of an embodiment of this specification, a graph data processing method is provided, including:
[0017] Get the target graph data of the target project;
[0018] Input the target graph data into the target graph model of the target project to obtain a target classification result, wherein the target graph model is trained according to the above-mentioned graph model training method;
[0019] Based on the target classification results, corresponding project operation strategies are executed on the entity objects and / or the association relationships between entity objects in the target project.
[0020] According to a fourth aspect of the embodiments of this specification, a sample data construction device is provided, including:
[0021] A first acquisition module is configured to: acquire sample graph data of a target project and description text of multiple graph elements in the sample graph data, wherein the multiple graph elements include nodes and edges, the nodes represent entity objects in the target project, and the edges represent association relationships between the entity objects;
[0022] The first prediction module is configured to: input the sample graph data into a pre-trained graph model of the target project to obtain initial classification results of multiple graph elements;
[0023] a classification module configured to: input a description text of a first graphic element and an initial classification result of the first graphic element into the large language model to obtain a label classification result of the first graphic element, wherein the first graphic element is any one of the plurality of graphic elements;
[0024] The construction module is configured to: construct sample data of the target project based on the sample graph data and label classification results of multiple graph elements, wherein the sample data is used to train the graph model of the target project.
[0025] According to a fifth aspect of the embodiments of this specification, a graphical model training device is provided, including:
[0026] The second acquisition module is configured to: acquire sample data of the target project, wherein the sample data includes sample graph data and label classification results of multiple graph elements in the sample graph data, and the sample data of the target project is constructed based on the above-mentioned sample data construction method;
[0027] The second prediction module is configured to: input the sample graph data into the graph model to obtain prediction classification results of multiple graph elements;
[0028] A calculation module is configured to: calculate a loss value based on the predicted classification result and the label classification result;
[0029] The training module is configured to: train the graph model based on the loss value until a trained target graph model is obtained.
[0030] According to a sixth aspect of the embodiments of this specification, a graph data processing apparatus is provided, including:
[0031] The third acquisition module is configured to: acquire target graph data of a target project;
[0032] The third prediction module is configured to: input the target graph data into the target graph model of the target project to obtain a target classification result, wherein the target graph model is trained according to the above-mentioned graph model training method;
[0033] The execution module is configured to: execute corresponding project operation strategies on entity objects and / or association relationships between entity objects in the target project based on the target classification result.
[0034] According to a seventh aspect of the embodiments of this specification, a computing device is provided, including:
[0035] memory and processor;
[0036] The memory is used to store computer executable instructions, and the processor is used to execute the computer program / instructions. When the computer program / instructions are executed by the processor, the steps of the above method are implemented.
[0037] According to an eighth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program / instruction, and the steps of the above method are implemented when the program / instruction is executed by a processor.
[0038] According to a ninth aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.
[0039] An embodiment of the present specification implements a sample data construction method, including: obtaining sample graph data of a target project, and descriptive text of multiple graph elements in the sample graph data, wherein the multiple graph elements include nodes and edges, the nodes represent entity objects in the target project, and the edges represent the association relationship between the entity objects; inputting the sample graph data into a pre-trained graph model of the target project to obtain initial classification results of the multiple graph elements; inputting the descriptive text of the first graph element and the initial classification result of the first graph element into a large language model to obtain a label classification result of the first graph element, wherein the first graph element is any one of the multiple graph elements; constructing sample data of the target project based on the sample graph data and the label classification results of the multiple graph elements, wherein the sample data is used to train the graph model of the target project.
[0040] By taking the initial prediction results obtained by the pre-trained graph model based on the structural relationship between each graph element in the graph data of the template project and the descriptive text of the graph elements as the input of the large language model, the structural information between the graph elements is taken into consideration. At the same time, the powerful analysis ability of the large language model for text is combined to generate high-quality label classification results for the graph elements in the sample graph data, expand the sample data of the target project as the training data of the graph model, deeply integrate the different features of multimodal information, avoid the limitations of insufficient label data on the training of the graph model, enhance the graph model's ability to capture the complex associations between entities and implicit features of the text of the target project, improve the accuracy and efficiency of processing the graph data under the target project, and also improve the robustness of the graph model in scenarios with scarce label data. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a flow chart of a sample data construction method provided by one embodiment of this specification;
[0042] Figure 2 This is a flowchart of a graph model training method provided by one embodiment of this specification;
[0043] Figure 3 This is a flowchart of a graph data processing method provided by one embodiment of this specification;
[0044] Figure 4This is a schematic diagram of the structure of a sample data construction device provided by an embodiment of this specification;
[0045] Figure 5 This is a structural diagram of a graphical model training device provided by one embodiment of this specification;
[0046] Figure 6 This is a structural diagram of a graph data processing device provided by one embodiment of this specification;
[0047] Figure 7 This is a structural block diagram of a computing device provided by one embodiment of this specification. DETAILED DESCRIPTION
[0048] The following description sets forth many specific details to facilitate a thorough understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0049] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0050] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0051] In addition, it should be noted that 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 one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0052] First, the terms involved in one or more embodiments of this specification are explained.
[0053] Supervised learning (SL) is a machine learning method that trains a model with labeled data to enable it to learn the mapping relationship between input and output.
[0054] Semi-supervised learning (SSL) is a method that combines a small amount of labeled data with a large amount of unlabeled data for model training to improve generalization ability.
[0055] The Large Language Model (LLM) is a deep learning model trained on massive amounts of text and has powerful semantic understanding and generation capabilities.
[0056] A graph model is a machine learning model that models entities and their relationships based on a graph structure.
[0057] Graph Convolutional Network (GCN) is a graph neural network that aggregates neighbor node information through convolution operations.
[0058] Graph Attention Network (GAT) is a graph neural network that dynamically weights neighbor node information through an attention mechanism.
[0059] Page Rank is a graph algorithm that evaluates the importance of a node by the quality and quantity of its inlinks.
[0060] To summarize: PageRank iteratively calculates the importance of nodes (such as core enterprises in a supply chain network), with higher values indicating greater influence within the topology. In this application, PageRank is used to sample and filter key enterprise nodes (such as central nodes in a guarantee network), reducing redundant data processing overhead and improving the efficiency of label generation for large language models.
[0061] Confidence Score is a quantitative assessment of the model's credibility of the prediction results, usually expressed as a probability value (0-1) or a percentage.
[0062] Zero-Shot Prompting is a prompting strategy that guides the model to generate results directly through task description and input information without the need for reference examples.
[0063] Few-Shot Prompting is a prompting strategy that guides the model to understand the task mode through a small number of reference examples.
[0064] Class Prototype Prompting is a prompting strategy that extracts category feature text to guide the model to perform classification based on semantic similarity.
[0065] Parameter Efficient Fine-Tuning (PEFT) is a technology that optimizes model performance by adjusting a small number of parameters, reducing computing resource consumption.
[0066] Low-Rank Adaptation (LoRA) is a technology that fine-tunes the model by training a low-rank matrix, reducing the number of parameters and computational overhead.
[0067] The growing demand for modeling and analysis of complex data structures in fields such as resource scheduling, traffic network adjustment, and interpersonal relationship management has driven the development of intelligent analysis technology. Analysis based on multi-source data, such as risk prediction, has become a core means to improve decision-making efficiency.
[0068] Currently, the traditional method for analyzing and processing structured graph data is to use traditional statistical methods for prediction. However, this traditional method relies on manual feature extraction and a large amount of labeled data, and cannot accurately identify the complex relationships between entities in each graph data. Therefore, a graph model based on deep learning methods can be used for analysis and processing.
[0069] However, when using a graphical model to analyze and process graph data, if the label data included in the graph data of the target project is sparse or key data is missing, the training of the graphical model will be limited due to the small amount of label data, resulting in inaccurate prediction results or overfitting problems, which in turn leads to low accuracy and low efficiency in analyzing and processing the graph data of the target project.
[0070] In light of this, this specification provides a sample data construction method. One or more embodiments of this specification also involve a graph model training method, a graph data processing method, a sample data construction apparatus, a graph model training apparatus, a graph data processing apparatus, a computing device, a computer-readable storage medium, and a computer program product, each of which is described in detail in the following embodiments.
[0071] See also Figure 1 , Figure 1 A flow chart of a sample data construction method provided according to an embodiment of this specification is shown, which specifically includes the following steps.
[0072] Step 102: Obtain sample graph data of the target project and description text of multiple graph elements in the sample graph data, wherein the multiple graph elements include nodes and edges, the nodes represent entity objects in the target project, and the edges represent the association relationships between the entity objects.
[0073] A target project is a specific domain or task requiring data analysis and processing, such as predicting loan defaults for small and medium-sized enterprises in the financial sector, analyzing the spread of diseases in the medical sector, or predicting traffic congestion. In the embodiments of this specification, a target project typically involves complex relationships between entity objects, such as supply chain relationships between businesses, the diagnosis and treatment relationship between patients and doctors, and the direction of traffic flow at a road intersection.
[0074] The sample graph data is a multi-source data set organized in the form of a graph structure, and its essence is structured data containing graph elements (nodes and edges) and their attributes. In the embodiments of this specification, the sample graph data comes from the relevant database or historical data records of the target project. In different application scenarios, it can come from financial transaction records, corporate business information, user behavior logs, etc., such as corporate loan records, guarantee relationship chains, legal person association networks, etc. extracted from the banking system. The specific form of the sample graph data can be an adjacency matrix, an edge list, or an attribute graph. For example, in a credit scenario, the sample graph data may contain hundreds of nodes of corporate or individual entities, each node having attribute information such as registered capital and revenue scale, and the edges represent the mutual guarantee relationship and guarantee amount between enterprises. The sample graph data forms semantically rich input data by integrating the text description, numerical attributes and topological structure of the entity objects of the target project.
[0075] Graph elements are the basic units that make up sample graph data, including nodes and edges. In the embodiments of this specification, graph elements represent entities with actual physical meaning or relationships between entities in the graph data of the target project.
[0076] A node is the basic unit in graph data, representing an independent entity object within the target project. For example, in the financial sector, a node can represent a business or individual borrower; in the transportation sector, a node can represent a road intersection or a transportation hub; and in the medical sector, a node can represent a patient or doctor. In the embodiments of this specification, a node can include not only entity identification information (such as a business ID) but also attribute information (such as financial data or text descriptions).
[0077] Edges are structural units that connect nodes and represent the relationship between entity objects. For example, in the financial field, edges can represent guarantee relationships between enterprises, supply chain collaboration, etc.; in the transportation field, edges can represent traffic flow directions at road intersections, traffic signal control, etc.; in the medical field, edges can represent patient and doctor medical records, drug interactions, etc. In the embodiments of this specification, edges describe the dynamic interaction patterns between entities through their attribute information (such as guarantee amount, traffic flow) and topological structure (such as edge weight and directionality), providing a basis for relationship modeling for the model.
[0078] Entity objects are specific individuals or units that need to be analyzed or predicted in the target project. For example, in the financial field, entity objects can be small and medium-sized enterprises, bank customers, etc.; in the medical field, entity objects can be patients, medical institutions, etc.; in the transportation field, entity objects can be vehicles, road nodes, etc. In the embodiments of this specification, entity objects can form the basis of graph data through their attribute information (such as financial indicators, health data) and their associations with other entity objects (such as supply chain networks, medical records), providing multi-dimensional feature input for the model.
[0079] Descriptive text is unstructured or semi-structured text information related to graph elements, which is used to supplement the semantic features of entity objects. For example, in the financial field, descriptive text may include text information such as the company's financial reports, credit scores, industry classifications, etc.; in the medical field, descriptive text may include text information such as patients' medical records, diagnosis conclusions, medication history, etc. For example, the descriptive text of a company may contain key information such as "the net profit growth rate in the past three years has exceeded 20%" and "there are multiple overdue loan records." In the embodiments of this specification, the descriptive text can be converted into a structured feature representation through the semantic analysis capability of the Large Language Model (LLM), and integrated with the structural information of the graph elements to enhance the model's comprehensive understanding of entity objects.
[0080] Specifically, for the target project's sample graph data, graph data including entity objects and their relationships can be extracted from the target project's database, network data interface, or public data source. For example, SME loan data in the financial sector can be obtained through the credit platform interface, and patient diagnosis and treatment data in the medical sector can be exported through the hospital information system.
[0081] When the sample image data is obtained, description texts of multiple image elements included in the sample image data may also be obtained to provide explanations or descriptions of each image element in the sample image data.
[0082] For example, taking the prediction of loan defaults for small and medium-sized enterprises in the financial sector, the target project involves entities such as enterprises, banks, and guarantee agencies, as well as relationships between them, such as loan guarantees, supply chain collaboration, and debt relationships. The sample graph data obtained for the target project includes nodes such as Enterprise A, Enterprise B, and Enterprise C, and edges such as the guarantee relationship between Enterprise A and Enterprise B, Enterprise A's connection to Enterprise B through the supply chain, and Enterprise B's connection to Bank C through the guarantee. It also includes descriptions of Enterprise A and Enterprise B. For example, Enterprise A's description includes: Financial report summary: "Resource growth in 2024 was 50 million yuan, a 10% year-on-year increase, but the debt-to-asset ratio is as high as 80%, and current liabilities rely on short-term financing." Industry classification label: "Manufacturing - Electronic Equipment Manufacturing." Public information: "Enterprise A was previously penalized for environmental violations." Enterprise B's description includes: Financial report summary: "Net profit decreased by 30% in 2024, cash flow is tight, and it relies on guarantees from affiliated enterprises." Historical records: "Enterprise B was placed on a credit blacklist in 2023 due to overdue loans."
[0083] In this step, by obtaining the sample graph data of the target project and the descriptive text of its graph elements, a deep fusion of structured and unstructured information is achieved, providing a high-quality data foundation for subsequent model training.
[0084] Step 104: Input the sample graph data into the pre-trained graph model of the target project to obtain initial classification results of multiple graph elements.
[0085] The pre-trained graph model is a graph neural network (GNN) pre-trained based on data from the target project domain. It learns the structural association patterns and feature mapping capabilities between entities from the pre-trained graph data through supervised learning. In the embodiments of this specification, the pre-trained graph model can adopt architectures such as Graph Convolutional Network (GCN) or Graph Attention Network (GAT) to form a structured representation of graph elements by aggregating node attributes and feature information of their neighboring nodes. For example, in a financial scenario, the pre-trained graph model learns how to identify risk propagation paths from the guarantee chain by analyzing the guarantee relationship network (edge topology) and node attributes (such as registered capital and revenue growth rate) between enterprises. The training process includes: extracting the enterprise guarantee relationship graph (adjacency matrix), node attributes (structured financial data) and real default labels from the bank's historical data, and optimizing the model parameters through back propagation so that it can predict the probability of default based on the topological structure and node characteristics.
[0086] The training of pre-trained graph models usually adopts self-supervised learning (such as node reconstruction, link prediction) or supervised learning (such as classification tasks) strategies, so that they can adapt to the graph structure characteristics of different fields.
[0087] Specifically, in the embodiments of this specification, since the label data in the target project field is relatively scarce, the pre-trained graph model is only trained based on a small amount of pre-trained graph data, and the initial classification results obtained by processing the sample graph data may not be accurate, and need to be further processed in combination with a large language model.
[0088] The initial classification result is the preliminary prediction output of the pre-trained graph model for each graph element (node and / or edge) in the sample graph data, reflecting the model's judgment on the category to which the graph element belongs based on structural information.
[0089] Optionally, in addition to the initial classification results for the graph elements, the initial classification results may also include the confidence level of the classification results to characterize the likelihood of the classification results. For example, in loan default prediction in the financial field, the initial classification results may be the default probability of a certain enterprise (e.g., "Default: 85%") or the credibility of a guarantee relationship (e.g., "Credibility: 30%").
[0090] Specifically, the initial classification results can be generated by a pre-trained graph model through message passing and node updates. The pre-trained graph model can first aggregate the neighbor information of the graph elements (such as the financial status of Enterprise B, the guarantor of Enterprise A) and then calculate the classification score based on the attribute information of the graph elements themselves (such as the debt-to-asset ratio of Enterprise A).
[0091] Since the initial classification result is obtained by the pre-trained graph model based on the structural information of the sample graph data, the topological structural relationship between the graph elements in the sample graph data is taken into account, and it can be used as the input of the large language model to provide structured guidance for the subsequent label classification process of the large language model.
[0092] Once sample graph data is obtained, it can be input into the pre-trained graph model, which then outputs initial classification results for multiple graph elements. Specifically, the pre-trained graph model is used to determine the initial classification results without the need to input description text for the graph elements.
[0093] For example, following the above example, taking the prediction of loan defaults for small and medium-sized enterprises in the financial field as an example, the sample graph data composed of nodes such as Enterprise A, Enterprise B, Enterprise C and the connection relationships between them is input into the pre-trained graph model, and the input is: "Node attributes: Enterprise A: registered capital = 50 million yuan, asset-liability ratio = 80%, revenue growth rate = 10%; Enterprise B: registered capital = 30 million yuan, asset-liability ratio = 70%, net profit decrease of 30%; edge attributes: there is a guarantee relationship between Enterprise A and Enterprise B, guarantee amount = 20 million yuan, guarantee period = 3 years; topology structure: Enterprise A is connected to Enterprise B through a guarantee relationship, and Enterprise B is connected to Enterprise C through a supply chain." Based on the above input, the pre-trained graph model obtains initial classification results including: Enterprise A: default, 85%; Enterprise B: default, 60%.
[0094] In this step, by inputting the acquired sample graph data into the pre-trained graph model and utilizing its graph structure modeling capability, the initial classification results of multiple graph elements are generated, providing structured guidance and data foundation for the subsequent semantic analysis of the large language model.
[0095] Step 106: Input the description text of the first graphic element and the initial classification result of the first graphic element into the large language model to obtain a label classification result of the first graphic element, wherein the first graphic element is any one of the multiple graphic elements.
[0096] The first graph element is any graph element (node or edge) in the sample graph data, which serves as the target object for processing by the large language model. In the embodiments of this specification, the first graph element can represent different entity objects in different application scenarios. For example, it can be an enterprise node (such as enterprise A) in the financial field, a patient node in the medical field, or a road intersection node in the transportation field.
[0097] The selection of the first graph element can be random or strategic, and can include factors such as the topological importance of the node, the relevance of the target transaction, or data integrity. For example, in a financial scenario, the first graph element might be Enterprise A, whose node attributes include debt-to-asset ratio and guarantee relationships, and edge attributes include guarantee amounts and supply chain connections.
[0098] The description text of the first graph element is unstructured or semi-structured text information related to the graph element, which is used to supplement the semantic features of the entity object. For example, in the financial field, the description text of Company A may include information such as "asset-liability ratio as high as 80%" and "previously penalized for environmental violations"; in the medical field, the description text of a patient node may include medical records or medication history. The description text of the first graph element is converted into structured features through the semantic analysis capabilities of the large language model. It is then integrated with the structural information of the graph element (such as node attributes and edge attributes) to enhance the large language model's comprehensive understanding of the entity object.
[0099] The label classification result is generated by combining the large language model with the descriptive text of the first image element and the initial classification result. This label classification result serves as the label information for the first image element in the sample image data of the target project. Compared to the initial classification result, the label classification result more comprehensively considers semantic richness and multimodal information, resulting in higher accuracy.
[0100] Optionally, the label classification results may include not only the classification labels of the graph elements, but also additional information such as confidence level and risk factor analysis, to provide high-quality annotation for sample data construction.
[0101] For example, for the first figure element Enterprise A, the initial classification result is "Default: 85%"; the description text of Enterprise A: "Financial report summary: 'Resource growth in 2024 is 50 million yuan, a year-on-year increase of 10%, but the asset-liability ratio is as high as 80%, and current liabilities rely on short-term financing' Industry classification label: 'Manufacturing-Electronic Equipment Manufacturing'. Public information: 'Enterprise A was punished for environmental violations'" and the initial classification result "Default: 85%" are input into the large language model, and the final label classification result of Enterprise A is "Default: 92%".
[0102] In this step, the initial classification results generated by the pre-trained graph model based on the graph structure and the descriptive text of the graph elements are taken as input, and analyzed and processed by the large language model to obtain the label classification results of the first graph element, providing a data basis for the subsequent construction of sample data.
[0103] Step 108: Based on the sample graph data and the label classification results of the multiple graph elements, construct sample data of the target project, wherein the sample data is used to train the graph model of the target project.
[0104] Sample data is a structured data set used to train the target project's graph model. Essentially, it consists of input-output pairs of graph elements (nodes and edges) and their label classification results, used for supervised or semi-supervised training of the graph model. In the embodiments of this specification, sample data can consist of two parts: structured graph data and label classification results.
[0105] For example, in a financial scenario, sample data may include financial indicators of enterprise nodes (such as debt-to-asset ratio, revenue growth rate), guarantee relationship chains (such as guarantee amount, supply chain weight), and corresponding default risk labels (such as "default: 92%"), providing multimodal feature input and supervision targets for the graph model.
[0106] By combining the initial classification results of the pre-trained graph model with the semantic analysis of the large language model to obtain the label classification results, and constructing sample data based on the label classification results of multiple graph elements and sample graph data, the shortage of label data is compensated and the deep integration of structured information and text semantics is achieved.
[0107] The graph model of the target project is a targeted graph neural network (GNN) trained for tasks in specific fields, such as a graph model for predicting loan defaults for small and medium-sized enterprises, or a graph model for analyzing the spread of medical diseases.
[0108] Optionally, the target project's graph model can be obtained by training an untrained graph model or by further training a pre-trained graph model. This is because the training process of the pre-trained graph model uses relatively sparse pre-trained graph data, which may result in insufficient training. The specific method used to train the target project's graph model is not specifically limited in the embodiments of this specification.
[0109] After obtaining the label classification results of multiple graph elements output by the large language model, the sample graph data can be integrated with the label classification results. By constructing sample pairs of graph element-label classification results to form sample data, the graph model can be supervised or semi-supervised trained.
[0110] Optionally, the sample graph data can be converted into an input format compatible with the graph neural network (such as an adjacency matrix, an edge list) to complete the format conversion, and the classification labels (such as "default", "trusted", etc.) can be mapped to numerical codes (such as 0, 1, etc.) so that the graph model can recognize the sample data.
[0111] The training strategy for the target project's graph model typically incorporates semi-supervised learning (such as the pseudo-labeling paradigm), leveraging the label classification results generated by a large language model as an additional supervisory signal to enhance the model's robustness in scenarios where labeled data is scarce. For example, in the context of online merchant credit risk management, the target graph model uses "high-risk" labels in sample data to learn the correlation between environmental violations and default risk, improving risk prediction capabilities for small and medium-sized enterprises.
[0112] For example, using the above example, let's take the example of predicting loan defaults for SMEs in the financial sector. For the graph element Enterprise A in the sample graph data, it does not carry a labeled classification result. Therefore, when the sample graph data is input into the pre-trained graph model, the initial classification result for Enterprise A is obtained as "Default: 85%." This initial classification result, "Default: 85%," along with Enterprise A's description text ("Financial Report Summary: 'Resource growth in 2024 was 50 million yuan, a year-on-year increase of 10%, but the debt-to-asset ratio was as high as 80%, and current liabilities relied on short-term financing' Industry classification label: 'Manufacturing - Electronic Equipment Manufacturing'. Public information: 'Enterprise A was previously penalized for environmental violations'"), is input into the large language model, resulting in the final label classification result for Enterprise A as "Default: 92%." The sample pair of graph element-label classification results for Enterprise A is obtained as "Enterprise A - Default: 92%." This labeled classification result for Enterprise A can then be used as sample data to train a graph model targeting the prediction of loan defaults for SMEs in the financial sector.
[0113] In the embodiments of this specification, the initial prediction results obtained by the structural relationship between each graph element in the graph data of the template project based on the pre-trained graph model and the descriptive text of the graph elements are used as the input of the large language model, the structural information between the graph elements is taken into consideration, and the powerful analysis ability of the large language model for text is combined to generate high-quality label classification results for the graph elements in the sample graph data, expand the sample data of the target project as the training data of the graph model, deeply integrate the different features of multimodal information, avoid the limitation of insufficient label data on the training of the graph model, enhance the graph model's ability to capture the complex associations between entities of the target project and the implicit features of the text, improve the accuracy and efficiency of processing the graph data under the target project, and also improve the robustness of the graph model in scenarios where label data is scarce.
[0114] In an optional embodiment of the present specification, before inputting the sample graph data into the initial graph model of the target project to obtain the initial classification results of the plurality of graph elements, the method further includes:
[0115] Obtain the pre-trained graph data of the target project and the classification labels of multiple graph elements in the pre-trained graph data;
[0116] Based on the pre-trained graph data and the classification labels of multiple graph elements, the initial graph model is supervised trained to obtain the pre-trained graph model of the target project.
[0117] Pre-trained graph data is a set of structured graph data used to train pre-trained graph models. Its essence is supervised data containing graph elements (nodes and edges) and their classification labels. In the embodiments of this specification, pre-trained graph data can be derived from historical records or public data sets in the target project field, such as bank guarantee relationship graphs in the financial field, disease transmission networks in the medical field, etc. In the financial scenario, pre-trained graph data can include the adjacency matrix of the enterprise guarantee relationship chain, node attributes (such as registered capital, debt-to-asset ratio, etc.) and classification labels (such as "default", "normal", etc.).
[0118] Specifically, when labeled data in the target project domain is relatively scarce, pre-training graph data is typically a small amount of high-quality annotated data with real classification labels. This is used to train the initial graph model using supervised learning strategies (such as classification tasks) to understand the structural association patterns between entities. For example, the corporate guarantee relationship graph and its real default labels in historical bank data can be used as pre-training graph data to train a graph neural network (GNN) to learn the risk transmission paths of the guarantee chain.
[0119] The initial graph model is the starting point for pre-training a graph neural network (GNN) in the target project domain. Essentially, it is a graph model that has not been adapted for the domain. It is typically constructed based on the initial parameters of a common graph structure (such as a social network or financial transaction network). Initial training is performed on a small amount of labeled data using supervised learning strategies (such as classification tasks) to form a preliminary understanding of the structural association patterns in the target project domain.
[0120] Supervised training is a machine learning method that uses labeled data (such as labeled classification results) to optimize model parameters. Its core goal is to improve model performance by minimizing the error between predicted results and true labels. In the examples of this specification, supervised training is used to pre-train the initial graph model to adapt it to the graph structure characteristics of the target project domain.
[0121] Specifically, supervised training can be achieved by inputting pre-trained graph data (such as corporate guarantee relationship graphs, node attributes, and default labels) into a graph convolutional network (GCN) or a graph attention network (GAT), and using the backpropagation algorithm to optimize the model parameters, so that the model can process and predict based on the topological structure between the graph elements and the graph elements themselves included in the pre-trained graph data, and compare the prediction results with the true labels, thereby measuring the prediction performance of the current graph model.
[0122] The advantage of supervised training is that even if labeled data for the target project domain is sparse, a small amount of high-quality annotated data can guide the model to learn key features, providing structured guidance for subsequent semantic analysis by the large language model. For example, through supervised training, a pre-trained graph model can identify the pattern that "enterprises with debt-to-asset ratios above 80% and long guarantee chains are more likely to default," thereby improving the reliability of the initial classification results.
[0123] In the embodiments of this specification, by utilizing a small amount of high-quality annotated pre-trained graph data and adopting a supervised learning strategy to train the initial graph model, it can still effectively learn the structural association patterns between entities in data-scarce scenarios, thereby improving the adaptability of the graph model to the graph structural characteristics of the target project domain, ensuring that the initial classification results output by the pre-trained graph model have high reliability, and providing precise structured guidance for the semantic analysis of the subsequent large language model. Therefore, under the constraint of insufficient labeled data, the dual improvement of graph model training efficiency and prediction accuracy is achieved, and the robustness and generalization ability of the system in complex association relationship modeling are enhanced.
[0124] In an optional embodiment of the present specification, the description text of the first graphic element and the initial classification result of the first graphic element are input into the large language model to obtain the label classification result of the first graphic element, including:
[0125] The description text of the first graphic element, the description texts of the adjacent graphic elements of the first graphic element, and the initial classification result of the first graphic element are input into the large language model to obtain the label classification result of the first graphic element.
[0126] The adjacent graph elements of the first graph element refer to other graph elements (nodes or edges) that are directly connected to the first graph element in the topological structure. They represent the entity objects or interaction patterns that have a direct association relationship with the first graph element in the sample graph data of the target project.
[0127] In the embodiments of the present specification, adjacent graph elements can be determined by the adjacency relationship in the graph data. For example, in a financial scenario, if the first graph element is a node of enterprise A, its adjacent graph elements may include other enterprise nodes (such as the guarantor or the guaranteed party) that have a guarantee relationship with enterprise A, or affiliated enterprises upstream and downstream of the supply chain.
[0128] The descriptive text of the adjacent graph elements of the first graph element supplements the semantic features of the entity objects that directly interact with the first graph element. For example, the financial report summary and credit score of the adjacent graph element Enterprise B provide more comprehensive contextual information for the large language model to assist it in comprehensively judging the label classification results for the first graph element.
[0129] Specifically, in the process of inputting the descriptive text and initial classification results of the first graphic element included in the sample graphic data of the target project into the large language model, the descriptive texts of the graphic elements adjacent to the first graphic element can also be obtained and input into the large language model together, so that the large language model can comprehensively consider the text information and structural association patterns of the first graphic element and its adjacent graphic elements based on structured guidance and semantic analysis capabilities, and generate a more accurate label classification result for the first graphic element.
[0130] For example, taking the prediction of loan defaults for small and medium-sized enterprises in the financial sector: the initial classification result of Enterprise A is "Default: 85%"; the description text of Enterprise A is: "Financial report summary: 'Resource growth in 2024 was 50 million yuan, a year-on-year increase of 10%, but the asset-liability ratio was as high as 80%, and current liabilities relied on short-term financing' Industry classification label: 'Manufacturing - Electronic Equipment Manufacturing'. Public information: 'Enterprise A was previously punished for environmental violations'"; the description text of Enterprise A's adjacent graph element, Enterprise B, is: "Financial indicators: 'The asset-liability ratio in 2024 was 75%, net profit decreased by 20% year-on-year, and current liabilities relied on short-term financing' Credit record: 'It was previously punished for environmental violations and had three loan delinquencies in the past year' Industry characteristics: 'It belongs to the manufacturing - electronic equipment manufacturing, which is significantly affected by fluctuations in raw material prices' Association relationship: 'Enterprise B and Enterprise A have a mutual guarantee relationship with a guarantee amount of 20 million yuan, and Enterprise B also provides guarantees for three other high-risk enterprises'"; inputting the above data into the large language model, the label classification result of the default risk prediction for Enterprise A is obtained as "Default: 95%".
[0131] In the embodiments of this specification, by attaching the description text of the adjacent graph elements of the first graph element to the input of the large language model in the process of obtaining the label result of the first graph element using the large language model, the input information dimension of the large language model is further expanded, enabling it to comprehensively analyze the semantic features and structural association patterns of the target graph element and its directly related entities, thereby strengthening the model's modeling ability of local topological relationships, and compensating for the limitations of the description text of a single graph element by fusing the semantic context information of neighboring nodes, thereby significantly improving the accuracy and reliability of the label classification results.
[0132] In an optional embodiment of the present specification, the description text of the first graphic element and the initial classification result of the first graphic element are input into the large language model to obtain the label classification result of the first graphic element, including:
[0133] Inputting the description text of the first image element and the initial classification result of the first image element into the large language model to obtain a first label classification result of the first image element;
[0134] Returning to the step of inputting the description text of the first image element and the initial classification result of the first image element into the large language model to obtain a first label classification result of the first image element, until multiple first label classification results are obtained;
[0135] Based on the frequencies of the plurality of first label classification results, a label classification result of the first graph element is determined.
[0136] The frequency of multiple first label classification results refers to the number of times or proportions of each category label (such as "default", "credible", etc.) appears in the label classification results for the same first graph element after multiple independent queries to the large language model. In the embodiments of this specification, the frequency is used to measure the credibility of a certain classification result by counting the number of repetitions of the same category label in all first label classification results, or calculating its probability of occurrence. For example, in a loan default prediction scenario, if the "default" label appears 4 times in 5 independent queries, its frequency is 80%, indicating that the large language model has a strong tendency towards the "default" label.
[0137] Frequency statistics of multiple first-label classification results, by aggregating multiple independent predictions, can effectively mitigate the noise interference caused by the randomness of large language model outputs and improve the reliability of label classification results. For example, if Company A's financial report contains ambiguous statements, a single prediction may result in a misjudgment. However, frequency statistics can identify the model's stable preference for the "default" label, thereby correcting isolated errors.
[0138] Specifically, after inputting the description text of the first image element and the initial classification result of the first image element into the large language model to obtain the first label classification result of the first image element, this step can be repeated, and the same input information can be input into the large language model multiple times, so that the large language model can output the first label classification result for the first image element multiple times. By counting the frequency of occurrence of each classification result in multiple first label classification results and sorting them, the label classification result of the first image element is determined, which provides a quantitative basis for the subsequent determination of the final label classification result, can reduce the randomness of a single query result, and improve the robustness of the classification result.
[0139] Optionally, in multiple queries targeting the first graph element, the large language model may output multiple label classification results for the first graph element (such as "default," "trusted," etc.). In this case, a Top-k strategy can be used for selection. Specifically, the Top-k strategy sorts the multiple first label classification results generated by frequency from high to low, and selects the top k first label classification results as the final label classification result.
[0140] Optionally, when the number k of the selected first label classification results is not 1, a weighted average may be performed based on the confidences corresponding to the first label classification results, or a first label classification result with a higher confidence may be selected as the label classification result.
[0141] Optionally, the specific number of queries for multiple queries of the first graph element can be determined based on the computational performance of the large language model. Specifically, a single query of the large language model consumes computing resources and time, so the number of queries needs to be balanced between performance and accuracy. The specific number of queries can be flexibly set based on the actual application scenario and is not specifically limited in this embodiment of the present specification.
[0142] For example, take the prediction of loan defaults for small and medium-sized enterprises in the financial sector as an example: for the first element, Enterprise A, its initial classification result is "Default: 85%"; the description text is: "Financial report summary: 'Resource growth in 2024 is 50 million yuan, a year-on-year increase of 10%, but the asset-liability ratio is as high as 80%, and current liabilities rely on short-term financing' Industry classification label: 'Manufacturing - Electronic Equipment Manufacturing'. Public information: 'Enterprise A was once punished for environmental violations'", then the above data is used as input, and the large language model is used for multiple query predictions. The first label classification results obtained include: "Default: 92%" (4 times), "Default: 88%" (5 times), "Trustworthy: 65%" (1 time), "Default: 70%" (2 times), "Default: 80%" (3 times); it can be sorted based on frequency, and the sorting results are "Default: 88%" (5 times), "Default: 92%" (4 times), "Default: 80%" (3 times), "Default: 70%" (2 times), "Trustworthy: 65%" (1 time); k is selected as 3, and the label classification result is determined based on the first 3 first label classification results of the sort. Specifically, the confidence averaging method is adopted, and the label classification result of the first graph element enterprise A is determined to be "Default, 87%" by averaging the probability and confidence.
[0143] In the embodiments of this specification, by using the description text and initial classification results of the first graph element as input in the process of determining the label classification result of the first graph element, and using the large language model for multiple query predictions, the final label classification result is determined from the multiple first label classification results obtained, thereby effectively avoiding the problems of randomness and noise interference in the output of the large language model, and significantly improving the reliability and robustness of the label classification results, thereby correcting isolated errors that may exist in a single prediction, reducing the risk of misjudgment due to text ambiguity or model noise, and enhancing the credibility of pseudo labels generated by the large language model, providing higher quality supervised training sample data for graph model training, thereby improving the generalization ability and prediction accuracy of the target project graph model in complex association relationship modeling.
[0144] In an optional embodiment of the present specification, before inputting the description text of the first graphic element and the initial classification result of the first graphic element into the large language model to obtain the label classification result of the first graphic element, the method further includes:
[0145] Based on the global topological features of the sample graph data, multiple graph elements in the sample graph data are sampled and screened to obtain the sampled graph elements.
[0146] Global topological features are a set of indicators that reflect the overall characteristics of the graph structure of each graph element in the sample graph data. Its essence is to quantify the structural importance or connection pattern of graph elements in the global network through mathematical methods.
[0147] Optionally, global topological features may include node centrality, page ranking (PageRank) value, feature propagation (FeatProp) coefficient, clustering coefficient, etc. In the embodiments of this specification, global topological features are used to evaluate the influence or risk transmission ability of graph elements in the network, such as identifying core enterprises in the supply chain network through the PageRank algorithm, or measuring the possibility of risk diffusion in the guarantee chain through the feature propagation coefficient.
[0148] Specifically, cluster distance measures the distance between a node in the graph and the center of its cluster or other nodes in the community, reflecting the closeness of the node in the local community structure. It is usually calculated based on node features or topological position. The smaller the distance, the closer the node is to the community core. Page ranking is an importance assessment algorithm that transfers weights through the link relationship between nodes. The importance of a node is determined by the number and quality of its incoming links. Feature propagation is an importance assessment method based on the propagation of node features. It iteratively transfers node features along the edges and aggregates neighbor information, and finally measures the node importance based on feature strength (such as gradient, variance, etc.).
[0149] Optionally, the calculation of global topological features can be based on multiple data sources such as adjacency matrix, node attributes and edge weights, forming a multi-dimensional and multi-level analysis of the structure in the graph data.
[0150] For example, in a financial scenario, the PageRank value of node enterprise A reflects its central position in the guarantee network. When the PageRank value of enterprise A is high, it indicates that it occupies a core position in the guarantee network and may influence other enterprises through multi-layer guarantee relationships, which is relatively important.
[0151] Sampling and filtering is the process of evaluating and filtering the importance of graph elements in sample graph data based on global topological features. Essentially, it uses thresholding or ranking selection strategies to retain key graph elements to optimize data processing efficiency and quality. In the embodiments of this specification, sampling and filtering aims to reduce query overhead for large language models and filter low-quality or redundant data.
[0152] Specific strategies include: pre-sampling based on node importance (such as selecting enterprise nodes with the top 10% PageRank values), dynamic threshold screening based on feature propagation coefficients (such as only processing guarantee relationship edges with FeatProp higher than 0.7), etc.
[0153] For example, in financial scenarios, by calculating the PageRank values of all enterprise nodes, the top 20% of more important and high-risk enterprises are screened out for large language model processing. This not only retains the prediction processing information of key enterprises, but also avoids the computational burden brought by processing non-critical, low-value enterprises.
[0154] The sampled graph elements are a subset of graph elements retained by the screening strategy, which have high structural importance or transaction relevance. In the embodiments of this specification, the sampled graph elements typically include core entity nodes (such as key manufacturers in the supply chain), high-risk associated edges (such as large-value guarantee relationships), etc.
[0155] When sample graph data of the target project is obtained, multiple graph elements in the sample graph data may be sampled and screened to obtain sampled graph elements, so that the first graph element can be determined from the sampled graph elements in the subsequent determination.
[0156] Specifically, sampling and screening can select appropriate global topological feature indicators (such as PageRank, Feat Prop, etc.) based on the actual needs of the target project; calculate the selected indicator values of all graph elements in the sample graph data; and filter out graph elements that meet the selected global topological features based on preset thresholds or ranking ratios.
[0157] For example, take the prediction of loan defaults of small and medium-sized enterprises in financial scenarios as an example: the current sample graph data contains 1,000 enterprise nodes and 500 guarantee relationship edges, but only 10% of the nodes have real classification labels of whether they are in default, that is, the label data is relatively scarce; the sampling Page Rank is calculated to determine that the Page Rank value of enterprise A is 0.95, the Page Rank value of enterprise B is 0.2, the Page Rank value of enterprise C is 0.1, the Page Rank value of enterprise D is 0.8...; the enterprises are sorted by Page Rank value, and the filtering strategy of "retaining the top 20% of enterprises with Page Rank values" is used for sampling and filtering, discarding enterprises with low Page Rank values such as enterprise B and enterprise C, and retaining enterprises with high Page Rank values such as enterprise A and enterprise D; the sampled graph elements finally obtained include 200 enterprise nodes and 150 guarantee relationship edges, covering the key paths of the core guarantee chain in the current graph data.
[0158] In the embodiments of this specification, the global structural importance of graph elements is quantified and sampling and screening is performed through a sampling and screening mechanism based on global topological features. Core nodes or key associated edges are used as target graph elements for subsequent large language model processing. While retaining key graph elements, the computational overhead of redundant data is reduced, the interference of low-value or abnormal graph elements is filtered out, and the efficiency and accuracy of label generation are improved. On the premise of retaining the key topological relationships of graph data, the large language model is ensured to accurately model entities with higher importance or influence, and the stability and credibility of pseudo labels generated by the large language model are improved, providing more representative supervision signals for graph model training.
[0159] In an optional embodiment of the present specification, the description text of the first graphic element and the initial classification result of the first graphic element are input into the large language model to obtain the label classification result of the first graphic element, including:
[0160] Inputting the description text of the first image element and the initial classification result of the first image element into the large language model to obtain the label classification result and confidence of the first image element;
[0161] Before constructing the sample data of the target project based on the sample graph data and the label classification results of multiple graph elements, the following is also included:
[0162] Based on the confidence of multiple graphic elements and a preset confidence threshold, multiple graphic elements are filtered to obtain multiple filtered graphic elements, and sample graphic data composed of the multiple filtered graphic elements and label classification results of the multiple filtered graphic elements are determined.
[0163] Confidence is a quantitative assessment of the credibility of the large language model's label classification results for a particular graph element. It is typically expressed as a probability value (0-1) or a percentage, reflecting the model's level of certainty in the predicted result. In the embodiments of this specification, the confidence level can be output synchronously by the pre-trained graph model or large language model when generating the initial classification result or label classification result, and is used to measure the reliability of the classification result in terms of semantic logic and contextual association.
[0164] For example, in a financial scenario, when a large language model predicts that the label classification result of Enterprise A is "Default: 92%", the 92% is the confidence level, indicating that the model analyzes the relevant information of Enterprise A and the probability that it will default is 92%.
[0165] The calculation of confidence is usually based on the model's internal probability distribution or attention weight. High confidence (such as >90%) indicates that the model has strong consistency in the prediction results, while low confidence (such as <50%) may reflect that the input information is vague or contradictory.
[0166] The preset confidence threshold is a benchmark or critical value used to determine whether the label classification result is reliable. It is essentially a probability cutoff point set by a dynamic or static strategy. Optionally, the preset confidence threshold can be set manually or automatically by the model or system.
[0167] Specifically, the preset confidence threshold can be dynamically adjusted according to the model training stage and category characteristics. For example, in the early stages of training, the model's predictive ability is weak, and the threshold is set to a higher level (such as 80%) to avoid introducing incorrect labels; as the model performance improves, the threshold is gradually reduced to a reasonable range (such as 65%). In specific implementation, the system will record the average confidence and standard deviation of recent sample data of each category, and set the threshold to a combination of "mean-standard deviation", which not only reflects the model's average level of cognition of the current category, but also takes into account the stability of prediction.
[0168] While using the large language model to obtain the label classification result of the first graph element, the confidence corresponding to the label classification result is obtained synchronously; the label classification results of all graph elements and their confidence are stored as structured data (such as a list or matrix) to facilitate subsequent filtering operations.
[0169] When the confidence levels of multiple graph elements are obtained, they can be filtered based on a preset confidence threshold. Alternatively, label classification results with a confidence level ≥ the preset confidence threshold can be directly filtered. For example, if the preset confidence threshold is 80%, only label classification results with a confidence level ≥ 80% are retained. Alternatively, the confidence level can be combined with the category weight to weight label classification results with low confidence. For example, results with a confidence level between 0.70 and 0.80 can be given a lower weight, allowing them to participate in training but contribute less.
[0170] After completing the filtering of multiple graph elements, the filtered graph elements (nodes or edges) and their label classification results can be integrated with the sample graph data (topological structure, attribute information) to form filtered sample data.
[0171] For example, taking the prediction of loan defaults for small and medium-sized enterprises in financial scenarios as an example, when it is necessary to filter the label classification results of 200 graph element enterprises, according to the real-time threshold of the category (default / trusted) of each enterprise (70% for default category and 65% for trustworthy category), enterprises with confidence levels lower than the preset confidence threshold are filtered out, and finally 150 high-confidence label classification results are obtained after filtering for constructing sample data for training.
[0172] In the embodiments of this specification, through a confidence-based post-filtering mechanism, in scenarios where label data is scarce, by quantifying the credibility of the label classification results of the large language model and combining it with a dynamically or statically set preset confidence threshold, high-confidence pseudo-label classification results are effectively screened out, and low-confidence noise predictions are eliminated, thereby reducing the interference of erroneous labels caused by early model prediction bias or text ambiguity, optimizing the quality of sample data and the effect of model training, and improving the generalization ability and prediction accuracy of the graph model in label-sparse scenarios.
[0173] In an optional embodiment of the present specification, the description text of the first graphic element and the initial classification result of the first graphic element are input into the large language model to obtain the label classification result of the first graphic element, including:
[0174] Based on the description text of the first image element and the initial classification result of the first image element, constructing target prompt information according to a preset prompt information template, wherein the preset prompt information template is pre-set according to the context prompt strategy;
[0175] The target prompt information is input into the large language model to obtain the label classification result of the first image element.
[0176] A contextual prompting strategy is a strategy used by a large language model to guide the model to output specific results by using structured input information (such as task descriptions, examples, and category features) when generating label classification results. In the embodiments of this specification, contextual prompting strategies can include various types of prompting strategies, such as zero-shot prompting, few-shot prompting, and class prototype prompting.
[0177] Specifically, a zero-shot prompt directly inputs the first graph element and its description into the large language model, i.e., unlabeled data, without providing an analysis example of labeled data. For example, only the description text of Company A and the initial classification results are input, and the model is required to directly output the labeled classification results.
[0178] Few-shot prompts are inputs to a large language model that include a small amount of real-world labeled data as a reference for classification. This helps the model understand the task model and classification criteria. For example, when inputting the description of company A and the initial classification results, two or three corresponding examples of company descriptions with known real-world labels are also provided as reference for model reasoning.
[0179] Class prototype hints extract characteristic text from the target classification category, guiding the large language model to perform classification based on the semantic similarity of the descriptive text of the first graph element. For example, when predicting whether Company A will default, "typical characteristics of defaulting companies" can be provided as contextual hints.
[0180] The preset prompt information template is an input framework for prompt information that is pre-designed according to different context prompt strategies, and is used to uniformly organize descriptive text, initial classification results, and reference information (such as examples or category features). In an embodiment of this specification, the preset prompt template may include components such as task description, input information, and output content. Among them, the task description clearly defines the task to be completed by the large language model, such as "determine whether the enterprise has breached the contract"; the input information is the descriptive text containing the first graph element, the initial classification result, etc.; the output content guides the content or format of the output information of the large language model, such as "please output in the form of 'classification result + confidence'".
[0181] When the description text of the first graphic element and the initial classification result of the first graphic element are determined, the description text of the first graphic element and the initial classification result of the first graphic element can be constructed as template prompt information according to a preset prompt information template.
[0182] When the target prompt information is constructed, the target prompt information can be input into the large language model to obtain the label classification result of the first graph element.
[0183] In the embodiments of this specification, a preset prompt information template is pre-set based on a contextual prompt strategy, and the description text of the first image element and the initial classification result are constructed as template prompt information as the input of the large language model. Different prompt strategies are combined to flexibly adapt to specific task requirements, thereby optimizing the large language model's ability to parse complex texts, improving the accuracy and adaptability of the large language model in label classification tasks, and dynamically adjusting the preset prompt information template to enhance the robustness of the model in scenarios where label data is scarce.
[0184] In an optional embodiment of the present specification, the preset prompt information template includes a zero sample prompt information template, and the zero sample prompt information template is preset according to the zero sample prompt policy;
[0185] Based on the description text of the first image element and the initial classification result of the first image element, target prompt information is constructed according to the preset prompt information template, including:
[0186] The description text of the first image element and the initial classification result of the first image element are added to the zero-sample prompt information template to obtain target prompt information.
[0187] The zero-shot prompt template is a prompt input framework that doesn't rely on reference examples. Its essence is to directly guide the large language model to generate the target result through a clear task description and input information. In the embodiments of this specification, the template structure can include a task description, which defines the classification task to be completed by the model; input information, which includes the description text of the first image element and the initial classification result; and output content, which specifies the format of the model output.
[0188] The zero-shot prompting strategy is a method in which a large language model generates results directly from a task description and input information, without any reference examples. The core of the zero-shot prompting strategy is to leverage the model's prior knowledge and contextual understanding capabilities to directly perform semantic analysis on the input information and output classification results.
[0189] When the description text of the first image element and the initial classification result of the first image element are obtained, the description text of the first image element and the initial classification result of the first image element can be added to the zero-sample prompt information template to obtain the target prompt information.
[0190] For example, let's take the prediction of loan defaults for small and medium-sized enterprises in a financial scenario as an example: for the first element, Enterprise A, its initial classification result is "Default: 85%"; the description text is: "Financial report summary: 'Resource growth in 2024 is 50 million yuan, a year-on-year increase of 10%, but the asset-liability ratio is as high as 80%, and current liabilities rely on short-term financing' Industry classification label: 'Manufacturing - Electronic Equipment Manufacturing'. Public information: 'Enterprise A was once punished for environmental violations'" Using the zero-sample prompt information template pre-set according to the zero-sample prompt strategy, the target prompt information constructed is:
[0191] Task: You are a financial risk assessment expert. Based on the following company information and initial classification results, analyze the company.
[0192] Input: Company description text: 'Resource growth in 2024 is RMB 50 million, a year-on-year increase of 10%, but the debt-to-asset ratio is as high as 80%, and current liabilities rely on short-term financing';
[0193] Industry classification label: 'Manufacturing-Electronic Equipment Manufacturing';
[0194] Public information: 'Company A was previously penalized for environmental violations';
[0195] Initial classification result: 'Default: 85%'.
[0196] Output: Please output the classification results for the enterprise in the format of 'classification label + confidence'.
[0197] In the embodiments of this specification, a structured zero-sample prompt information template is used to directly guide the large language model to generate classification results based on the descriptive text of the first graphic element and the initial classification results, without relying on additional reference examples, thereby reducing dependence on labeled data, improving the adaptability and accuracy of the large language model in graphic element classification tasks, optimizing the large language model's ability to parse complex texts, improving the stability and credibility of classification results, reducing computing resource consumption, and providing high-quality pseudo-label support for graphic model training in label-sparse scenarios.
[0198] In an optional embodiment of the present specification, the preset prompt information template includes a small sample prompt information template, and the small sample prompt information template is pre-set according to the small sample prompt strategy;
[0199] Based on the description text of the first image element and the initial classification result of the first image element, target prompt information is constructed according to the preset prompt information template, including:
[0200] Obtaining description text of reference graph elements in the reference graph data of the target project and classification labels of the reference graph elements;
[0201] The description text of the first image element, the initial classification result of the first image element, the description text of the reference image element, and the classification label of the reference image element are added to at least the sample prompt information template to obtain target prompt information.
[0202] A few-shot prompt information template is an input framework that uses a small amount of real labeled data as reference examples. Its essence is to guide a large language model to learn task patterns and generate target results by combining task descriptions, input information, and reference examples. In the embodiments of this specification, the structure of a few-shot prompt information template may include: a task description, which defines the classification task to be completed by the model; input information, which includes descriptive text of the first image element and the initial classification result; reference examples, which provide descriptive text and real classification labels of a small number of reference image elements as context for model reasoning; and output content, which specifies the format of the model output.
[0203] The few-shot hinting strategy is a hinting method in which a large language model adds a small amount of real labeled data as reference examples to the input, guiding the model to understand task patterns and classification criteria through examples.
[0204] Reference graph elements are graph elements (nodes or edges) in the target project with real classification labels, which are essentially representative samples of high-quality labeled data.
[0205] The description text of the reference graph element is unstructured or semi-structured text information related to the reference graph element, which is used to supplement the semantic features of the entity object.
[0206] The classification label of the reference image element is the real classification result of the reference image element, which is essentially the real classification result verified by manual annotation or historical data.
[0207] For example, let's take the prediction of loan defaults for small and medium-sized enterprises in a financial scenario as an example: for the first element, Enterprise A, its initial classification result is "Default: 85%"; the description text is: "Financial report summary: 'Resource growth in 2024 is 50 million yuan, a year-on-year increase of 10%, but the asset-liability ratio is as high as 80%, and current liabilities rely on short-term financing' Industry classification label: 'Manufacturing - Electronic Equipment Manufacturing'. Public information: 'Enterprise A was once punished for environmental violations'" Using the zero-sample prompt information template pre-set according to the zero-sample prompt strategy, the target prompt information constructed is:
[0208] “Task: You are a financial risk assessment expert. Based on the following company information, initial classification results, and reference examples, analyze the company.
[0209] Input: Company description text: 'Resource growth in 2024 is RMB 50 million, a year-on-year increase of 10%, but the debt-to-asset ratio is as high as 80%, and current liabilities rely on short-term financing';
[0210] Industry classification label: 'Manufacturing-Electronic Equipment Manufacturing';
[0211] Public information: 'Company A was previously penalized for environmental violations';
[0212] Initial classification result: 'Default: 85%'.
[0213] Reference example:
[0214] Company B: Description text: "Debt-to-asset ratio 75%, multiple loan overdues"; Classification label: "Default: 70%."
[0215] Company C: Description text: "Debt-to-asset ratio 40%, revenue growth 20%"; Classification label: "Normal: 90%."
[0216] Output: Please output the classification results for the enterprise in the format of 'classification label + confidence'.
[0217] In the embodiments of this specification, by combining task descriptions, input information, descriptive text of reference graph elements, and classification labels as reference examples, the model is guided to learn task patterns and generate target results, effectively compensating for the problem of insufficient semantic understanding caused by lack of examples in complex tasks when labeled data is scarce, and improving the accuracy and robustness of the large language model in graph element classification tasks, so that the large language model can capture key features more accurately, reduce the risk of misjudgment of ambiguous descriptions, ensure the large model's clear understanding of task objectives and standardization of output results, and improve the model's generalization ability and prediction reliability under small sample conditions.
[0218] In an optional embodiment of the present specification, the preset prompt information template includes a class prototype prompt information template, and the class prototype prompt information template is preset according to the class prototype prompt policy;
[0219] Based on the description text of the first image element and the initial classification result of the first image element, target prompt information is constructed according to the preset prompt information template, including:
[0220] Obtaining description text of reference graph elements in the reference graph data of the target project and classification labels of the reference graph elements;
[0221] Based on the classification label of the reference image element, extracting the category feature text corresponding to the classification label from the description text of the reference image element;
[0222] The description text of the first image element, the initial classification result of the first image element, and the category feature text are added to the class prototype prompt information template to obtain target prompt information, wherein the preset classification reference information is constructed based on the reference image data.
[0223] The prototype prompt information template is an input framework that extracts the characteristic text of the target classification category (such as "Typical characteristics of defaulting enterprises") as context guidance. Its essence is to help the large language model classify based on the correlation between the descriptive text of the first image element and the category characteristic text through semantic similarity matching. In the embodiments of this specification, the task description defines the classification task to be completed by the model; the category characteristics are the characteristic text information corresponding to the classification label; the input information includes the descriptive text of the first image element and the initial classification result; the output content specifies the format of the model output, etc.
[0224] The class prototype hinting strategy is a method in which a large language model uses category feature text to guide the model's classification based on semantic similarity. The core of the class prototype hinting strategy is to extract typical feature text information of the corresponding target category from the description text of reference image elements with known correct labels, such as "Characteristics of defaulting companies include..." Classification results are generated by comparing the semantic similarity between the description text of the first input image element and the category feature text. This guidance from the category feature text enhances the model's ability to recognize specific categories, making it suitable for scenarios with significant semantic differences between categories.
[0225] The category feature text corresponding to the classification label is extracted from the descriptive text of the reference graph element and is a typical feature description that is strongly correlated with the classification label (such as "default"). For example, the default feature text might be: "asset-liability ratio > 75%, current liabilities rely on short-term financing, multiple loan delinquencies"; the trust feature text might be: "asset-liability ratio < 40%, continuous revenue growth, no major violations."
[0226] For example, let's take the prediction of loan defaults for small and medium-sized enterprises in a financial scenario as an example: for the first element, Enterprise A, its initial classification result is "Default: 85%"; the description text is: "Financial report summary: 'Resource growth in 2024 is 50 million yuan, a year-on-year increase of 10%, but the asset-liability ratio is as high as 80%, and current liabilities rely on short-term financing' Industry classification label: 'Manufacturing - Electronic Equipment Manufacturing'. Public information: 'Enterprise A was once punished for environmental violations'" Using the zero-sample prompt information template pre-set according to the zero-sample prompt strategy, the target prompt information constructed is:
[0227] “Task: You are a financial risk assessment expert. Based on the following company information, initial classification results, and reference examples, analyze the company.
[0228] Input: Company description text: 'Resource growth in 2024 is RMB 50 million, a year-on-year increase of 10%, but the debt-to-asset ratio is as high as 80%, and current liabilities rely on short-term financing';
[0229] Industry classification label: 'Manufacturing-Electronic Equipment Manufacturing';
[0230] Public information: 'Company A was previously penalized for environmental violations';
[0231] Initial classification result: 'Default: 85%'.
[0232] Category feature text:
[0233] Characteristics of defaulting companies: 'asset-liability ratio > 75%, reliance on short-term financing for current liabilities, and multiple loan defaults'.
[0234] Characteristics of normal enterprises: 'asset-liability ratio <40%, continuous revenue growth, and no major violation records'.
[0235] Output: Please output the classification results for the enterprise in the format of 'classification label + confidence'.
[0236] In the embodiments of this specification, by extracting typical feature text of the target category from the reference graph elements, a structured prototype-like prompt information template is constructed to construct template prompt information, and the large language model is guided to match the input information and category features based on semantic similarity, thereby enhancing the recognition ability of key classification features. By explicitly providing contextual guidance of the category feature text, the large language model can more accurately capture the correlation between the input information and the target category, reduce the risk of misjudgment due to vague descriptions or semantic ambiguity, and reduce dependence on complex pattern learning. In scenarios where label data is scarce, the semantic parsing ability and classification stability of the large language model in graph element classification tasks are improved.
[0237] In an optional embodiment of the present specification, based on the classification label of the reference image element, extracting the category feature text corresponding to the classification label from the description text of the reference image element includes:
[0238] Extracting classification feature information from the description text of the reference image element corresponding to the classification label;
[0239] The classification feature information is averaged to obtain the category feature text corresponding to the classification label.
[0240] Classification features are a collection of feature descriptions related to the classification label, extracted from the descriptive text of the reference graph elements. Classification features are generated by parsing the text of the reference graph elements to identify key features that characterize the target category (e.g., "asset-liability ratio > 75%" or "current liabilities rely on short-term financing"). These features are typically semantically related and must be strongly correlated with the classification label.
[0241] Specifically, when a reference image element with a real classification label is obtained, classification feature information can be extracted from the description text of the reference image element. Specifically, feature descriptions that are strongly correlated with the classification label can be identified through natural language processing technology (such as keyword extraction, semantic analysis) or rule matching.
[0242] When the classification feature information is extracted, the classification feature information can be averaged to obtain the category feature text.
[0243] Alternatively, a dynamic caching mechanism can be used to predict the correct feature information of reference image elements based on the dynamic cache records, gradually approximating the true feature distribution of the target category through iterative updates. Simultaneously, the feature information of all reference image elements with the same classification label is statistically summarized and averaged to generate representative category feature text.
[0244] In the embodiments of this specification, classification feature information that is strongly associated with the classification label is extracted from the description text of the reference image elements, and the classification feature information can be statistically summarized and iteratively optimized based on a dynamic caching mechanism to generate more representative category feature text, effectively filtering out the noise interference of a single sample, and through the dynamic approximation of the feature distribution, the semantic representation ability of the large language model for the target category is enhanced, and the dependence on complex pattern learning is reduced. The feature text after averaging processing can adapt to changes in data distribution in different scenarios, and support the model to quickly generate stable and explainable classification results under the conditions of a small number of samples.
[0245] See also Figure 2 , Figure 2 A flowchart of a graph model training method provided according to an embodiment of this specification is shown, which specifically includes the following steps.
[0246] Step 202: Obtain sample data of the target project, wherein the sample data includes sample graph data and label classification results of multiple graph elements in the sample graph data. The sample data of the target project is constructed based on the above-mentioned sample data construction method.
[0247] Step 204: Input the sample graph data into the graph model to obtain prediction classification results of multiple graph elements.
[0248] Step 206: Calculate the loss value based on the predicted classification result and the label classification result.
[0249] Step 208: Based on the loss value, train the graph model until a trained target graph model is obtained.
[0250] The predicted classification result is the output prediction result of the graph model for each graph element (node or edge) in the sample graph data during the training process. It reflects the graph model's judgment of the graph element category based on structural and feature information. The graph model generates classification labels and corresponding confidence levels (such as "Default: 92%) for multiple graph elements based on the label classification results of multiple graph elements in the sample data. The predicted classification results are compared with the label classification results in the sample data to measure the performance of the graph model and guide parameter updates.
[0251] The loss value is a quantitative indicator that measures the difference between the predicted classification results output by the graphical model and the actual label classification results. Specifically, the prediction error can be calculated through different types of loss functions (such as cross entropy loss, mean square error, etc.) and used for backpropagation to optimize model parameters.
[0252] The graphical model is trained on sample data constructed using the sample data construction method described above. During training, the loss between the predicted classification results generated by the graphical model for multiple graph elements in the sample data and the classification results of the supervised labels is used to fine-tune the graphical model using a gradient descent algorithm. This allows the graphical model's prediction performance to approach the true label results, ultimately obtaining the target graphical model for the target project.
[0253] Optionally, the parameters of the graphical model are fine-tuned, and the graphical model can be optimized by adopting parameter efficient fine-tuning (PEFT) technology (such as low-rank adaptation LoRA).
[0254] Specifically, during the training of the graphical model, a large language model is used for auxiliary fine-tuning. That is, during the training process, if there is a deviation between the prediction results of the large language model and the prediction results of the graphical model (such as LLM predicts "default: 95%" and the graphical model predicts "default: 70%"), the parameter adjustment is triggered, and only the low-rank matrix is trained through LoRA, and the fine-tuning parameters are injected into the original model, thereby reducing the computational cost; if the prediction result of the large language model is consistent with the true label, it can be considered that the graphical model already has task-related knowledge, and no additional fine-tuning is required, and the training is completed directly using sample data.
[0255] In the embodiments of this specification, the graph model is supervised and trained by constructing high-quality sample data to obtain a trained target graph model, thereby solving the problem of training the graph model in scenarios where labeled data is scarce.
[0256] See also Figure 3 , Figure 3 A flowchart of a graph data processing method provided according to an embodiment of this specification is shown, which specifically includes the following steps.
[0257] Step 302: Obtain target graph data of the target project.
[0258] Step 304: Input the target graph data into the target graph model of the target project to obtain a target classification result, wherein the target graph model is trained according to the above-mentioned graph model training method.
[0259] Step 306: Based on the target classification result, execute corresponding project operation strategies for the entity objects and / or the association relationships between entity objects in the target project.
[0260] Target graph data is a collection of graph-structured data collected from actual target transaction scenarios for a specific target project. This refers to the graph data within the target project currently being processed. For example, in the financial sector, target graph data might include a company's financial indicators, guarantee relationships, and public information; in the medical field, it might include patient health data, medical records, and drug interaction networks.
[0261] The target classification result is the target graph model's prediction output for each graph element (node or edge) in the target graph data. It is the graph model's classification judgment of the entity objects or relationships in the target graph data based on structural information and semantic features. For example, in the prediction of SME loan defaults, the target classification result might be "Enterprise A: Default, 85%."
[0262] A project action strategy is a specific target transaction decision or action plan based on the target classification results. It translates the model's classification output into an action guide for the actual target transaction scenario. For example, in the financial sector, if the model predicts that company A is at "high risk of default," the corresponding project action strategy for the target project might include rejecting the loan application, requiring additional collateral, or initiating post-loan monitoring. In the medical field, if a patient is predicted to be at "high risk of disease transmission," the action strategy might include quarantine observation or adjusting the treatment plan. Action strategies must be based on actual physical rules or conform to natural laws to ensure the compliance and effectiveness of decisions.
[0263] For example, in a financial scenario for small business loan default prediction, the target graph data includes:
[0264] Company A (registered capital of RMB 50 million, debt-to-asset ratio of 80%, revenue growth of 10%); Company A and Company B have a mutual guarantee relationship (guarantee amount of RMB 20 million); Description text: Company A's financial report summary, "previous penalty for environmental violations," etc.
[0265] Using the trained target graph model, the target classification results obtained are: Enterprise A is "Default: 92%";
[0266] The project operation strategies that can be implemented include: rejecting loan applications, requiring additional collateral, etc.
[0267] In the embodiments of this specification, by directly mapping the classification results of the target graph model to the actual target transaction operation strategy, an end-to-end closed loop from data modeling to target transaction decision-making is achieved.
[0268] Corresponding to the above method embodiment, this specification also provides a sample data construction device embodiment, Figure 4 FIG1 shows a schematic diagram of a structure of a sample data construction device provided by an embodiment of this specification. Figure 4As shown, the device includes:
[0269] The first acquisition module 402 is configured to: acquire sample graph data of a target project and description text of multiple graph elements in the sample graph data, wherein the multiple graph elements include nodes and edges, the nodes represent entity objects in the target project, and the edges represent association relationships between the entity objects;
[0270] The first prediction module 404 is configured to: input the sample graph data into a pre-trained graph model of the target project to obtain initial classification results of multiple graph elements;
[0271] The classification module 406 is configured to: input the description text of the first graphic element and the initial classification result of the first graphic element into the large language model to obtain a label classification result of the first graphic element, wherein the first graphic element is any one of the multiple graphic elements;
[0272] The construction module 408 is configured to construct sample data of the target project based on the sample graph data and label classification results of the multiple graph elements, wherein the sample data is used to train the graph model of the target project.
[0273] In an optional embodiment of the present specification, the sample data construction device also includes a pre-training module, which is configured to: obtain pre-trained graph data of the target project, and classification labels of multiple graph elements in the pre-trained graph data; based on the pre-trained graph data and the classification labels of multiple graph elements, perform supervised training on the initial graph model to obtain the pre-trained graph model of the target project.
[0274] In an optional embodiment of the present specification, the classification module 406 is further configured to: input the description text of the first graphic element, the description text of the adjacent graphic elements of the first graphic element, and the initial classification result of the first graphic element into the large language model to obtain the label classification result of the first graphic element.
[0275] In an optional embodiment of the present specification, the classification module 406 is further configured to: input the description text of the first graphic element and the initial classification result of the first graphic element into the large language model to obtain a first label classification result of the first graphic element; return to execute the step of inputting the description text of the first graphic element and the initial classification result of the first graphic element into the large language model to obtain a first label classification result of the first graphic element, until multiple first label classification results are obtained; and determine the label classification result of the first graphic element based on the frequency of the multiple first label classification results.
[0276] In an optional embodiment of the present specification, the sample data construction device further includes a sampling module configured to: sample and filter multiple graph elements in the sample graph data based on the global topological features of the sample graph data to obtain sampled graph elements.
[0277] In an optional embodiment of the present specification, the classification module 406 is further configured to: input the description text of the first graphic element and the initial classification result of the first graphic element into the large language model to obtain the label classification result and confidence of the first graphic element; the device also includes a filtering module, which is configured to: filter the multiple graphic elements based on the confidence of the multiple graphic elements and a preset confidence threshold to obtain multiple filtered graphic elements, and determine the sample graphic data composed of the multiple filtered graphic elements, and the label classification results of the multiple filtered graphic elements.
[0278] In an optional embodiment of the present specification, the classification module 406 is further configured to: construct target prompt information based on the description text of the first graphic element and the initial classification result of the first graphic element according to a preset prompt information template, wherein the preset prompt information template is pre-set according to the context prompt strategy; input the target prompt information into the large language model to obtain the label classification result of the first graphic element.
[0279] In an optional embodiment of the present specification, the preset prompt information template includes a zero-sample prompt information template, which is pre-set according to the zero-sample prompt strategy; the classification module 406 is further configured to: add the description text of the first image element and the initial classification result of the first image element to the zero-sample prompt information template to obtain the target prompt information.
[0280] In an optional embodiment of the present specification, the preset prompt information template includes a few-sample prompt information template, which is pre-set according to the few-sample prompt strategy; the classification module 406 is further configured to: obtain the description text of the reference image element in the reference image data of the target project, and the classification label of the reference image element; add the description text of the first image element, the initial classification result of the first image element, the description text of the reference image element, and the classification label of the reference image element to at least the sample prompt information template to obtain the target prompt information.
[0281] In an optional embodiment of the present specification, the preset prompt information template includes a class prototype prompt information template, which is pre-set according to the class prototype prompt strategy; the classification module 406 is further configured to: obtain the description text of the reference image element in the reference image data of the target project, and the classification label of the reference image element; based on the classification label of the reference image element, extract the category feature text corresponding to the classification label from the description text of the reference image element; add the description text of the first image element, the initial classification result of the first image element, and the category feature text to the class prototype prompt information template to obtain the target prompt information, wherein the preset classification reference information is constructed according to the reference image data.
[0282] In an optional embodiment of the present specification, the classification module 406 is further configured to: extract classification feature information from the description text of the reference image element corresponding to the classification label; and average the classification feature information to obtain the category feature text corresponding to the classification label.
[0283] The above is a schematic diagram of a sample data construction device according to this embodiment. It should be noted that the technical solution of the sample data construction device and the technical solution of the sample data construction method described above are based on the same concept. For details not described in detail in the technical solution of the sample data construction device, please refer to the description of the technical solution of the sample data construction method described above.
[0284] Corresponding to the above method embodiment, this specification also provides an embodiment of a graph model training device, Figure 5 FIG1 shows a schematic diagram of a diagram model training device provided by an embodiment of this specification. Figure 5 As shown, the device includes:
[0285] The second acquisition module 502 is configured to: acquire sample data of the target project, wherein the sample data includes sample graph data and label classification results of multiple graph elements in the sample graph data, and the sample data of the target project is constructed based on the above-mentioned sample data construction method;
[0286] The second prediction module 504 is configured to: input the sample graph data into the graph model to obtain prediction classification results of multiple graph elements;
[0287] The calculation module 506 is configured to: calculate a loss value based on the predicted classification result and the label classification result;
[0288] The training module 508 is configured to: train the graph model based on the loss value until a trained target graph model is obtained.
[0289] The above is a schematic diagram of a graphical model training device according to this embodiment. It should be noted that the technical solution of this graphical model training device and the technical solution of the graphical model training method described above are based on the same concept. For details not described in detail in the technical solution of the graphical model training device, please refer to the description of the technical solution of the graphical model training method described above.
[0290] Corresponding to the above method embodiment, this specification also provides an embodiment of a graph data processing device, Figure 6 FIG1 shows a schematic diagram of the structure of a graph data processing device provided by an embodiment of this specification. Figure 6 As shown, the device includes:
[0291] The third acquisition module 602 is configured to: acquire target graph data of the target project;
[0292] The third prediction module 604 is configured to: input the target graph data into the target graph model of the target project to obtain a target classification result, wherein the target graph model is trained according to the above-mentioned graph model training method;
[0293] The execution module 606 is configured to execute corresponding project operation strategies on the entity objects and / or the association relationships between the entity objects in the target project based on the target classification result.
[0294] The above is a schematic diagram of a graph data processing device according to this embodiment. It should be noted that the technical solution of this graph data processing device and the technical solution of the aforementioned graph data processing method are based on the same concept. For details not described in detail in the technical solution of the graph data processing device, please refer to the description of the technical solution of the aforementioned graph data processing method.
[0295] Figure 7 7 shows a block diagram of a computing device 700 according to one embodiment of the present disclosure. Components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and a database 750 is used to store data.
[0296] The computing device 700 also includes an access device 740 that enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 740 may include one or more of any type of network interface (e.g., a network interface card (NIC)) such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC).
[0297] In one embodiment of the present specification, the above components of the computing device 700 and Figure 7 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 7 The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art may add or replace other components as needed.
[0298] Computing device 700 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or personal computer (PC). Computing device 700 may also be a mobile or stationary server.
[0299] The processor 720 is configured to execute the following computer program / instructions, which implement the steps of the above method when executed by the processor.
[0300] The above is a schematic solution of a computing device of this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the above method belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the above method.
[0301] An embodiment of the present specification further provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above method when executed by a processor.
[0302] The above is a schematic solution of a computer-readable storage medium of this embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the above method belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the above method.
[0303] An embodiment of the present specification further provides a computer program product, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.
[0304] The above is an illustrative solution of a computer program of this embodiment. It should be noted that the technical solution of the computer program and the technical solution of the above method belong to the same concept, and any details not described in detail in the technical solution of the computer program can be referred to the description of the technical solution of the above method.
[0305] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0306] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media does not include electric carrier signals and telecommunication signals.
[0307] It should be noted that for the aforementioned method embodiments, for ease of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the embodiments of this specification.
[0308] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0309] The preferred embodiments disclosed above are intended only to help illustrate this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A method for constructing sample data, comprising: Obtaining sample graph data of a target project and description text of multiple graph elements in the sample graph data, wherein the multiple graph elements include nodes and edges, the nodes representing entity objects in the target project, and the edges representing association relationships between the entity objects; Inputting the sample graph data into a pre-trained graph model of the target project to obtain initial classification results of the plurality of graph elements; Inputting a description text of a first graphic element and an initial classification result of the first graphic element into a large language model to obtain a label classification result of the first graphic element, wherein the first graphic element is any one of the multiple graphic elements; Based on the sample graph data and the label classification results of the multiple graph elements, sample data of the target project is constructed, wherein the sample data is used to train a graph model of the target project.
2. The method according to claim 1, before inputting the sample graph data into the initial graph model of the target project to obtain the initial classification results of the plurality of graph elements, further comprising: Obtaining pre-trained graph data of a target project and classification labels of multiple graph elements in the pre-trained graph data; Based on the pre-trained graph data and the classification labels of the multiple graph elements, supervised training is performed on the initial graph model to obtain a pre-trained graph model of the target project.
3. The method according to claim 1, wherein inputting the description text of the first graphic element and the initial classification result of the first graphic element into the large language model to obtain the label classification result of the first graphic element comprises: The description text of the first graphic element, the description text of the adjacent graphic elements of the first graphic element, and the initial classification result of the first graphic element are input into a large language model to obtain a label classification result of the first graphic element.
4. The method according to claim 1, wherein inputting the description text of the first graphic element and the initial classification result of the first graphic element into the large language model to obtain the label classification result of the first graphic element comprises: Inputting the description text of the first image element and the initial classification result of the first image element into the large language model to obtain a first label classification result of the first image element; Returning to the step of inputting the description text of the first graphic element and the initial classification result of the first graphic element into the large language model to obtain the first label classification result of the first graphic element, until a plurality of first label classification results are obtained; Based on the frequencies of the plurality of first label classification results, a label classification result of the first graphic element is determined.
5. The method according to claim 1, before inputting the description text of the first graphic element and the initial classification result of the first graphic element into the large language model to obtain the label classification result of the first graphic element, further comprising: Based on the global topological features of the sample graph data, a plurality of graph elements in the sample graph data are sampled and screened to obtain sampled graph elements.
6. The method according to claim 1, wherein inputting the description text of the first graphic element and the initial classification result of the first graphic element into the large language model to obtain the label classification result of the first graphic element comprises: Inputting the description text of the first image element and the initial classification result of the first image element into the large language model to obtain the label classification result and confidence of the first image element; Before constructing the sample data of the target project based on the sample graph data and the label classification results of the plurality of graph elements, the method further includes: Based on the confidence of the multiple graphic elements and a preset confidence threshold, the multiple graphic elements are filtered to obtain multiple filtered graphic elements, and the sample graphic data composed of the multiple filtered graphic elements and the label classification results of the multiple filtered graphic elements are determined.
7. The method according to any one of claims 1 to 6, wherein inputting the description text of the first graphic element and the initial classification result of the first graphic element into the large language model to obtain the label classification result of the first graphic element comprises: Based on the description text of the first graphic element and the initial classification result of the first graphic element, constructing target prompt information according to a preset prompt information template, wherein the preset prompt information template is pre-set according to a context prompt strategy; The target prompt information is input into the large language model to obtain a label classification result of the first graphic element.
8. The method according to claim 7, wherein the preset prompt information template includes a zero sample prompt information template, and the zero sample prompt information template is pre-set according to a zero sample prompt policy; The step of constructing target prompt information based on the description text of the first graphic element and the initial classification result of the first graphic element according to a preset prompt information template includes: The description text of the first graphic element and the initial classification result of the first graphic element are added to the zero-sample prompt information template to obtain target prompt information.
9. The method according to claim 7, wherein the preset prompt information template includes a small sample prompt information template, and the small sample prompt information template is pre-set according to the small sample prompt strategy; The step of constructing target prompt information based on the description text of the first graphic element and the initial classification result of the first graphic element according to a preset prompt information template includes: Obtaining description text of reference image elements in reference image data of a target project, as well as classification labels of the reference image elements; The description text of the first image element, the initial classification result of the first image element, the description text of the reference image element, and the classification label of the reference image element are added to the few-sample prompt information template to obtain target prompt information.
10. The method according to claim 7, wherein the preset prompt information template comprises a class prototype prompt information template, and the class prototype prompt information template is pre-set according to a class prototype prompt strategy; The step of constructing target prompt information based on the description text of the first graphic element and the initial classification result of the first graphic element according to a preset prompt information template includes: Obtaining description text of reference image elements in reference image data of a target project, as well as classification labels of the reference image elements; Based on the classification label of the reference image element, extracting the category feature text corresponding to the classification label from the description text of the reference image element; The description text of the first graphic element, the initial classification result of the first graphic element, and the category feature text are added to the class prototype prompt information template to obtain target prompt information, wherein the preset classification reference information is constructed based on reference graphic data.
11. The method according to claim 10, wherein the step of extracting, based on the classification label of the reference image element, the category feature text corresponding to the classification label from the description text of the reference image element comprises: Extracting classification feature information from the description text of the reference image element corresponding to the classification label; The classification feature information is averaged to obtain the category feature text corresponding to the classification label.
12. A graph model training method, comprising: Acquire sample data of a target project, wherein the sample data includes sample graph data and label classification results of multiple graph elements in the sample graph data, and the sample data of the target project is constructed based on the sample data construction method according to any one of claims 1 to 11; Inputting the sample graph data into a graph model to obtain prediction classification results of the multiple graph elements; Calculating a loss value based on the predicted classification result and the label classification result; Based on the loss value, the graph model is trained until a trained target graph model is obtained.
13. A graph data processing method, comprising: Get the target graph data of the target project; Inputting the target graph data into the target graph model of the target project to obtain a target classification result, wherein the target graph model is trained by the graph model training method according to claim 12; Based on the target classification result, corresponding project operation strategies are executed on the entity objects in the target project and / or the association relationships between the entity objects.
14. A sample data construction device, comprising: A first acquisition module is configured to: acquire sample graph data of a target project and description texts of a plurality of graph elements in the sample graph data, wherein the plurality of graph elements include nodes and edges, the nodes representing entity objects in the target project, and the edges representing association relationships between the entity objects; A first prediction module is configured to: input the sample graph data into a pre-trained graph model of the target project to obtain initial classification results of the plurality of graph elements; a classification module configured to: input a description text of a first graphic element and an initial classification result of the first graphic element into a large language model to obtain a label classification result of the first graphic element, wherein the first graphic element is any one of the multiple graphic elements; The construction module is configured to: construct sample data of the target project based on the sample graph data and the label classification results of the multiple graph elements, wherein the sample data is used to train the graph model of the target project.
15. The apparatus according to claim 14, further comprising a pre-training module configured to: Obtaining pre-trained graph data of a target project and classification labels of multiple graph elements in the pre-trained graph data; Based on the pre-trained graph data and the classification labels of the multiple graph elements, supervised training is performed on the initial graph model to obtain a pre-trained graph model of the target project.
16. The apparatus according to claim 14, wherein the classification module is further configured to: The description text of the first graphic element, the description text of the adjacent graphic elements of the first graphic element, and the initial classification result of the first graphic element are input into a large language model to obtain a label classification result of the first graphic element.
17. The apparatus according to claim 14, wherein the classification module is further configured to: Inputting the description text of the first image element and the initial classification result of the first image element into the large language model to obtain a first label classification result of the first image element; Returning to the step of inputting the description text of the first graphic element and the initial classification result of the first graphic element into the large language model to obtain the first label classification result of the first graphic element, until a plurality of first label classification results are obtained; Based on the frequencies of the plurality of first label classification results, a label classification result of the first graphic element is determined.
18. The apparatus according to claim 14, further comprising a sampling module configured to: Based on the global topological features of the sample graph data, a plurality of graph elements in the sample graph data are sampled and screened to obtain sampled graph elements.
19. The apparatus according to claim 14, wherein the classification module is further configured to: Inputting the description text of the first image element and the initial classification result of the first image element into the large language model to obtain the label classification result and confidence of the first image element; The device further includes a filtering module configured to: Based on the confidence of the multiple graphic elements and a preset confidence threshold, the multiple graphic elements are filtered to obtain multiple filtered graphic elements, and the sample graphic data composed of the multiple filtered graphic elements and the label classification results of the multiple filtered graphic elements are determined.
20. The apparatus according to any one of claims 14 to 19, wherein the classification module is further configured to: Based on the description text of the first graphic element and the initial classification result of the first graphic element, target prompt information is constructed according to a preset prompt information template, wherein: The preset prompt information template is pre-set according to the context prompt strategy; The target prompt information is input into the large language model to obtain a label classification result of the first graphic element.
21. A graphical model training device, comprising: A second acquisition module is configured to: acquire sample data of a target project, wherein the sample data includes sample graph data and label classification results of multiple graph elements in the sample graph data, and the sample data of the target project is constructed based on the sample data construction method according to any one of claims 1 to 11; A second prediction module is configured to: input the sample graph data into a graph model to obtain prediction classification results of the plurality of graph elements; A calculation module is configured to: calculate a loss value based on the predicted classification result and the label classification result; The training module is configured to: train the graph model based on the loss value until a trained target graph model is obtained.
22. A graph data processing device, comprising: The third acquisition module is configured to: acquire target graph data of a target project; A third prediction module is configured to: input the target graph data into a target graph model of the target project to obtain a target classification result, wherein the target graph model is trained using the graph model training method according to claim 12; The execution module is configured to: execute corresponding project operation strategies on the entity objects in the target project and / or the association relationships between the entity objects based on the target classification result.
23. A computing device comprising: memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method according to any one of claims 1 to 13 are implemented.
24. A computer-readable storage medium storing a computer program / instruction, wherein the computer program / instruction is executed by a processor to implement the steps of the method according to any one of claims 1 to 13.
25. A computer program product comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 13.
