A data processing method, device and medium
By constructing and using data augmentations to generate synthetic data in large language models and performing credibility evaluation, the problem of insufficient accuracy and diversity of synthetic data is solved, and high-quality training data generation is achieved.
Patent Information
- Application Number
- CN202510151574.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-02-11
AI Technical Summary
The existing technology is difficult to improve the accuracy, credibility and diversity of synthetic data, especially in the fields of medical care, finance, etc., where high-quality training data is scarce.
By obtaining the knowledge graph of the specified domain, clustering entity nodes, building data augmentations, and embedding them into the inference template of the large language model, generating target synthetic data, and performing credibility evaluation.
Improve the accuracy and diversity of synthetic data, meet the high-quality requirements for data knowledge in different fields, and ensure the reliability of data through credibility assessment.
Smart Images

Figure CN119621999B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a data processing method, device and medium. Background Art
[0002] Pre-trained models refer to machine learning models that have been trained on large-scale data sets and can be widely used in many fields such as natural language processing, image generation, scientific research, etc. In the development of pre-trained models, training with large-scale, high-quality, and diverse training data is crucial to obtaining high-performance models. Especially in specific fields such as medicine and finance, high-quality training data is very scarce and difficult to obtain, which limits the development of pre-trained models.
[0003] In order to solve the problem of scarce training data, currently, data can be synthesized through algorithms to obtain rich training data. However, data synthesized by a single algorithm cannot approach the complex data of the real world, that is, it is difficult to guarantee the accuracy and availability of training data. In addition, data diversity also has inherent deficiencies.
[0004] It can be seen that how to improve the accuracy, credibility and diversity of synthetic data to obtain high-quality training data is an urgent problem to be solved by technical personnel in this field. Summary of the invention
[0005] In view of this, one aspect of the present application provides a data processing method, the method comprising:
[0006] Get the knowledge graph of the specified field;
[0007] Clustering the entity nodes in the knowledge graph to obtain a clustering result;
[0008] Constructing a data enhancement body for data knowledge expansion according to the knowledge graph and the clustering result;
[0009] Embedding the data augmentation body into a preset reasoning template of a specified large language model to perform data reasoning through the specified large language model to obtain target synthetic data;
[0010] A credibility assessment is performed on the target synthetic data.
[0011] Optionally, the data enhancement body is composed of a knowledge node pair including a main knowledge node and an auxiliary knowledge node, and a semantic link between the knowledge node pairs, wherein the semantic link is composed of a semantic description of the knowledge node pair that is directionally reachable in the knowledge graph; and constructing a data enhancement body for data knowledge expansion according to the knowledge graph and the clustering result includes:
[0012] Determine the shortest connected path length between any two of the entity nodes;
[0013] Selecting the knowledge node pair according to the node category in the clustering result and the shortest connected path length;
[0014] Based on the entity relationship triples in the knowledge graph, the semantic links are generated to form the data enhancement body.
[0015] Optionally, the knowledge node pair includes a first node pair and a second node pair, and the selecting the knowledge node pair according to the node categories in the clustering result and the shortest connected path length includes:
[0016] At least one entity node corresponding to different shortest connected path lengths is used as the main knowledge node; the main knowledge node and the auxiliary knowledge node are obtained from the same node category to form the first node pair, and the main knowledge node and the auxiliary knowledge node are obtained from different node categories to form the second node pair; wherein the number of the second node pairs is greater than the number of the first node pairs, and the number of the first node pairs is in a preset ratio to the number of the second node pairs.
[0017] Optionally, the performing credibility assessment on the target synthetic data includes:
[0018] Splitting the target synthetic data according to sentences to obtain atomic declarative sentences;
[0019] Based on the data augmentation body, mining a verification data set about the atomic statement sentence;
[0020] The credibility of the target synthetic data is determined through the verification data set.
[0021] Optionally, the performing credibility assessment on the target synthetic data includes:
[0022] Splitting the target synthetic data according to sentences to obtain atomic declarative sentences;
[0023] Based on the data augmentation body, mining a verification data set about the atomic statement sentence;
[0024] The credibility of the target synthetic data is determined through the verification data set.
[0025] Optionally, determining the credibility of the target synthetic data by using the verification data set includes:
[0026] Using multiple target large language models, reasoning is performed on the verification data set and the atomic statement sentence respectively to obtain reasoning results representing the authenticity support of the atomic statement sentence;
[0027] Determining the atomic mass score of the atomic statement according to a preset scoring standard and the reasoning result;
[0028] summing up the atomic mass fractions to obtain the target mass fraction of the target synthesis data;
[0029] When the target quality score is greater than a threshold, the target synthetic data is determined to be credible.
[0030] Optionally, embedding the data augmentation body into a preset reasoning template of a specified large language model to perform data reasoning through the specified large language model to obtain target synthetic data includes:
[0031] For each of the data enhancement bodies, repeating the step of embedding the data enhancement body into a preset reasoning template of a specified large language model N times to obtain N reasoning results; wherein N is greater than 1;
[0032] Determining the similarity of the N inference results;
[0033] When the similarity is greater than a first threshold, taking any one of the N inference results as the target synthetic data;
[0034] When the similarity is greater than a second threshold and not greater than the first threshold, merging the N inference results as the target synthetic data; wherein the second threshold is less than the first threshold;
[0035] When the similarity is not greater than the second threshold, the current N inference results are discarded.
[0036] Another aspect of the present application provides a data processing device, the device comprising:
[0037] The knowledge graph acquisition module is used to obtain the knowledge graph of a specified field;
[0038] A clustering module, used to cluster the entity nodes in the knowledge graph to obtain clustering results;
[0039] A data enhancement body construction module, used to construct a data enhancement body for data knowledge expansion according to the knowledge graph and the clustering result;
[0040] A target synthetic data acquisition module, used for embedding the data augmentation body into a preset reasoning template of a specified large language model, so as to perform data reasoning through the specified large language model to obtain target synthetic data;
[0041] The credibility assessment module is used to perform credibility assessment on the target synthetic data.
[0042] Another aspect of the present application provides a data processing device, including a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and the processor implements the steps of the data processing method when executing the program.
[0043] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, and the program implements the steps of the data processing method when executed by a processor.
[0044] The data processing method, device and medium provided in this application have the following beneficial effects: constructing a data enhancement body based on knowledge graphs in different fields can meet the requirements of accuracy, availability and diversity of data knowledge in various fields. In addition, by expanding data knowledge through the data enhancement body and using the rich knowledge structure and powerful learning and reasoning ability of the large language model to perform data reasoning, the target synthetic data is obtained, which can further improve the accuracy of the synthetic data. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A flowchart of a data processing method provided in an embodiment of the present application;
[0046] Figure 2 A schematic diagram of the principle of a data processing method provided in an embodiment of the present application;
[0047] Figure 3 A schematic diagram of the structure of a knowledge graph provided in an embodiment of the present application;
[0048] Figure 4 A flowchart of a data processing method provided by another embodiment of the present application;
[0049] Figure 5 A schematic diagram of the principle of a data processing method provided by another embodiment of the present application;
[0050] Figure 6 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;
[0051] Figure 7 A structural schematic diagram of a data processing device provided in another embodiment of the present application.
[0052] The reference numerals are as follows: 70 is a memory, 71 is a processor, 72 is a display screen, 73 is an input / output interface, 74 is a communication interface, 75 is a power supply, 76 is a communication bus, 701 is a computer program, 702 is an operating system, and 703 is data. DETAILED DESCRIPTION
[0053] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0054] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these 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 the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. 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".
[0055] Figure 1 A flowchart of a data processing method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:
[0056] S10: Obtain the knowledge graph of the specified field;
[0057] In a specific embodiment, in order to ensure the accuracy and availability of training data in different fields, corresponding training data can be generated based on the knowledge graphs of each field, that is, training data that can be used to train the pre-trained model can be synthesized based on the knowledge graph. Specifically, the knowledge graph of the specified field is obtained through step S10, where the specified field can include but is not limited to the medical field, the financial field, and the legal field.
[0058] It is understandable that knowledge graphs, as the basis for training data synthesis, have advantages such as semantic modeling, structured expression, multi-source data fusion, dynamic reasoning and expansion, and can provide intelligent data generation rules and logical guidance to improve the accuracy, consistency and interpretability of the final synthesized data, thereby meeting the requirements for high-quality data in different fields.
[0059] At the same time, the knowledge graph ensures the quality and application value of synthetic data through the support of domain knowledge and logical verification, providing data support for multi-domain intelligent system design and data-driven innovative applications.
[0060] It should be noted that, in the specific embodiments, the present application does not limit the method of obtaining the knowledge graphs in various fields. As an optional embodiment, the knowledge graphs corresponding to various fields can be pre-stored in a database, and the knowledge graphs in the database can be updated regularly, and can be directly retrieved from the database when used.
[0061] S11: Cluster the entity nodes in the knowledge graph to obtain clustering results;
[0062] Furthermore, cluster analysis is performed on the acquired knowledge graph. In an optional embodiment, the entity nodes in the knowledge graph can be clustered by a K-means clustering algorithm. The purpose is to classify entity nodes with similar semantics in the knowledge graph of the specified field. In order to inject richer and more diverse semantic information as much as possible in the subsequent process of synthesizing data, thereby achieving the effect of data knowledge expansion. Among them, it should be noted that the present application does not specifically limit the clustering method of entity nodes.
[0063] When clustering entity nodes in a knowledge graph, specifically, the required knowledge graph is imported, and the topological structure information of the knowledge graph is loaded, wherein the topological structure information includes but is not limited to the number of entity nodes and the number of edges between entity nodes.
[0064] Furthermore, the entity node name is vectorized to obtain a node text vector. Specifically, in an optional embodiment, a BERT (Bidirectional Encoder Representations from Transformers) model is loaded, and a node text vector is generated through the BERT model. Finally, the spatial distance between the node text vectors is calculated, and the entity nodes are clustered according to the spatial distance to obtain a clustering result. Thus, the clustering of entity nodes is achieved based on semantic similarity.
[0065] In an optional embodiment, in order to ensure the clustering effect, after obtaining the clustering results, the clusters can be tuned by the silhouette coefficient index, that is, the clustering results can be optimized. In order to cluster many entity nodes in the knowledge graph into fewer node categories. For example, in the medical field, the original 127 entity nodes can be clustered into 12 node categories such as microbiology, therapeutics, and nutrition.
[0066] It should be noted that, in order to ensure the quality of the final target synthetic data, as an optional embodiment, before executing step S11 to cluster the entity nodes in the knowledge graph, the topological structure information of the knowledge graph is obtained, and the connectivity of the knowledge graph and the semantic relevance between the entity nodes are determined based on the topological structure information to determine whether they meet the preset requirements. If they do, step S11 is executed; if not, the knowledge graph is re-acquired.
[0067] In fact, topological structure information is mainly used to assist in judging whether the currently acquired knowledge graph can be used to generate high-quality target merged data, that is, to filter the knowledge graph.
[0068] S12: Based on the knowledge graph and clustering results, a data augmentation body is constructed for data knowledge expansion;
[0069] S13: embedding the data augmentation body into a preset reasoning template of a specified large language model, so as to perform data reasoning through the specified large language model to obtain target synthetic data;
[0070] Furthermore, based on the clustering results and knowledge graph, a data augmentation body is constructed. The data augmentation body refers to a data structure used to expand the data knowledge of the target synthetic data. The constructed data augmentation body is embedded in a pre-designed reasoning template, and the data reasoning is performed using a specified large language model to obtain the target merged data.
[0071] In an optional embodiment, the preset reasoning template may be a prompt template, which refers to a framework or format that can be used to generate input text in a natural language processing task. After the data augmentation body is embedded in the preset reasoning template, the powerful learning reasoning ability and rich knowledge structure of the specified large language model are used to perform data reasoning, thereby obtaining high-quality target synthetic data in the specified field.
[0072] It is worth noting that, in an optional embodiment, the designated large language model may be a ChatGPT (Chat Generative Pre-trained Transformer) large language model. In another optional embodiment, the corresponding large language model may be selected according to the designated field corresponding to the knowledge graph, that is, a large language model that is more targeted to the designated field may be selected, and this application does not limit this.
[0073] In addition, it should be noted that, as an optional embodiment, the preset reasoning template may include three parts: task instructions, condition settings, and sample examples. Among them, the task instructions are used to clearly specify that the large language model performs a specified task with a specified identity, and clearly specify the input and output forms of the task. Thus, through a clear description of the specified task, the specified large language model can understand the user's intention and reduce deviations and ambiguities.
[0074] The condition setting provides limiting information for the specified large language model, wherein the condition setting may include but is not limited to background, rule constraints, etc. Thus, through the condition setting, the focus of the specified large language model is focused on a specific range, which helps to generate target synthetic data that meets the requirements.
[0075] Sample examples are used to provide sample data for the designated large language model to learn medicine, thereby enhancing the task adaptability of the designated large language model. It is understandable that although the large language model has a strong zero-sample learning ability, sample examples can provide a specific reference framework for the model to avoid deviations due to lack of guidance, and can more accurately judge user intentions to adapt to complex or professional task requirements. Figure 2 This is a schematic diagram of the principle of a data processing method provided in an embodiment of the present application. For ease of understanding, the following will be combined with Figure 2 Provide explanation.
[0076] like Figure 2 As shown, in an optional embodiment, the preset reasoning template 21 is a Prompt template, and the Prompt template includes three parts: task instruction 210, condition setting 211 and sample example 212. Figure 2 In the distance shown, the task instruction 210 is that you are a senior expert in the medical field. Please write an article on the topic of "main knowledge node" based on the existing factual knowledge. The article information should include the relevant concepts of "auxiliary knowledge node". The condition settings 211 include 1. related to the medical field; 2. The content length is not less than 1,000 words, etc., and two different sample examples 212 are given.
[0077] The constructed data enhancement body 20 is embedded into the preset reasoning template 21, so that data reasoning can be performed by specifying a large language model to obtain the target synthetic data 22.
[0078] S14: Perform credibility assessment on the target synthetic data.
[0079] In the process of generating target synthetic data, the credibility of the target synthetic data obtained may not meet the requirements of the corresponding specified field due to the influence of many factors such as the reasoning ability of the specified large language model, the quality of the knowledge graph, and the target synthetic data generation mechanism. Especially in specific fields such as the medical field, the legal field, and the education field, low-credibility target synthetic data may bring serious consequences.
[0080] Therefore, in an optional embodiment, after obtaining the target synthetic data, it is necessary to evaluate the credibility of the target synthetic data, that is, to determine the reliability, accuracy and whether the target synthetic data conforms to the authenticity of the real world.
[0081] Specifically, the credibility of the target synthetic data can be evaluated by a specified algorithm. The target synthetic data can also be split and each split part is evaluated separately to determine the credibility of the target synthetic data. This application does not specifically limit the evaluation method.
[0082] Therefore, the data processing method provided in the embodiment of the present application constructs a data enhancement body based on knowledge graphs in different fields, which can meet the requirements of accuracy, availability and diversity of data knowledge in various fields. In addition, by expanding data knowledge through the data enhancement body and using the rich knowledge structure and powerful learning and reasoning ability of the large language model to perform data reasoning, the target synthetic data is obtained, which can further improve the accuracy of the synthetic data.
[0083] In an optional embodiment, the data enhancement body for data knowledge expansion mainly includes three parts. Specifically, each data enhancement body includes a main knowledge node, an auxiliary knowledge node and a semantic link. Among them, the main knowledge node and the auxiliary knowledge node constitute a knowledge node pair.
[0084] The subject knowledge node is the central knowledge node of the target synthetic data. In other words, the subject knowledge node is the basic knowledge node of the target synthetic data. When generating the target synthetic data, the subject knowledge is the center and the scope is focused on the specified field corresponding to the knowledge graph.
[0085] Auxiliary knowledge nodes are expanded knowledge nodes of target synthetic data. Auxiliary knowledge nodes are distinguished from main knowledge nodes, that is, nodes whose semantics are far different from main knowledge nodes. They are mainly used to expand the diversity and semantic information of data knowledge in the process of generating target synthetic data.
[0086] The semantic link is composed of the semantic description of the knowledge node pair that is directionally reachable in the knowledge graph, that is, the main knowledge node and the auxiliary knowledge node have a directionally reachable path in the knowledge graph. Table 1 is a schematic table of a data enhancement body provided in an embodiment of the present application. For ease of understanding, the data enhancement body will be described below in conjunction with Table 1.
[0087] Table 1 Schematic diagram of data augmentation
[0088]
[0089] As shown in Table 1, in an optional embodiment, the main knowledge node may be fish, the auxiliary knowledge node may be cell function, and the corresponding semantic link may be a directed semantic description path.
[0090] As an optional embodiment, a data enhancement body for data knowledge expansion is constructed according to the knowledge graph and clustering results, including:
[0091] Determine the length of the shortest connected path between any two entity nodes;
[0092] Select knowledge node pairs based on the node categories and the shortest connected path length in the clustering results;
[0093] Based on the entity-relationship triples in the knowledge graph, semantic links are generated to form a data augmentation body.
[0094] According to Table 1, in order to ensure the quality of the target synthetic data, the semantic link should not be too long, otherwise it will affect the efficiency of the specified large language model for data reasoning, and too much data information will lead to poor final reasoning results. Therefore, in an optional embodiment, the knowledge node pairs of the data enhancement body can be selected based on the shortest connected path length between entity nodes.
[0095] Figure 3 A schematic diagram of the structure of a knowledge graph provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, in a specific embodiment, there may be multiple connection paths between any two entity nodes. For example, entity node A and entity node B may be directly connected to entity node B, or entity node A may first reach entity node C and then reach entity node B. Therefore, the length of the shortest connection path between entity node A and entity node B is 1. Similarly, it can be known that the length of the shortest connection path between entity node A and entity node F is 2.
[0096] It is understandable that the length of the semantic link obtained by selecting node pairs from node categories of different clustering results is different. Therefore, in an optional embodiment, in order to ensure that the semantic link is not too long, in addition to selecting knowledge node pairs based on the shortest connected path length, it is also necessary to select based on the clustering results of the entity nodes.
[0097] After obtaining the knowledge node pairs including the main knowledge nodes and the auxiliary knowledge nodes, the semantic links between the knowledge node pairs are generated, thereby obtaining the data enhancement body including the knowledge node pairs and the semantic links. Specifically, it can be understood that the knowledge graph includes entity relationship triples, that is, entity-relationship-entity triples, so that semantic links can be generated according to the entity relationship triples of the node pairs in the knowledge graph. For ease of understanding, the following is explained in conjunction with Table 1.
[0098] For example, the data enhancement body 1 in Table 1 includes the main knowledge node "fish" and the auxiliary knowledge node "cell function", and also includes two entity nodes, social behavior and clinical attribute, between fish and cell function. Among them, in the semantic description "fish exhibit social behavior", the entities include fish and social behavior, and the relationship is "exhibit and".
[0099] Therefore, based on the three entity relationship triplets between the main knowledge node "fish" and the auxiliary knowledge node "cell function", a directed and reachable semantic description path of "fish exhibit social behavior->social behavior is related to clinical attributes->clinical attribute manifestation of cell function" can be generated, that is, the corresponding semantic link is obtained.
[0100] Similarly, if Figure 2 As shown, the main knowledge node 201 is "fish" and the auxiliary knowledge node 201 is "cell function", and the semantic link 202 is "fish exhibit social behavior -> social behavior is related to clinical attributes -> clinical attribute performance of cell function". Therefore, the main knowledge node 201, the auxiliary knowledge node 201 and the semantic link 202 constitute a data enhancement body, and the data enhancement body is embedded in the preset reasoning template 21, and the target synthetic data 22 can be obtained by performing data reasoning through the specified large language model.
[0101] Therefore, the data processing method provided in the embodiment of the present application constructs a data enhancement body for data knowledge expansion based on the entity nodes of the knowledge graph and the semantic association information between the entity nodes, so as to subsequently generate high-quality target synthetic data based on the data enhancement body.
[0102] Based on the above embodiment, as an optional embodiment, the selected knowledge node pair includes a first node pair and a second node pair. The main knowledge node and the auxiliary knowledge node corresponding to the first node pair are from the same node category in the clustering result, and the main knowledge node and the auxiliary knowledge node corresponding to the second node pair are from different node categories in the clustering result.
[0103] It is understandable that in order to ensure the accuracy and diversity of the final target synthetic data, the semantic connectivity path should include more semantic description categories. Therefore, when selecting knowledge node pairs, the main knowledge nodes and auxiliary knowledge nodes can be selected from different node categories to ensure the diversity of the target synthetic data, that is, to ensure that the semantics between the main knowledge nodes and the auxiliary knowledge nodes are as differentiated as possible. Of course, in order to ensure the reliability of the target synthetic data, it is also necessary to select the main knowledge nodes and auxiliary knowledge nodes from the same node category.
[0104] In an optional embodiment, in order to take into account both the accuracy and diversity of the target synthetic data, a preset ratio of first node pairs and second node pairs is selected, wherein the number of the second node pairs is greater than the number of the first node pairs.
[0105] Therefore, the diversity of the target synthetic data is ensured by the semantic differentiation between the main knowledge nodes and the auxiliary knowledge nodes. At the same time, the accuracy of the target synthetic data is ensured by the first node pair of the same node category. Of course, it should be noted that the reliability of the target synthetic data is not only guaranteed by the selection of the first node pair, but also depends on the reasoning of the specified large language model and other factors.
[0106] In addition, when selecting knowledge node pairs, it is understandable that there may be multiple connected paths between any two entity nodes. When the connectivity between two entity nodes is very good, a closed loop may be formed. At this time, the two entity nodes may include many intermediate entity nodes. This may lead to low efficiency when specifying a large language model for data reasoning. In addition, it may be difficult to meet the conditional settings in the specified large language model, resulting in poor final synthesis effect.
[0107] Therefore, in order to solve the above technical problems, in an optional embodiment, the knowledge node pair can be selected based on the shortest connected path length between any two entity nodes. Specifically, at least one entity node corresponding to different shortest connected path lengths is used as the main knowledge node. In other words, the main knowledge node is selected under each shortest connected path length condition. For ease of understanding, an example will be given below.
[0108] For example, the shortest connected path length between entity node A1 and entity node B1 is 1, the shortest connected path length between entity node A2 and entity node B2 is 2, and the shortest connected path length between entity node A3 and entity node B3 is 3. When selecting knowledge node pairs, at least one of the entity nodes corresponding to the shortest connected path lengths 1, 2, and 3 is used as the main knowledge node.
[0109] In summary, when selecting knowledge node pairs, two aspects are considered. One aspect is to ensure that the shortest connected path length covers as wide a range as possible. Specifically, at least one entity node corresponding to different shortest connected path lengths is used as the main knowledge node.
[0110] Another aspect is to ensure as many types of semantic descriptions between the main knowledge nodes and the auxiliary knowledge nodes as possible, that is, to ensure as much semantic differentiation between the main knowledge nodes and the auxiliary knowledge nodes as possible. Specifically, the main knowledge nodes and the auxiliary knowledge nodes are obtained from the same node category to form a first node pair, and the main knowledge nodes and the auxiliary knowledge nodes are obtained from different node categories to form a second node pair; wherein the number of the second node pairs is greater than the number of the first node pairs, and the number of the first node pairs is in a preset ratio to the number of the second node pairs.
[0111] Therefore, the data processing method provided in the embodiment of the present application obtains a data enhancement body by mining the main knowledge nodes, auxiliary knowledge and the semantic links between the two, so as to embed the data enhancement body into a preset reasoning template, thereby effectively improving the adaptability of the large language model in domain knowledge data synthesis tasks and ensuring the reasoning efficiency and data generation quality of the large language model.
[0112] It is understandable that after the target synthetic data is generated, it can be used as training data to train the pre-trained model, and the final pre-trained model can be applied to various fields such as medicine and education. However, for specific fields such as medicine, the credibility of the data, that is, the accuracy of the data is crucial. If there is an error in the data information, it may lead to irreversible consequences.
[0113] Figure 4 A flowchart of a data processing method provided by another embodiment of the present application is provided. Therefore, in order to solve the above technical problem, as an optional embodiment, Figure 4 As shown, the credibility of the target synthetic data is evaluated, including:
[0114] S40: split the target synthetic data into sentences to obtain atomic declarative sentences;
[0115] In an optional embodiment, the target synthetic data generated by the specified large language model inference is split into sentences, and the target synthetic data is split into a complete and indivisible atomic statement. Thus, the target synthetic data can be split into multiple atomic statements, and if the credibility of each atomic statement is determined, the credibility of the target synthetic data can be determined.
[0116] S41: Based on data augmentation, mining a validation dataset about atomic declarative sentences;
[0117] S42: Determine the credibility of the target synthetic data by verifying the data set.
[0118] Therefore, further, based on the data enhancement body constructed in the above embodiment, a verification data set is mined for each atomic statement. The verification data set is a data set about the authenticity, accuracy and reliability of the atomic statement. In other words, some authenticity materials about the atomic statement are mined, and the credibility of the target synthetic data is verified through these authenticity materials.
[0119] Therefore, the data processing method provided in the embodiment of the present application can automatically evaluate the credibility of the generated target synthetic data, thereby further improving the reliability of the target synthetic data.
[0120] Based on the above embodiments, Figure 4 As shown, as an optional embodiment, based on the data enhancement body, a verification data set about atomic declarative sentences is mined, including:
[0121] S410: Searching for knowledge information about the main knowledge nodes and auxiliary knowledge nodes corresponding to the target synthetic data, and using the knowledge information as a verification data set; and / or;
[0122] S411: Retrieve at least one semantic description in the semantic link corresponding to the target synthetic data, and use the first preset piece of information in the retrieval result as a verification data set.
[0123] First of all, it should be noted that the verification data set corresponding to each atomic statement can be composed of multiple different verification data, and different verification data can be obtained through different mining methods, which is not limited in this application.
[0124] In an optional embodiment, since the target synthetic data is generated based on the data augmentation body reasoning, when mining the verification data set, mining can be performed based on the data augmentation body. Specifically, the knowledge information of the main knowledge nodes and auxiliary knowledge nodes corresponding to the target synthetic data can be searched. In an optional embodiment, the knowledge information about the main knowledge nodes and auxiliary knowledge nodes can be obtained by searching through the corresponding Wikipedia entries, and the obtained knowledge information is used as the verification data set.
[0125] In the data enhancement body, in addition to the main knowledge nodes and auxiliary knowledge nodes, semantic links are also included. Therefore, in another optional embodiment, when obtaining the verification data set, at least one semantic description in the semantic link corresponding to the target synthetic data can be retrieved through step S411. Of course, in some optional embodiments, in order to ensure the reliability of the verification data set, multiple semantic descriptions can be retrieved, or all semantic descriptions can be retrieved, which is not limited in this application.
[0126] Furthermore, the first preset pieces of information in the retrieval results are used as a verification data set. It is understandable that in a specific retrieval embodiment, each semantic description corresponds to multiple recall results, and the more accurate the information, the higher the ranking. Therefore, in order to ensure the efficiency of the credibility assessment of the target synthetic data while ensuring the accuracy of the assessment, in an optional embodiment, the first preset pieces of information (for example, the first 3 pieces of information) can be used as a verification data set.
[0127] It should be noted that, in a specific embodiment, step S410 and step S411 can be performed simultaneously, that is, the verification data set can be obtained according to the main knowledge node, the auxiliary knowledge node and the semantic link respectively. Of course, any one of step S410 and step S411 can be performed to obtain the verification data set, and this application does not limit this. Figure 5 This is a schematic diagram of a data processing method provided in another embodiment of the present application. For ease of understanding, the following will be combined with Figure 5 Provide explanation.
[0128] like Figure 5 As shown, in an optional embodiment, the main knowledge node is fish, and the auxiliary knowledge node is cell function, then searching for fish and cell function can obtain a part of the verification data set. In addition, the semantic description in the semantic link can also be retrieved to obtain the verification data set.
[0129] Based on the above embodiments, Figure 4 As shown, as an optional embodiment, the credibility of the target synthetic data is determined by verifying the data set, including:
[0130] S420: using multiple target large language models, respectively reasoning on the verification data set and the atomic declarative sentences, and obtaining reasoning results representing the authenticity support of the atomic declarative sentences;
[0131] Based on the verification data set obtained in the above embodiment, in an optional embodiment, the verification data set and the atomic statement can be inferred by a large language model to determine the authenticity support of the atomic statement. The inference result obtained by the large language model is used to characterize the authenticity support of the atomic statement. In an optional embodiment, the inference result can include support, non-support and irrelevant.
[0132] The support characterization infers that the atomic statement is reasonable, true, and consistent with the facts based on the provided verification data set and atomic statements. The non-support characterization indicates that the atomic statement is incorrect, unverified, or inconsistent with the facts as a result of the reasoning. The irrelevant characterization indicates that the atomic statement is irrelevant to the provided verification data set. For example, the atomic statement is "Mary won the Nobel Prize in Chemistry while at the Sorbonne University", where the reasoning result of "Mary won the Nobel Prize" is support, while the reasoning result of "Mary won the chemistry competition" is irrelevant. Of course, it should be noted that this application does not limit the specific classification method of the reasoning results that characterize the support for the authenticity of atomic statements.
[0133] In order to ensure the reliability of the reasoning results, in an optional embodiment, reasoning can be performed through multiple different target large language models, where the target large language model may include but is not limited to an LLM (Large Language Model) large language model and a BERT (Bidirectional Encoder Representations from Transformers) large language model, and this application does not limit the number of target large language models.
[0134] For example, Figure 5 As shown, in an optional embodiment, multiple different target large language models may include a first model, a second model, and a third model. The atomic statement X1 and the obtained verification data set are used as inputs of each target large language model for reasoning, and reasoning results about the authenticity support of the atomic statement can be obtained. Specifically, the results may include support, non-support, and irrelevant.
[0135] S421: determining the atomic mass score of the atomic statement according to the preset scoring criteria and the reasoning result;
[0136] In a specific embodiment, in order to more intuitively determine the credibility of the target synthetic data, the quality of each atomic statement can be scored. Specifically, the atomic mass score of each atomic statement is calculated according to the preset scoring criteria and the inference result obtained in step S420.
[0137] Among them, in an optional embodiment, for the reasoning results including support, unsupport and irrelevant, the supported reasoning result score can be set to 1 point, the unsupported reasoning result score can be set to -1 point, and the irrelevant reasoning result score can be set to 0 point. Of course, the specific score setting is not limited in this application.
[0138] It is understandable that the present application can use multiple different target large language models to perform reasoning on the verification data set and the atomic declarative sentence, because each target large language model will obtain a reasoning result after reasoning on an atomic declarative sentence.
[0139] However, the inference results of different target large language models for the same atomic statement may be different. At this time, as an optional embodiment, a crowd voting method can be adopted, that is, the minority obeys the majority, to calculate the final atomic mass score of the atomic statement. It should be noted that in order to ensure that the atomic mass score can be obtained by crowd voting, the number of target large language models in this embodiment of the application is an odd number.
[0140] For example, in Figure 5 In the example shown, the target large language model includes a first model, a second model, and a third model, and the atomic statement X1 is: Fish are often viewed as simple aquatic organisms, but they play a surprisingly complex role in advancing our understanding of biology, medicine, and even human health.
[0141] For the atomic statement X, the reasoning result of the first model is support, the reasoning result of the second model is support, and the reasoning result of the third model is irrelevant. Based on the crowd voting result, that is, the principle of minority obeys majority, the final score of the atomic statement X1 is 1 point.
[0142] In another optional embodiment, since the accuracy of the inference results of the large language models corresponding to different fields is different, corresponding weights can also be set for different target large language models, and the final atomic mass scores can be calculated based on the weights.
[0143] S422: summing the mass fractions of each atom to obtain a target mass fraction of target synthesis data;
[0144] S423: When the target quality score is greater than the threshold, the target synthetic data is determined to be credible.
[0145] It can be understood that the target synthetic data can be divided into multiple atomic statements. After determining the atomic mass score of each atomic statement through steps S420 to S421, the target mass score of the target synthetic data can be obtained by summing up the atomic mass scores.
[0146] In an optional embodiment, when the target quality score is greater than a threshold, it indicates that the current target synthetic data is credible, that is, the credibility of the target synthetic data meets expectations. If it is not greater than the threshold, it indicates that the current target course data is uncredible, that is, the credibility does not meet expectations, and at this time, the target synthetic data is eliminated.
[0147] It is worth noting that the constructed data enhancement bodies include multiple, and the target synthetic data finally inferred also include multiple, in order to ensure the overall credibility of the data. In an optional embodiment, when the proportion of target synthetic data whose target quality score is not greater than the threshold is greater than the preset proportion, it indicates that the overall reliability of the data generated under the current knowledge graph is low. At this time, all target synthetic data generated under the current knowledge graph can be discarded, and a new knowledge graph can be obtained to regenerate the target synthetic data.
[0148] In an optional embodiment, embedding the data augmentation body into a preset reasoning template of a specified large language model to perform data reasoning through the specified large language model to obtain target synthetic data includes:
[0149] For each data augmentation body, repeat the step of embedding the data augmentation body into the preset reasoning template of the specified large language model N times to obtain N reasoning results; where N is greater than 1;
[0150] Determine the similarity of N inference results;
[0151] When the similarity is greater than the first threshold, any one of the N inference results is used as the target synthetic data;
[0152] When the similarity is greater than a second threshold and not greater than the first threshold, the N inference results are merged as target synthetic data; wherein the second threshold is less than the first threshold;
[0153] When the similarity is not greater than the second threshold, the current N inference results are discarded.
[0154] In the process of reasoning and synthesis of target synthetic data, in order to further ensure the accuracy of the data, as an optional embodiment, multiple data reasoning can be performed for each data augmentation body. Specifically, the step of embedding the data augmentation body into the preset reasoning template of the specified large language model is repeated N times, so that each data augmentation body can obtain N reasoning results, that is, obtain N target synthetic data.
[0155] It is understandable that the same or different inference results can be obtained by inputting the same data augmentation body, in order to obtain more accurate target synthetic data. After obtaining N inference results, further, the similarity of the N inference results is determined, and the final target synthetic data is determined based on the similarity.
[0156] It should be noted that, in an optional embodiment, in order to ensure the efficiency of reasoning, the value of N should not be too large. Of course, if the data quality requirements are extremely high in the application scenario, the value of N can also be appropriately increased to improve the quality of the target synthetic data. This application does not limit this. In addition, it should be noted that when determining the similarity of the reasoning results, a pre-trained model can be used for determination, or a cosine similarity algorithm can be used for determination. This application does not limit the method of determining the similarity.
[0157] Further, after obtaining the similarity, if the similarity is greater than the first threshold, it indicates that the N inference results are very similar, and any one of the N inference results can be used as the target synthetic data. If the similarity is greater than the second threshold and not greater than the first threshold, where the second threshold is less than the first threshold, it indicates that there is a certain degree of similarity between the N inference results, but the similarity is not very high. At this time, in an optional embodiment, the N inference results can be merged as the target synthetic data.
[0158] Of course, if the similarity is not greater than the second threshold, it indicates that the N inference results are far apart and there may be a large error in the inference result. In order to ensure the reliability of the data, the current N inference results are discarded at this time.
[0159] Therefore, the data processing method provided in the embodiment of the present application performs repeated reasoning on the same data enhancement body multiple times, and determines the final target synthetic data based on multiple reasoning results, thereby further improving the accuracy of the target synthetic data.
[0160] In the above embodiments, the data processing method is described in detail. The present application also provides a corresponding embodiment of a data processing device.
[0161] Figure 6 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the device comprises:
[0162] A knowledge graph acquisition module 60 is used to acquire a knowledge graph in a specified field;
[0163] A clustering module 61 is used to cluster entity nodes in the knowledge graph to obtain clustering results;
[0164] The data enhancement body construction module is used to construct a data enhancement body for data knowledge expansion based on the knowledge graph and clustering results;
[0165] A target synthetic data acquisition module 62 is used to embed the data enhancement body into a preset reasoning template of a specified large language model, so as to perform data reasoning through the specified large language model to obtain target synthetic data;
[0166] The credibility evaluation module 63 is used to perform credibility evaluation on the target synthetic data.
[0167] In addition, the data processing device provided in the embodiment of the present application further includes:
[0168] The shortest connected path length determination module is used to determine the shortest connected path length between any two entity nodes;
[0169] A knowledge node pair selection module is used to select knowledge node pairs according to the node categories and the shortest connected path length in the clustering results;
[0170] The semantic link generation module is used to generate semantic links based on entity relationship triples in the knowledge graph to form a data enhancement body.
[0171] The knowledge node pair selection module is also used to select at least one entity node corresponding to different shortest connected path lengths as a main knowledge node; obtain the main knowledge node and the auxiliary knowledge node from the same node category to form a first node pair, and obtain the main knowledge node and the auxiliary knowledge node from different node categories to form a second node pair; wherein the number of the second node pairs is greater than the number of the first node pairs, and the number of the first node pairs is in a preset ratio to the number of the second node pairs.
[0172] A splitting module is used to split the target synthetic data into sentences to obtain atomic declarative sentences;
[0173] A mining module is used to mine a verification data set about atomic statements based on data augmentation.
[0174] The credibility determination module is used to determine the credibility of the target synthetic data by verifying the data set.
[0175] A search module, used to search for knowledge information about main knowledge nodes and auxiliary knowledge nodes corresponding to target synthetic data, and use the knowledge information as a verification data set;
[0176] The retrieval module is used to retrieve at least one semantic description in the semantic link corresponding to the target synthetic data, and use the first preset information in the retrieval result as a verification data set.
[0177] The reasoning module is used to reason about the verification data set and the atomic statement through multiple target large language models, and obtain the reasoning results that represent the authenticity support of the atomic statement;
[0178] An atomic mass score determination module, used to determine the atomic mass score of the atomic statement according to a preset scoring standard and reasoning results;
[0179] A target mass fraction determination module is used to sum the mass fractions of each atom to obtain a target mass fraction of target synthesis data;
[0180] The first processing module is used to determine that the target synthetic data is credible when the target quality score is greater than a threshold.
[0181] An execution module, for each data augmentation body, repeatedly executing the step of embedding the data augmentation body into a preset reasoning template of a specified large language model N times to obtain N reasoning results; wherein N is greater than 1;
[0182] A similarity determination module, used to determine the similarity of N inference results;
[0183] The second processing module is used to use any one of the N inference results as target synthetic data when the similarity is greater than the first threshold; when the similarity is greater than the second threshold but not greater than the first threshold, merge the N inference results as target synthetic data; wherein the second threshold is less than the first threshold; when the similarity is not greater than the second threshold, discard the current N inference results.
[0184] Figure 7 A structural diagram of a data processing device provided in another embodiment of the present application is shown in FIG. Figure 7 As shown, the data processing device comprises: a memory 70 for storing a computer program;
[0185] The processor 71 is used to implement the steps of the data processing method mentioned in the above embodiment when executing the computer program.
[0186] The data processing device provided in this embodiment may include but is not limited to a laptop computer or a desktop computer.
[0187] Among them, the processor 71 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 71 can be implemented in at least one hardware form of a digital signal processor (Digital Signal Processor, referred to as DSP), a field programmable gate array (Field-Programmable Gate Array, referred to as FPGA), and a programmable logic array (Programmable Logic Array, referred to as PLA). The processor 71 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (Central Processing Unit, referred to as CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 71 may be integrated with a graphics processing unit (Graphics Processing Unit, referred to as GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 71 may also include an artificial intelligence (Artificial Intelligence, referred to as AI) processor, which is used to process computing operations related to machine learning.
[0188] The memory 70 may include one or more computer-readable storage media, which may be non-transitory. The memory 70 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 70 is at least used to store the following computer program 701, wherein the computer program can implement the relevant steps of the data processing method disclosed in any of the aforementioned embodiments after being loaded and executed by the processor 71. In addition, the resources stored in the memory 70 may also include an operating system 702 and data 703, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 702 may include Windows, Unix, Linux, etc. The data 703 may include, but is not limited to, the relevant data involved in the data processing method, etc.
[0189] In some embodiments, the data processing device may further include a display screen 72 , an input / output interface 73 , a communication interface 74 , a power supply 75 , and a communication bus 76 .
[0190] Those skilled in the art will understand that Figure 7 The structure shown in the figure does not constitute a limitation on the data processing device, and may include more or fewer components than shown in the figure.
[0191] The data processing device provided in the embodiment of the present application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the data processing method in the above embodiment.
[0192] It should be noted that, although the operations are depicted in a specific order in the accompanying drawings, this should not be understood as requiring these operations to be performed in the specific order shown or to be performed sequentially, or requiring all illustrated operations to be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.
Claims
1. A data processing method, characterized in that: The method comprises: Get the knowledge graph of the specified field; Clustering the entity nodes in the knowledge graph to obtain a clustering result; Constructing a data enhancement body for data knowledge expansion according to the knowledge graph and the clustering result; Embedding the data augmentation body into a preset reasoning template of a specified large language model to perform data reasoning through the specified large language model to obtain target synthetic data; The target synthetic data is evaluated for credibility; the data enhancement body is composed of knowledge node pairs including main knowledge nodes and auxiliary knowledge nodes, and semantic links between the knowledge node pairs, and the semantic links are composed of semantic descriptions of the knowledge node pairs that are directionally reachable in the knowledge graph; the data enhancement body for data knowledge expansion is constructed according to the knowledge graph and the clustering result, including: Determine the shortest connected path length between any two of the entity nodes; Selecting the knowledge node pair according to the node category in the clustering result and the shortest connected path length; Based on the entity relationship triples in the knowledge graph, the semantic links are generated to form the data enhancement body; The performing credibility assessment on the target synthetic data comprises: Splitting the target synthetic data according to sentences to obtain atomic declarative sentences; Based on the data augmentation body, mining a verification data set about the atomic statement sentence; The credibility of the target synthetic data is determined through the verification data set.
2. The data processing method according to claim 1, characterized in that: The knowledge node pair includes a first node pair and a second node pair, and the selecting the knowledge node pair according to the node categories in the clustering result and the shortest connected path length includes: At least one entity node corresponding to different shortest connected path lengths is used as the main knowledge node; the main knowledge node and the auxiliary knowledge node are obtained from the same node category to form the first node pair, and the main knowledge node and the auxiliary knowledge node are obtained from different node categories to form the second node pair; wherein the number of the second node pairs is greater than the number of the first node pairs, and the number of the first node pairs is in a preset ratio to the number of the second node pairs.
3. The data processing method according to claim 1, characterized in that: The step of mining a verification data set about the atomic declarative sentence based on the data augmentation body includes: Searching for knowledge information about the main knowledge nodes and auxiliary knowledge nodes corresponding to the target synthetic data, and using the knowledge information as the verification data set; and / or; At least one semantic description in the semantic link corresponding to the target synthetic data is retrieved, and the first preset piece of information in the retrieval result is used as the verification data set.
4. The data processing method according to claim 1, characterized in that: Determining the credibility of the target synthetic data through the verification data set includes: Using multiple target large language models, reasoning is performed on the verification data set and the atomic statement sentence respectively to obtain reasoning results representing the authenticity support of the atomic statement sentence; Determining the atomic mass score of the atomic statement according to a preset scoring standard and the reasoning result; summing up the atomic mass fractions to obtain the target mass fraction of the target synthesis data; When the target quality score is greater than a threshold, the target synthetic data is determined to be credible.
5. The data processing method according to claim 1, characterized in that: The step of embedding the data augmentation body into a preset reasoning template of a specified large language model to perform data reasoning through the specified large language model to obtain target synthetic data includes: For each of the data augmentation bodies, repeating the step of embedding the data augmentation body into a preset reasoning template of a specified large language model N times to obtain N reasoning results; wherein N is greater than 1; Determining the similarity of the N inference results; When the similarity is greater than a first threshold, taking any one of the N inference results as the target synthetic data; When the similarity is greater than a second threshold and not greater than the first threshold, merging the N inference results as the target synthetic data; wherein the second threshold is less than the first threshold; When the similarity is not greater than the second threshold, the current N inference results are discarded.
6. A data processing device, characterized in that: The device comprises: The knowledge graph acquisition module is used to obtain the knowledge graph of a specified field; A clustering module, used to cluster the entity nodes in the knowledge graph to obtain clustering results; A data enhancement body construction module, used to construct a data enhancement body for data knowledge expansion according to the knowledge graph and the clustering result; A target synthetic data acquisition module, used for embedding the data augmentation body into a preset reasoning template of a specified large language model, so as to perform data reasoning through the specified large language model to obtain target synthetic data; A credibility assessment module, used for performing credibility assessment on the target synthetic data; The shortest connected path length determination module is used to determine the shortest connected path length between any two entity nodes; A knowledge node pair selection module is used to select knowledge node pairs according to the node categories and the shortest connected path length in the clustering results; The semantic link generation module is used to generate semantic links based on entity relationship triples in the knowledge graph to form a data enhancement body; A splitting module is used to split the target synthetic data into sentences to obtain atomic declarative sentences; A mining module is used to mine a verification data set about atomic statements based on data augmentation. The credibility determination module is used to determine the credibility of the target synthetic data by verifying the data set.
7. A data processing device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the steps of the data processing method according to any one of claims 1 to 5 are implemented.
8. 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 data processing method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Knowledge graph expansion method, system and equipment based on knowledge disambiguation and medium
CN118333152A