Intelligent construction method and system for electric power marketing knowledge graph based on large model Agent

Through the intelligent construction method of power marketing knowledge graph based on the big model Agent, the problems of high labeling costs, insufficient generalization capabilities and low accuracy in the existing relationship extraction technology are solved, and efficient and automated relationship extraction and knowledge graph construction are achieved, which is suitable for high-precision requirements of complex scenarios.

CN119721212APending Publication Date: 2025-03-28STATE GRID JIANGSU ELECTRIC POWER CO LTD MARKETING SERVICE CENT +1
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411855257.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The existing relationship extraction technology has problems such as high annotation cost, insufficient model generalization capability, low relationship extraction accuracy and lack of automated optimization mechanisms, which is difficult to meet the high-precision needs of complex scenarios.

Method used

The intelligent construction method of power marketing knowledge graph based on the big model Agent is adopted. By building the small model to be trained and the pre-trained big model Agent, the big model Agent is used to obtain the initial labeled data and supervise and train the small model. Combining performance evaluation and data expansion mechanisms, model performance is optimized until the preset standards are met.

Benefits of technology

It significantly improves the accuracy, generalization ability and optimization efficiency of the model in the relationship extraction task, is suitable for the high-precision relationship extraction requirements of complex scenarios, reduces the cost of manual labeling, and improves the consistency of data quality and knowledge graphs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119721212A_ABST
    Figure CN119721212A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent construction method and system for a knowledge graph in the field of power marketing based on a large model Agent. The method comprises the following steps: constructing a to-be-trained small model and a pre-trained large model Agent; obtaining initial annotation data and performing supervised training on the small model to obtain a trained small model; constructing a performance evaluation function to evaluate the relation extraction performance of the trained small model; reviewing and correcting results generated by the trained small models to obtain corrected data; combining the corrected data with the initial annotation data to obtain an expanded data pool, and extracting training data to retrain the trained small model; according to a performance evaluation result, the large model Agent repeatedly expands the data pool and trains the small model until a preset standard is reached; and constructing a knowledge graph in the field of power marketing based on the trained small model. According to the method, the accuracy, generalization ability and optimization efficiency of the model in the relation extraction task are improved, and the method is particularly suitable for high-precision relation extraction requirements in the field of power marketing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power marketing knowledge graphs, and more specifically, to a method and system for intelligently constructing a power marketing knowledge graph based on a large model Agent. Background Art

[0002] Relation Extraction (RE) is a key task in the field of Natural Language Processing (NLP), which aims to identify semantic relationships between entity pairs from unstructured text. Relation extraction is widely used in knowledge graph construction, information retrieval, recommendation systems and other fields. However, accurate and effective extraction of relationship labels faces challenges such as high data annotation cost, poor model adaptability and insufficient generalization ability.

[0003] Traditional relationship extraction methods rely on a large amount of manually annotated data to train models, which have great limitations in terms of high annotation costs and difficulty in scalability. At the same time, with the complexity of application scenarios, when encountering unseen relationship types or non-predefined entity categories, the model often exhibits problems such as insufficient generalization ability and low extraction accuracy. Therefore, an efficient and automated solution is needed that can reduce annotation costs and improve model adaptability while ensuring extraction accuracy.

[0004] The current mainstream relationship extraction technologies can be divided into the following categories:

[0005] 1. Rule-based methods: Early relationship extraction usually relied on manually constructed rules and templates to match predefined entities and relationships to text. This method can guarantee a certain degree of accuracy, but it relies on domain experts to build rules, is difficult to cope with large-scale data, has insufficient generalization capabilities, and cannot adapt to unseen relationship types.

[0006] 2. Supervised learning-based methods: With the development of machine learning, supervised learning-based relationship extraction methods have gradually become mainstream. For example, pre-trained models such as BERT add relationship predictions to the classification layer, allowing the model to be trained on labeled data sets and identify relationship labels. However, this method relies on a large amount of high-quality labeled data, which has high labeling costs; and the model requires pre-defined relationship categories, which makes it less adaptable when encountering new relationship types.

[0007] 3. Methods based on remote supervision: In order to reduce the cost of manual labeling, some methods try to use the relationship information in the knowledge base to automatically generate training data. This method is called remote supervision. Remote supervision automatically labels data, but the noise is large, which can easily lead to the introduction of wrong labels during model training, affecting the extraction accuracy.

[0008] In summary, the existing relationship extraction technology has at least the following deficiencies:

[0009] 1. High labeling cost and unstable labeling quality:

[0010] The relationship extraction method based on supervised learning requires a large amount of high-quality labeled data to ensure the accuracy of the model, while the traditional relationship extraction method relies on a large amount of manually labeled data to support model training. However, the manual labeling process is time-consuming and labor-intensive, not only extremely costly, but also easily affected by subjective factors, resulting in inconsistent labeling quality. At the same time, manual labeling is difficult to ensure the comprehensiveness and accuracy of data when the amount of data is large. Unstable labeling quality will directly affect the model training effect and reduce the accuracy and availability of relationship extraction;

[0011] 2. The model has insufficient generalization ability and is prone to overfitting:

[0012] Traditional relationship extraction methods are often trained based on static, fixed annotated data, based on predefined relationship types and entity categories, and lack a mechanism for dynamic data pool updates. In scenarios with small data sets or specific data sources, when encountering unseen data distributions or new relationship types, the model often has difficulty adapting to tasks with different data distributions and lacks the ability to generalize to new types of relationships. When encountering changes in data distribution or new samples, the accuracy is prone to decline, and the generalization is poor, making it impossible to effectively apply to actual needs.

[0013] 3. The accuracy of relationship extraction is low and the engineering application effect cannot be guaranteed:

[0014] Although technologies such as remote supervision can reduce labeling costs, they often introduce a lot of noise, making it difficult to achieve high accuracy after model training; in addition, in complex scenarios or scenarios with dense relationships, traditional models perform poorly in relationship recognition; in scenarios with complex domains and dense relationships, such as power marketing, traditional methods are often unable to accurately extract relationship labels, and the models are easily affected by noisy data, making it difficult to guarantee extraction accuracy and recall. This defect limits the application of the model in scenarios with high precision requirements. The low accuracy of relationship extraction affects the reliability of the model, making its effect unstable in actual engineering applications and difficult to meet the high-precision requirements of complex scenarios;

[0015] 4. Lack of automated optimization mechanism and low training efficiency:

[0016] In the existing technology, the performance optimization of the model usually relies on manual parameter adjustment and data annotation update, which is not only inefficient, but also lacks a systematic optimization mechanism. In addition, when the model performance is insufficient, it relies on manual parameter adjustment and data update, lacking an automatic feedback mechanism to improve the model performance; lacking automated optimization means, it is impossible to achieve rapid iterative optimization, resulting in a long and inefficient model training and tuning process, which is difficult to meet the engineering needs of rapid iteration.

[0017] 5. Models are difficult to adapt to limitations of new relationship types

[0018] Most existing models (such as BERT) rely on predefined entity and relationship categories for training. This approach lacks adaptability when encountering new relationship types and is difficult to generalize to new relationship requirements. In addition, for non-predefined entity categories, traditional models have poor scalability and insufficient processing flexibility. When new relationship types or non-predefined entity categories appear in the application scenario, it is difficult for the model to effectively identify them, resulting in a decrease in extraction performance. Summary of the invention

[0019] In order to solve the deficiencies in the prior art, the present invention provides a method for intelligently constructing a knowledge graph in the field of power marketing based on a large model Agent, which can solve the technical problem of insufficient model extraction performance in the prior art.

[0020] The present invention adopts the following technical solution.

[0021] A method for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent includes the following steps:

[0022] Step 101, construct a small model to be trained and a pre-trained large model Agent;

[0023] Step 102: The large model agent obtains the initial labeled data and performs supervised training on the small model. The small model is trained by minimizing the cross entropy loss between the relationship labels predicted by the model and the true relationship labels to obtain a trained small model.

[0024] Step 103, construct a performance evaluation function to evaluate the relationship extraction performance of the trained small model. If it passes, proceed to step 104, otherwise, retrain the small model;

[0025] Step 104, the results generated by the trained small model are reviewed and corrected by the large model Agent to obtain corrected data;

[0026] Step 105, merging the corrected data with the initial labeled data to obtain an extended data pool, and the large model Agent extracts training data from the extended data pool to retrain the trained small model;

[0027] Step 106, the large model Agent repeatedly expands the data pool and trains the small model according to the performance evaluation result obtained in step 103, until the performance index of the small model after training reaches the preset standard;

[0028] Step 107, constructing a knowledge graph in the field of power marketing based on the trained small model.

[0029] Preferably, the acquisition of the initial annotation data includes: using a data collection tool F of a large model Agent collect Collect text data in the field of power marketing, and label the collected text data to obtain initial labeled data

[0030] Among them, tags include company, location, date, and service.

[0031] Preferably, the data collection tool F for pre-training large model Agent collect , collect training data Send it for supervised training and call the model training tool F at the same time train The small model M is trained by minimizing the cross entropy loss between the relationship labels predicted by the model and the true relationship labels. s (θ), so that it has basic knowledge extraction capabilities. The trained small model M s '(θ) is able to identify entity pairs from text and generate preliminary relation labels.

[0032] Preferably, the construction of the performance evaluation function evaluates the relationship extraction performance of the trained small model, specifically including:

[0033] The training loss goal is to reduce the cross entropy loss between the predicted relationship label and the true relationship label. The trained small model M is s The input data of '(θ) is x i , the output data is y i =M s '(θ,x i ), the true label is y t , the performance evaluation function L is:

[0034]

[0035] Among them, N represents the number of samples, C represents the number of labels, yt represents the true label, and L represents the performance evaluation function value;

[0036] If the calculated performance evaluation function L value is less than the preset loss function threshold, it means that the evaluation has not passed and the training is ended. At this time, it is necessary to re-acquire the training data or manually adjust the parameters of the small model to re-train. If the performance evaluation function L value is greater than or equal to the preset performance evaluation function threshold, proceed to the next step.

[0037] Preferably, the results generated by the trained small model specifically include:

[0038] Get a piece of text data {X1, x2, ...x n}, where x i Represents the i-th word of the text;

[0039] The text data is word-embedded and position-encoded to obtain the input text E of the small model. The input text E is expressed as:

[0040] E = {e1, e2, ..., e n}

[0041] Among them, e i =Embed(x i )+PosEnc(i), Embed() means converting a token into a string of vectors, and PosEnc() means encoding a token by position;

[0042] The trained small model encodes the input text E into a set of latent vectors H, which are the generated results:

[0043] H = {h1, h2, ..., h n =GLiNER(E)

[0044] Among them, h i Represents the representation of each word after GLiNER encoding.

[0045] Preferably, the large model Agent reviews and corrects the results generated by the trained small model, including:

[0046] The large model Agent calls F eval For the trained small model M s '(θ) The results generated are reviewed and the incorrect relationship labels are corrected, including:

[0047] Assume that the two entities for relationship extraction are e1 and e2. Combining entities e1 and e2, the predicted probability distribution of the relationship is obtained through the large model Agent. And the predicted probability distribution obtained by the small model And the predicted probability distribution obtained by the large model Agent Perform dynamic weight fusion to obtain the predicted probability distribution y;

[0048] According to the predicted probability distribution y of the relationship, the relationship when y is the largest is obtained as the classification category; and the trained small model M is judged according to the classification category s '(θ) is generated correctly, and the wrong relationship labels are corrected. The corrected data is used as the high-precision new annotation data D trainnew .

[0049] Preferably, the predicted probability distribution obtained for the small model is And the predicted probability distribution obtained by the large model Agent Perform dynamic weight fusion to obtain the predicted probability distribution y, as follows:

[0050]

[0051] Among them, w GLiNER (x) is the dynamic weight of GLiNER, w Agent (x) is the dynamic weight of the Agent; and w GLiNER (x) and w Agent (x) Satisfy:

[0052] w GLiNER (x)+w Agent (x)=1.

[0053] Preferably, the calculation formula of the performance index is as follows:

[0054]

[0055] Among them, Recall represents the recall rate, that is, the probability of predicting the correct label, TP is the entity pair and its relationship label correctly predicted by the model, and FN is the real relationship label that the model failed to correctly predict.

[0056] The present invention also proposes a system for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent, which is used to implement the method for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent, including: a model construction module, a training module, a performance evaluation module, a correction module, a data expansion module, and a knowledge graph construction module;

[0057] The model building module is used to build small models to be trained and pre-trained large model agents;

[0058] The training module is used to obtain the initial labeled data and perform supervised training on the small model. The model is trained by minimizing the cross entropy loss between the relationship labels predicted by the model and the true relationship labels to obtain the trained small model.

[0059] The performance evaluation module is used to construct a performance evaluation function to evaluate the relationship extraction performance of the trained small model;

[0060] The correction module reviews and corrects the results generated by the trained small model based on the large model agent to obtain the corrected data;

[0061] The data expansion module is used to merge the corrected data with the initial labeled data to obtain an expanded data pool. The training module extracts training data from the expanded data pool to retrain the trained small model. The large model agent repeatedly expands the data pool and trains the small model according to the performance evaluation results until the performance indicators of the trained small model meet the preset standards.

[0062] The knowledge graph construction module builds a knowledge graph in the field of power marketing based on the trained small model.

[0063] The present invention also provides a terminal, comprising a processor and a storage medium;

[0064] The storage medium is used to store instructions;

[0065] The processor is used to operate according to the instructions to execute the steps of the method for intelligently constructing a knowledge graph in the power marketing field based on a large model agent.

[0066] The present invention also proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the method for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent are implemented.

[0067] The beneficial effect of the present invention is that, compared with the prior art, the present invention, based on the existing relationship extraction scheme, significantly improves the accuracy, generalization ability and optimization efficiency of the model in the relationship extraction task through innovative design, and is particularly suitable for the high-precision relationship extraction requirements of complex scenarios in the field of power impact.

[0068] The present invention has at least the following beneficial effects:

[0069] 1. The Agent in the present invention has the ability to automatically collect and annotate data. By calling data collection tools and rule correction mechanisms, it can screen and correct the initially generated relationship tags and gradually form high-quality annotated data. This method greatly reduces the burden of manual annotation and makes data collection and annotation more efficient and reliable.

[0070] 2. The GLiNER model used in the present invention can extract entities that are not limited to predefined categories in parallel and train them in a dynamically expanding data pool, so that the model can adapt to the ever-increasing relationship types. This flexibility enables the model to effectively handle new relationship types and avoids the problem of reduced accuracy of traditional models when processing new data.

[0071] 3. At the model application level, the present invention injects a large amount of corpus data in the field of power marketing into the Agent model, conducts post training on these corpora to support knowledge bases and prompt optimization in specific fields, and implements targeted fine-tuning training and special data preprocessing processes for the GLiNER model. The present invention innovatively designs a feedback optimization mechanism between the two models to achieve a closed-loop system of mutual verification and error correction. These improvements make the two models not simply superimposed when working together, but form an optimized overall system that can better serve the construction process of the knowledge graph.

[0072] 4. The present invention expands the data pool automatically, and merges the high-quality data corrected by the Agent with the initial data to form a new training set in each iteration. This solution has the following advantages: the Agent model is used to evaluate the newly added data in multiple dimensions, including the accuracy, completeness and consistency of the data, to ensure the quality of the expanded data; secondly, an adaptive data screening process is established to dynamically adjust the data adoption threshold according to the recognition results of the GLiNER model, avoiding the data noise that may be caused by simple accumulation in traditional methods; finally, a data conflict detection and coordination mechanism is innovatively introduced. When there is a contradiction between the new and old data, the system will automatically start the verification program and determine the final adoption strategy through multi-source information cross-validation. This refined data governance solution enables the present invention to maintain higher data quality and consistency of the knowledge graph during data expansion, which is significantly different from the simple data accumulation method in the prior art. Through this mechanism, the model can continuously accept rich data distribution, improve generalization ability, and avoid the limitations of traditional static training.

[0073] 5. The present invention designs an automated optimization process based on performance indicators. When the performance is lower than the preset threshold, the Agent will evaluate the model output through tools, and continuously correct and retrain the small model in multiple rounds of iterations until the performance meets the requirements. This process does not require manual intervention, automates the optimization of model performance, and ensures model accuracy.

[0074] 6. In this invention, a dynamic weight fusion strategy is used for comprehensive optimization. The Agent will weight the relationship labels output by GLiNER according to the task context and model prediction results, thereby achieving more efficient knowledge extraction. This mechanism greatly improves the adaptability and reliability of the system in complex scenarios and overcomes the problem of unstable output of traditional single models. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] Figure 1 It is a flow chart of the intelligent construction method of the knowledge graph in the field of power marketing based on the large model Agent in the present invention;

[0076] Figure 2 It is the architecture diagram of the GLiNER model in the present invention;

[0077] Figure 3 It is a structural diagram of the intelligent construction system of the knowledge graph in the power marketing field based on the large model Agent in the present invention. DETAILED DESCRIPTION

[0078] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The embodiments described in this application are only part of the embodiments of the present invention, not all of them. Based on the spirit of the present invention, other embodiments obtained by ordinary technicians in this field without creative work are all within the scope of protection of the present invention.

[0079] like Figure 1 As shown, the present invention proposes a method for intelligently constructing a knowledge graph of power marketing based on a large model agent, which is characterized by comprising the following steps:

[0080] Step 101: Obtain a pre-trained large model Agent in the field of power marketing. The large model Agent has multiple tools ready for use: Data Collection Tool F collect , Model Training Tool train , Model evaluation tool F eval .

[0081] Among them, data from the power marketing field is obtained in advance to train the big model Agent, and a large amount of corpus data from the power marketing field is injected into the big model Agent. Post Training is carried out on these corpora to carry out knowledge base support and prompt optimization in specific fields. The input of the pre-trained big model Agent is text data, and the output is the correct label corresponding to the text data.

[0082] Initialize the GLiNER model as the small model to be trained, denoted as M s (θ).

[0083] The GLiNER model is a model that improves the bidirectional Transformer architecture. For NER tasks, compared with traditional models such as BERT, this model supports parallel entity extraction and is not limited to predefined entity categories. The architecture of the small model is as follows Figure 2 shown.

[0084] Step 102: The large model Agent calls the data collection tool Fcollect , collect text data and label it to get the initial labeled data Initially label the data Send the small model M to be trained s (θ) performs supervised training and calls the model training tool F train The small model M is trained by minimizing the cross entropy loss between the relationship labels predicted by the model and the true relationship labels. s (θ), so that it has basic knowledge extraction capabilities. The trained small model M s '(θ) is able to identify entity pairs from text and generate preliminary relation labels.

[0085] The labeled tag types include company, location, date, and service. The sample data set collected by the Agent is shown in Table 1 below:

[0086] Table 1: Examples of power marketing-related data collected by the large model agent

[0087]

[0088] Step 103: Get test data for the trained small model M s '(θ) performs relation extraction operations, generates prediction results, and constructs a performance evaluation function to evaluate the relation extraction performance of the small model;

[0089] Specifically, the Agent calls the training data Extract a new data set (test data set) D test And construct a performance evaluation function L to evaluate the relationship extraction performance of the small model.

[0090] Specifically, D test Input to the trained small model M s '(θ) performs relation extraction operation and converts the trained small model M s The prediction results generated by '(θ) are stored, including the entity pairs extracted from each verification data and their predicted relationship labels.

[0091] The training loss goal is to reduce the cross entropy loss between the predicted relationship label and the true relationship label, denoted by M s The input data of '(θ) is x i , the output of the model is y i =M s '(θ,x i ), the true label is y t , the constructed performance evaluation function L is as follows:

[0092]

[0093] Among them, N represents the number of samples, C represents the number of labels, and y t represents the true label.

[0094] If the calculated performance evaluation function L value is less than the preset loss function threshold, the training is terminated early here. At this time, it is necessary to re-acquire the training data or manually adjust the parameters of the small model to re-train. If the performance evaluation function L value is greater than or equal to the preset performance evaluation function threshold, enter step 104.

[0095] Step 104: The large model agent calls F based on its built-in language knowledge and context understanding capabilities and pre-defined extraction rules. eval After step 103 training, the small model M s The results generated by '(θ) are reviewed, and the obviously wrong relationship labels are corrected. The data corrected by the large model agent is used as the high-precision new annotation data D trainnew These results will be used to expand the data pool D in the next step. pool .

[0096] Get the trained small model M s The results generated by '(θ) include:

[0097] Assume that the text to be processed is a text sequence {X1, x2, ...x n}, where x i Represents the i-th word;

[0098] The text sequence {x1, x2, …x n}After processing, we get input E, which satisfies:

[0099] E = {e1, e2, ..., e n} (2)

[0100] Entity i satisfy:

[0101] e i =Embed(x i )+PosEnc(i)

[0102] Among them, Embed() means converting a token into a string of vectors, and PosEnc() means position encoding a token.

[0103] Input the processed input E to the trained small model M s '(θ), the small model M after training s'(θ) Encode the input E into a set of latent vectors H as the trained small model M s The generated result of '(θ) is:

[0104] H = {h1, h2, ..., h n =GLiNER(E) (3)

[0105] Among them, h i Represents the small model M after training the i-th word in the input E s '(θ) The encoded representation.

[0106] Further, calling F eval For the trained small model M s '(θ) The results generated are reviewed and the obviously wrong relationship labels are corrected, including:

[0107] Assume that the relationship to be extracted involves two entities e1 and e2, then concatenate h1 and h2 corresponding to entities e1 and e2 to form a high-dimensional vector input z:

[0108] z=[h1;h2] (4)

[0109] Input the high-dimensional vector input z into the fully connected layer or classifier of the large model Agent to predict the relationship category:

[0110]

[0111] Among them, W and b are the parameters of the classification layer, Represents the predicted probability distribution of the relationship obtained by the small model.

[0112] h1 and h2 are high-dimensional vectors corresponding to the corresponding entities, z represents the high-dimensional vector input after splicing, and softmax is a normalization function used to map the probability to the range of 0 to 1.

[0113] Furthermore, through comprehensive optimization through dynamic weight fusion strategy, the large model Agent weights the relationship labels output by the small model according to the task context and model prediction results, thereby achieving more efficient knowledge extraction.

[0114] Specifically, combining entities e1 and e2, the predicted probability distribution of the relationship is obtained through the large model Agent And and Perform dynamic weight fusion to obtain the predicted probability distribution y:

[0115]

[0116] Among them, w GLiNER(x) is the dynamic weight of GLiNER, which depends on the input context x, w Agent (x) is the dynamic weight of the agent, which depends on the input context x and the prediction result;

[0117] And w GLiNER (x) and w Agent (x) Satisfy:

[0118] w GLiNER (x)+w Agent (x) = 1

[0119] Furthermore, according to the predicted probability distribution y of the relationship, the relationship when y is the largest is obtained as the classification category; and the trained small model M is determined according to the classification category. s '(θ) is generated correctly, and the wrong relationship labels are corrected. The corrected data is used as the high-precision new annotation data D trainnew .

[0120] Step 105: The corrected new annotation data D trainnew With the initial annotation data Merge D train , forming an extended data pool

[0121] The expanded data pool contains diverse annotated data, which can enhance the generalization ability of the small model for different relationship types. newpool Call F collect Randomly extract some data to form a high-quality training data set Based on high-quality training data sets For the trained small model M s '(θ) for retraining.

[0122] Step 106: The large model Agent repeats the above steps 103 to 105 according to the performance evaluation results of step 103, thereby gradually expanding the labeled data pool and continuously optimizing the small model M. s The extraction capability of (θ) is used to calculate the performance index Recall of the small model until the performance index of the small model reaches or exceeds the preset threshold after a certain training. Then the iteration is terminated to obtain the small model that has completed the training.

[0123] In the relation extraction task, TP is the entity pair and its relation label correctly predicted by the model, and FN is the real relation label that the model failed to correctly predict. It can be calculated as:

[0124]

[0125] Among them, Recall represents the recall rate, that is, the probability of predicting the correct label. TP is the entity pair and its relationship label correctly predicted by the model, and FN is the relationship label that the model fails to correctly predict.

[0126] Step 107, construct a knowledge graph based on the trained small model.

[0127] Specifically, the core of constructing the knowledge graph is to organize the extraction results of the small model for the input text book into the form of triples (h, r, t), where h represents the head entity, r represents the relation, and t represents the tail relation. The entities and relations output from the small model can be directly mapped to the nodes and edges of the knowledge graph:

[0128]

[0129] in, is the set of predicted entities, is the set of predicted relations.

[0130] like Figure 3 As shown, the present invention also proposes a system for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent, which is used to implement the above-mentioned method for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent, and is characterized by comprising: a model construction module, a training module, a performance evaluation module, a correction module, a data expansion module, and a knowledge graph construction module;

[0131] Among them, the model building module is used to build the small model to be trained and the pre-trained large model Agent;

[0132] The training module is used to obtain the initial labeled data and perform supervised training on the small model. The model is trained by minimizing the cross entropy loss between the relationship labels predicted by the model and the true relationship labels to obtain the trained small model.

[0133] The performance evaluation module is used to construct a performance evaluation function to evaluate the relationship extraction performance of the trained small model;

[0134] The correction module reviews and corrects the results generated by the trained small model based on the large model agent to obtain the corrected data;

[0135] The data expansion module is used to merge the corrected data with the initial labeled data to obtain an expanded data pool. The training module extracts training data from the expanded data pool to retrain the trained small model. The large model agent repeatedly expands the data pool and trains the small model according to the performance evaluation results until the performance indicators of the trained small model meet the preset standards.

[0136] The knowledge graph construction module builds a knowledge graph in the field of power marketing based on the trained small model.

[0137] The beneficial effect of the present invention is that, compared with the prior art, the present invention, based on the existing relationship extraction scheme, significantly improves the accuracy, generalization ability and optimization efficiency of the model in the relationship extraction task through innovative design, and is particularly suitable for the high-precision relationship extraction requirements of complex scenarios in the field of power impact.

[0138] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0139] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive lists) of computer readable storage medium include: portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), static random access memories (SRAM), portable compact disk read-only memories (CD-ROM), digital versatile disks (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or convex structures in grooves on which instructions are stored, and any suitable combination thereof. Computer readable storage medium used here is not interpreted as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagated by waveguides or other transmission media (e.g., light pulses by optical fiber cables), or electrical signals transmitted by wires.

[0140] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0141] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages-such as Smalltalk, C++, etc., and conventional procedural programming languages-such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network-including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA) may be personalized by utilizing the state information of a computer-readable program instruction, and the electronic circuit may execute a computer-readable program instruction, thereby realizing various aspects of the present disclosure.

[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent, characterized in that: The steps include: Step 101, construct a small model to be trained and a pre-trained large model Agent; Step 102: The large model agent obtains the initial labeled data and performs supervised training on the small model. The small model is trained by minimizing the cross entropy loss between the relationship labels predicted by the model and the true relationship labels to obtain a trained small model. Step 103, construct a performance evaluation function to evaluate the relationship extraction performance of the trained small model. If it passes, proceed to step 104, otherwise, retrain the small model; Step 104, the results generated by the trained small model are reviewed and corrected by the large model Agent to obtain corrected data; Step 105, merging the corrected data with the initial labeled data to obtain an extended data pool, and the large model Agent extracts training data from the extended data pool to retrain the trained small model; Step 106, the large model Agent repeatedly expands the data pool and trains the small model according to the performance evaluation result obtained in step 103, until the performance index of the small model after training reaches the preset standard; Step 107, constructing a knowledge graph in the field of power marketing based on the trained small model.

2. The method for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent according to claim 1 is characterized in that: The acquisition of the initial annotation data includes: using the data collection tool F of the large model agent collect Collect text data in the field of power marketing, and label the collected text data to obtain initial labeled data Among them, tags include company, location, date, and service.

3. The method for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent according to claim 1 is characterized in that: Data collection tool for pre-trained large model agents F collect , collect training data Send it for supervised training and call the model training tool F at the same time train The small model M is trained by minimizing the cross entropy loss between the relationship labels predicted by the model and the true relationship labels. s (θ), so that it has basic knowledge extraction capabilities. The trained small model M s '(θ) is able to identify entity pairs from text and generate preliminary relation labels.

4. The method for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent according to claim 1 is characterized in that: The performance evaluation function is constructed to evaluate the relationship extraction performance of the trained small model, specifically including: The training loss goal is to reduce the cross entropy loss between the predicted relationship label and the true relationship label. The trained small model M is s The input data of '(θ) is x i , the output data is y i =M s '(θ,x i ), the true label is y t , the performance evaluation function L is: Among them, N represents the number of samples, C represents the number of labels, yt represents the true label, and L represents the performance evaluation function value; If the calculated performance evaluation function L value is less than the preset loss function threshold, it means that the evaluation has not passed and the training is ended. At this time, it is necessary to re-acquire the training data or manually adjust the parameters of the small model to re-train. If the performance evaluation function L value is greater than or equal to the preset performance evaluation function threshold, proceed to the next step.

5. The method for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent according to claim 1 is characterized in that: The results generated by the trained small model specifically include: Get a piece of text data {x1, x2, ...x n }, where x i Represents the i-th word of the text; The text data is word-embedded and position-encoded to obtain the input text E of the small model. The input text E is expressed as: E={e1,e2,...e n } Among them, e i =Embed(x i )+PosEnc(i), Embed() means converting a token into a string of vectors, and PosEnc() means encoding a token by position; The trained small model encodes the input text E into a set of latent vectors H, which are the generated results: H={h1,h2,...,h n }=GLiNER(E) Among them, h i Represents the representation of each word after GLiNER encoding.

6. The method for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent according to claim 1 is characterized in that: The large model agent reviews and corrects the results generated by the trained small model, including: The large model Agent calls F eval For the trained small model M s '(θ) The results generated are reviewed and the incorrect relationship labels are corrected, including: Assume that the two entities for relationship extraction are e1 and e2. Combining entities e1 and e2, the predicted probability distribution of the relationship is obtained through the large model Agent. And the predicted probability distribution obtained by the small model And the predicted probability distribution obtained by the large model Agent Perform dynamic weight fusion to obtain the predicted probability distribution y; According to the predicted probability distribution y of the relationship, the relationship when y is the largest is obtained as the classification category; and the trained small model M is judged according to the classification category. s '(θ) is generated correctly, and the wrong relationship labels are corrected. The corrected data is used as the high-precision new annotation data D trainnew .

7. The method for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent according to claim 6 is characterized in that: The predicted probability distribution obtained for the small model And the predicted probability distribution obtained by the large model Agent Perform dynamic weight fusion to obtain the predicted probability distribution y, as follows: Among them, w GLiNER (x) is the dynamic weight of GLiNER, w Agent (x) is the dynamic weight of the Agent; and w GLiNER (x) and w Agent (x) Satisfy: w GLiNER (x)+w Agent (x)=1。 8. The method for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent according to claim 1 is characterized in that: The calculation formula of the performance index is as follows: Among them, Recall represents the recall rate, that is, the probability of predicting the correct label, TP is the entity pair and its relationship label correctly predicted by the model, and FN is the real relationship label that the model failed to correctly predict.

9. A system for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent, used to implement the method for intelligently constructing a knowledge graph in the field of power marketing based on a large model agent as described in any one of claims 1 to 8, characterized in that: include: Model building module, training module, performance evaluation module, correction module, data expansion module, knowledge graph building module; The model building module is used to build small models to be trained and pre-trained large model agents; The training module is used to obtain the initial labeled data and perform supervised training on the small model. The model is trained by minimizing the cross entropy loss between the relationship labels predicted by the model and the true relationship labels to obtain the trained small model. The performance evaluation module is used to construct a performance evaluation function to evaluate the relationship extraction performance of the trained small model; The correction module reviews and corrects the results generated by the trained small model based on the large model agent to obtain the corrected data; The data expansion module is used to merge the corrected data with the initial labeled data to obtain an expanded data pool. The training module extracts training data from the expanded data pool to retrain the trained small model. The large model agent repeatedly expands the data pool and trains the small model according to the performance evaluation results until the performance indicators of the trained small model meet the preset standards. The knowledge graph construction module builds a knowledge graph in the field of power marketing based on the trained small model.

10. A terminal comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1-8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Multi-model collaborative knowledge graph construction method, system and equipment and storage medium

    CN120316272A

  • Multi-model collaborative knowledge graph construction method, system, device and storage medium

    CN120316272B

  • Server side privacy protection data generation method and system

    CN120579200A

  • A server-side privacy protection data generation method and system

    CN120579200B