Data set expansion method and system based on text graph model
By combining large language models and Wikipedia knowledge graphs and using evolutionary algorithms to optimize the propt statements, the problems of insufficient information and insufficient diversity in the existing data set expansion methods are solved, and the generalization ability and performance of the model are improved.
Patent Information
- Application Number
- CN202411336725.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing dataset expansion methods such as data augmentation and generative adversarial networks have problems with insufficient information and insufficient diversity, resulting in insufficient model generalization capabilities and pattern collapse.
The dataset expansion method based on the literary graph model is adopted, combined with the large language model and the Wikipedia knowledge graph, and the propt statement is optimized through evolutionary algorithms to generate high-quality and diverse data.
It improves the amount and diversity of data expansion, enhances the generalization ability of the model, avoids pattern collapse, and improves model performance.
Smart Images

Figure CN119313948A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data set expansion, and more specifically, relates to a data set expansion method and system based on a text graph model. Background Art
[0002] In today's era of rapid development of machine learning and deep learning technologies, data is the cornerstone of model training, and its quality and scale largely determine the performance of the model. However, high-quality labeled data is often difficult to obtain. The lack of training data is mainly reflected in the following aspects: First, the labeling cost is high. Due to the subjectivity and lack of knowledge of the labelers, data collection and labeling are often laborious and time-consuming. Second, it is easy to involve privacy, especially in some specific fields such as medical imaging, where patients have narrow channels to obtain medical images. Third, there is a lack of diversity. The existing data sets are highly similar, which leads to insufficient generalization ability of the model. Therefore, how to effectively generate or expand training data sets has become a key issue in the field of machine learning research.
[0003] Existing dataset expansion methods can improve the diversity of datasets to a certain extent, which mainly include expansion methods based on data enhancement and expansion methods based on generative adversarial networks. The expansion method based on data enhancement artificially increases the size of the dataset by performing a series of simple transformation operations such as flipping, rotating, cropping, scaling, color adjustment, etc. on existing data samples. This approach can increase the diversity and quantity of data to a certain extent, helping the model learn features under different perspectives and conditions, thereby improving the generalization ability and performance of the model. The expansion method based on generative adversarial networks also provides a new way to solve the problem of data scarcity. The key to improving the model effect by generating new training samples is that they generate new data that is close to the distribution of real data through the learning process of two adversarial networks (i.e., generator and discriminator). Generative adversarial networks can generate new samples that are almost indistinguishable from real data by learning the distribution of real data.
[0004] However, both of the above two existing dataset expansion methods have some non-negligible defects:
[0005] First, for the expansion method based on data enhancement, since the enhanced data is generated by applying simple transformation operations (such as rotation, scaling or flipping, etc.) to the original data samples, these operations often do not introduce new information at the meaningful level, so this method does not substantially expand the amount of information contained in the data;
[0006] Second, for the expansion method based on generative adversarial networks, since the generator starts to generate very similar or almost identical outputs instead of diverse data, it means that although the generated data may look real, they cannot cover the full diversity of the real data distribution, which will lead to insufficient data diversity of this method and prone to mode collapse during training. Summary of the invention
[0007] In view of the above defects or improvement needs of the prior art, the present invention provides a data set expansion method and system based on the Wensheng graph model, which aims to solve the technical problem that the existing expansion method based on data enhancement does not substantially expand the amount of information contained in the data because the enhanced data is generated only by applying simple transformation operations to the original data samples, and these operations often do not introduce new information at the meaningful level; and the technical problem that the existing expansion method based on generative adversarial networks cannot generate data that covers the full diversity of real data distribution, resulting in insufficient data diversity and prone to pattern collapse during training.
[0008] To achieve the above object, according to one aspect of the present invention, a method for expanding a data set based on a cultural graph model is provided, comprising the following steps:
[0009] (1) Obtain an initial data set, which includes multiple data subjects.
[0010] (2) The initial data set obtained in step (1) is input into the guided imagination framework GIF-SD model based on the stable diffusion model to obtain the image classification accuracy of the GIF-SD model.
[0011] (3) Obtain the Wikipedia knowledge graph and use a crawler algorithm to process the Wikipedia knowledge graph to obtain knowledge text related to multiple data set categories.
[0012] (4) Input the dataset category-related knowledge text obtained in step (3) into the large language model GPT-3.5 to obtain multiple prompt word sentences, and obtain the corresponding topic label in the dataset category-related knowledge text according to the data subject corresponding to each prompt sentence as the file index of the prompt sentence.
[0013] (5) Using the file indexes of all prompt statements obtained in step (4), the GIF-SD model is updated to obtain an updated GIF-SD model.
[0014] (6) Perform expansion processing on each data in the updated GIF-SD model obtained in step (5) to obtain expanded data.
[0015] (7) Obtain the task to be classified, and use the expanded data obtained in step (6) to run the task to be classified to obtain the accuracy of the updated GIF-SD model, and determine whether the accuracy is greater than the image classification accuracy of the GIF-SD model obtained in step (2). If so, record the accuracy; otherwise, proceed to step (8).
[0016] (8) Use an evolutionary algorithm to iteratively optimize all prompt statements obtained in step (4) to obtain multiple optimized prompt statements.
[0017] (9) Using all the prompt statements optimized in step (8), the file indexes of all the prompt statements obtained in step (4) are updated to obtain updated file indexes of multiple prompt statements.
[0018] (10) Using the file indexes of all updated prompt statements obtained in step (9), the GIF-SD model is updated to obtain an updated GIF-SD model.
[0019] (11) Perform expansion processing on each data in the updated GIF-SD model obtained in step (10) to obtain expanded data.
[0020] Preferably, the dataset category-related knowledge text in step (3) includes a subject label of each data subject, appearance features of the data subject, and usage scenarios of the data subject, etc.
[0021] Preferably, step (5) specifically comprises: first, annotating the construction method of the prompt statement in the source code of the GIF-SD model to obtain a blank prompt statement list; then, using the open function in the Python language to upload the file indexes of all prompt statements obtained in step (4) to the blank prompt statement list to obtain a new prompt statement list; and finally, saving the new prompt statement list to the GIF-SD model to obtain an updated GIF-SD model.
[0022] Preferably, step (6) specifically includes executing the instruction of the expansion task in the updated GIF-SD model, thereby performing expansion processing on each data in the GIF-SD model to obtain the expanded data.
[0023] Preferably, step (8) comprises the following steps:
[0024] (8-1) Set counter i=1.
[0025] (8-2) Determine whether i is greater than or equal to a preset number of iterations (the value range is 30 to 70, preferably 50). If so, the process ends; otherwise, proceed to step (8-3).
[0026] (8-3) Determine whether i is equal to 1. If so, proceed to step (8-4); otherwise, proceed to step (8-5).
[0027] (8-4) Use all prompt statements obtained in step (4) as the initial population in the evolutionary algorithm, and then proceed to step (8-5).
[0028] (8-5) Perform a crossover operation on the initial population, that is, randomly select any two prompt statements in the initial population and combine their features to obtain multiple prompt statements after one update.
[0029] (8-6) Perform a mutation operation on each of the once-updated prompt statements obtained in step (8-5) to obtain a second-updated prompt statement.
[0030] (8-7) Perform an evaluation operation on each prompt statement after the first update obtained in step (8-5) and each prompt statement after the second update obtained in step (8-6) to obtain an excellence score for each prompt statement.
[0031] (8-8) From all the excellence scores obtained in step (8-7), select multiple prompt sentences with the highest excellence scores to form an initial population.
[0032] (8-9) Set i=i+1 and return to step (8-2);
[0033] Preferably, step (8-7) is for each prompt statement obtained, and the file index of the prompt statement is used to update the GIF-SD model to obtain an updated GIF-SD model, and then, each data in the updated GIF-SD model is expanded to obtain expanded data, and then, the classification task is run using the expanded data, and the prompt statement is scored according to the classification accuracy. The higher the accuracy, the higher the excellence score of the prompt statement, and vice versa.
[0034] According to another aspect of the present invention, a method for expanding a data set based on a cultural graph model is provided, comprising:
[0035] The first module is used to obtain an initial data set, which includes multiple data subjects.
[0036] The second module is used to input the initial data set obtained in the first module into the guided imagination framework GIF-SD model based on the stable diffusion model to obtain the image classification accuracy of the GIF-SD model.
[0037] The third module is used to obtain the Wikipedia knowledge graph and process it using a crawler algorithm to obtain knowledge texts related to multiple data set categories.
[0038] The fourth module is used to input the dataset category-related knowledge text obtained in the third module into the large language model GPT-3.5 to obtain multiple prompt word sentences, and obtain the corresponding topic label in the dataset category-related knowledge text according to the data subject corresponding to each prompt sentence as the file index of the prompt sentence.
[0039] The fifth module is used to update the GIF-SD model using the file indexes of all prompt statements obtained by the fourth module to obtain an updated GIF-SD model.
[0040] The sixth module is used to perform expansion processing on each data in the updated GIF-SD model obtained by the fifth module to obtain expanded data.
[0041] The seventh module is used to obtain the task to be classified, and use the expanded data obtained in the sixth module to run the task to be classified to obtain the accuracy of the updated GIF-SD model, and determine whether the accuracy is greater than the image classification accuracy of the GIF-SD model obtained in the second module. If so, record the accuracy, otherwise proceed to the eighth module.
[0042] The eighth module is used to use an evolutionary algorithm to iteratively optimize all prompt statements obtained in the fourth module to obtain multiple prompt statements after optimization.
[0043] The ninth module is used to update the file indexes of all prompt statements obtained by the fourth module using all prompt statements optimized by the eighth module to obtain updated file indexes of multiple prompt statements.
[0044] The tenth module is used to update the GIF-SD model using the file indexes of all updated prompt statements obtained by the ninth module to obtain an updated GIF-SD model.
[0045] The eleventh module is used to perform expansion processing on each data in the updated GIF-SD model obtained by the tenth module to obtain expanded data.
[0046] In summary, compared with the prior art, the above technical solutions conceived by the present invention can achieve the following beneficial effects:
[0047] 1. The present invention adopts steps (3) and (4), and the method of combining a large language model and a Wikipedia knowledge graph improves the information content during data expansion. Therefore, it can solve the technical problem that the existing expansion method based on data enhancement does not substantially expand the amount of information contained in the data because the enhanced data is generated by only applying simple transformation operations to the original data samples, and these operations often do not introduce new information at the meaning level;
[0048] 2. The present invention adopts step (8), and the prompt word optimization method based on the evolutionary algorithm can realize the systematic identification and enhancement of prompt sentences that can produce high-quality generated images, while discarding prompt sentences with poor effects. Therefore, it can solve the technical problem that the existing extension method based on the generative adversarial network is insufficient in data diversity and prone to pattern collapse during training because the generated data cannot cover the full diversity of the real data distribution. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 is a flow chart of a data set expansion method based on a Wensheng graph model of the present invention;
[0050] Figure 2 It is a detailed flow chart of step (8) of the method of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0052] The basic idea of the present invention is that the accuracy of the prompt sentence largely determines the quality of the pictures generated by the text graph model. Therefore, the present invention takes this as the starting point and aims to expand the small-scale data set into a larger and more informative data set by optimizing more accurate and diverse prompt sentences for model training, so as to improve the model performance.
[0053] The overall idea of the present invention is:
[0054] First, the model is trained without changing the prompt statement construction method in the original extension framework, and the experimental results are used to compare the subsequent methods.
[0055] Second, we construct prompt sentences based on the large language model, use these prompt sentences to guide the model to expand data, and compare the experimental results;
[0056] Third, we construct prompt sentences based on the knowledge base and large language model. Based on the language model and the rich knowledge information in Wikipedia, we construct high-quality prompt sentences to guide the model to expand the data set.
[0057] Fourth, the generated prompt statements are iteratively optimized based on the evolutionary algorithm. The selection, crossover, mutation and other operations in the genetic algorithm are used to gradually increase the diversity of the initial prompt statements. Then, an evaluation is performed to iterate out more accurate prompt statements.
[0058] like Figure 1 As shown, the present invention provides a data set expansion method based on a cultural graph model, comprising the following steps:
[0059] (1) Obtain an initial data set, which includes multiple data subjects.
[0060] Specifically, this step is to obtain the initial data set from the experimental data sets publicly available from various university research institutes, including the BreastMNIST data set of Shanghai Jiao Tong University, the Caltech data set of California Institute of Technology, and the Pets data set used to study animal image classification. In this data set, the data subjects are, for example, cats and dogs.
[0061] (2) The initial data set obtained in step (1) is input into a Guided Imagination Framework-Stable Diffusion (GIF-SD) model based on a stable diffusion model to obtain the image classification accuracy of the GIF-SD model.
[0062] (3) Obtain the Wikipedia knowledge graph and use a crawler algorithm to process the Wikipedia knowledge graph to obtain knowledge text related to multiple data set categories.
[0063] Specifically, the dataset category-related knowledge text in this step includes the subject label of each data subject (such as a cat) (such as Garfield), the appearance features of the data subject (such as black fur and big eyes), the usage scenarios of the data subject (such as cats often appear at the doorstep), etc.
[0064] The advantage of this step is that the Wikipedia knowledge graph is obtained, which provides a standard reference when the language model is used to generate prompt sentences in the future, thereby improving the accuracy of the prompt sentences.
[0065] (4) Input the dataset category-related knowledge text obtained in step (3) into the large language model GPT-3.5 to obtain multiple prompt sentences, and obtain the corresponding topic label in the dataset category-related knowledge text according to the data subject corresponding to each prompt sentence as the file index of the prompt sentence.
[0066] For example, if a prompt statement corresponds to a data subject whose subject label in the knowledge text related to the dataset category is "Garfield", then first create a file named "Garfield.txt" and add the prompt statement to the file named "Garfield.txt"; when processing the remaining prompt statements whose subject label is "Garfield", there is no need to create a new file, just add it to the file named "Garfield.txt", and finally obtain the "Garfield.txt" file as the file index of the prompt statement whose subject label is "Garfield".
[0067] The advantage of this step is that it adopts a prompt generation method based on the text graph model, which effectively solves the problem of insufficient prompt sentence diversity and insufficient information.
[0068] (5) Using the file indexes of all prompt statements obtained in step (4), the GIF-SD model is updated to obtain an updated GIF-SD model.
[0069] The original prompt sentence construction method in the GIF-SD model is: set up two lists to store several common domain names (such as "an image of", "an oil painting of", etc.) and several common adjectives (such as "colorful", "stylized", etc.), and then use string concatenation to randomly select common domain names or common adjectives from the two lists and concatenate them with category names (such as "cat") to generate prompt sentences such as "an image of colorful cat" to guide dataset expansion.
[0070] In this step, the construction method of the prompt statement is modified to read the prompt statement file index obtained in step (4) according to the subject tag of the data body.
[0071] Specifically, this step includes: first, annotating the construction method of the prompt statement in the source code of the GIF-SD model to obtain a blank prompt statement list; then, using the open function in the Python language to upload the file indexes of all prompt statements obtained in step (4) to the blank prompt statement list to obtain a new prompt statement list; and finally, saving the new prompt statement list to the GIF-SD model to obtain an updated GIF-SD model.
[0072] (6) Perform expansion processing on each data in the updated GIF-SD model obtained in step (5) to obtain expanded data (for performing classification tasks).
[0073] Specifically, this step is to execute the instruction of the expansion task in the updated GIF-SD model, so as to perform expansion processing on each data in the GIF-SD model to obtain the expanded data.
[0074] (7) Obtain the task to be classified, and use the expanded data obtained in step (6) to run the task to be classified to obtain the accuracy of the updated GIF-SD model, and determine whether the accuracy is greater than the image classification accuracy of the GIF-SD model obtained in step (2). If so, record the accuracy; otherwise, proceed to step (8).
[0075] (8) Use an evolutionary algorithm to iteratively optimize all prompt statements obtained in step (4) to obtain multiple optimized prompt statements (such as Figure 2 shown).
[0076] This step specifically includes the following steps:
[0077] (8-1) Set counter i=1.
[0078] (8-2) Determine whether i is greater than or equal to a preset number of iterations (the value range is 30 to 70, preferably 50). If so, the process ends; otherwise, proceed to step (8-3).
[0079] (8-3) Determine whether i is equal to 1. If so, proceed to step (8-4); otherwise, proceed to step (8-5).
[0080] (8-4) Use all prompt statements obtained in step (4) as the initial population in the evolutionary algorithm, and then proceed to step (8-5).
[0081] (8-5) Perform a crossover operation on the initial population, that is, randomly select any two prompt sentences in the initial population and combine their features (such as the sentence format of the prompt sentence, subject-related adjectives, etc.) to obtain multiple prompt sentences that are updated once.
[0082] For example, if the initial population contains the following two prompt statements:
[0083] Prompt 1: A happy blue-eyed Samoyed dog running happily on the beach.
[0084] Prompt 2: A white-haired Samoyed dog is lying on the grass under the tree.
[0085] In the crossover operation in this step, the topic-related adjective "blue eyes" in prompt1 is randomly added to prompt2 to obtain an updated prompt sentence: "A white-haired, blue-eyed Samoyed dog is lying on the grass under the tree."
[0086] (8-6) Perform a mutation operation on each of the once-updated prompt statements obtained in step (8-5) (i.e., perform random or guided modifications, such as replacing color-related words, etc., to explore untried prompt statement forms and improve the diversity of prompt statements) to obtain a second-updated prompt statement.
[0087] For example, with respect to the prompt sentence obtained in the example shown in step (8-5): "A Samoyed dog with white hair and blue eyes is lying on the grass under the tree", this step transforms the color adjective "white" into "black" and "blue" into "green" to obtain the second updated prompt sentence: "A Samoyed dog with black hair and green eyes is lying on the grass under the tree".
[0088] (8-7) Perform an evaluation operation on each prompt statement after the first update obtained in step (8-5) and each prompt statement after the second update obtained in step (8-6) to obtain an excellence score for each prompt statement.
[0089] Specifically, this step is for each prompt statement obtained, and the file index of the prompt statement is used to update the GIF-SD model to obtain an updated GIF-SD model, and then, each data in the updated GIF-SD model is expanded to obtain expanded data, and then, the expanded data is used to run the classification task, and the prompt statement is scored according to the classification accuracy. The higher the accuracy, the higher the excellence score of the prompt statement, and vice versa.
[0090] (8-8) From all the excellence scores obtained in step (8-7), select multiple prompt sentences with the highest excellence scores to form an initial population.
[0091] (8-9) Set i=i+1 and return to step (8-2);
[0092] The advantage of the above steps (8-5) to (8-9) is that the crossover, mutation, evaluation, and selection operations in the evolutionary algorithm are used to further increase the amount of information in the prompt statement, and the prompt statement that can improve the accuracy of the model is determined to enter the next round of optimization.
[0093] (9) Using all the prompt statements optimized in step (8), the file indexes of all the prompt statements obtained in step (4) are updated to obtain updated file indexes of multiple prompt statements.
[0094] Specifically, the prompt statement in the corresponding original file index is replaced with the optimized prompt statement, and this process does not change the file index name to obtain an updated file index.
[0095] For example, the file "Garfield.txt" contains several prompts about Garfield. This step is to evolve these prompt statements, and then overwrite these evolved prompt statements with the content in the file "Garfield.txt" to complete the update.
[0096] (10) Using the file indexes of all updated prompt statements obtained in step (9), the GIF-SD model is updated to obtain an updated GIF-SD model.
[0097] (11) Perform expansion processing on each data in the updated GIF-SD model obtained in step (10) to obtain expanded data.
[0098] Performance Testing
[0099] Obtain the task to be classified, and use the obtained expanded data to run the task to be classified to obtain the accuracy of the updated GIF-SD model, and record and save the accuracy of the updated GIF-SD model, and tabulate the experimental results, as shown in the following table:
[0100]
[0101] In the above table, the first line shows the model accuracy on different data sets after expanding the data using the original prompt construction method of the GIF-SD model, which serves as the control group; the second line shows the model accuracy on different data sets after expanding the data using the language model GPT-3.5 to construct the prompt method, and the percentage points in brackets are the model accuracy compared to the control group; the third line shows the model accuracy on different data sets after expanding the data by combining Wikipedia knowledge and using the language model GPT-3.5 to construct the prompt method; the fourth line shows the model accuracy on different data sets after expanding the data using the prompt statement optimized by the evolutionary algorithm.
[0102] As can be seen from the table above, the method of automatically generating prompt sentences using the language model GPT-3.5 shows excellent performance on datasets with simple structures and clear categories. This shows that when the target categories are relatively small and highly distinguishable, GPT-3.5 can efficiently understand and generate effective prompts that help model training.
[0103] However, for datasets with complex classification, many categories and high similarity, this method shows some limitations. This may be because the increased complexity of the classification makes it difficult for the automatically generated prompts to cover all the details or to accurately identify the subtle differences between categories. Despite the decline in performance, GPT-3.5 is still a worthy approach overall, especially for situations with limited resources. It provides a solution that relies less on professional manual editing and has a higher degree of automation.
[0104] The method of constructing prompt statements with the help of Wikipedia knowledge graph content combined with language models is more adaptable. This method takes advantage of the rich content and information accuracy of Wikipedia, and automatically generates prompt text that is highly relevant to a given category through the advanced language processing capabilities of the language model, thereby providing more accurate guidance for expanding the dataset for the generated image model. This method can increase the richness and diversity of data while maintaining high accuracy, and is excellent in improving the ability of the model to expand the dataset.
[0105] The prompt statement optimization based on evolutionary algorithm shows more obvious advantages in the experiment. Through a series of detailed experiments, the present invention finds that this method has high adaptability and effectiveness on various data sets. By combining with the initial prompt statement built based on the knowledge base, the evolutionary algorithm can continuously explore new combinations and deformations, thereby refining more efficient prompt statements. The optimized prompt statement has improved accuracy and precision in data set expansion tasks.
[0106] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A dataset expansion method based on a text graph model, characterized in that: The following steps are involved: (1) Obtain an initial data set, which includes multiple data subjects. (2) The initial data set obtained in step (1) is input into the guided imagination framework GIF-SD model based on the stable diffusion model to obtain the image classification accuracy of the GIF-SD model. (3) Obtain the Wikipedia knowledge graph and use a crawler algorithm to process the Wikipedia knowledge graph to obtain knowledge text related to multiple data set categories. (4) Input the dataset category-related knowledge text obtained in step (3) into the large language model GPT-3.5 to obtain multiple prompt word sentences, and obtain the corresponding topic label in the dataset category-related knowledge text according to the data subject corresponding to each prompt sentence as the file index of the prompt sentence. (5) Using the file indexes of all prompt statements obtained in step (4), the GIF-SD model is updated to obtain an updated GIF-SD model. (6) Perform expansion processing on each data in the updated GIF-SD model obtained in step (5) to obtain expanded data. (7) Obtain the task to be classified, and use the expanded data obtained in step (6) to run the task to be classified to obtain the accuracy of the updated GIF-SD model, and determine whether the accuracy is greater than the image classification accuracy of the GIF-SD model obtained in step (2). If so, record the accuracy; otherwise, proceed to step (8). (8) Use an evolutionary algorithm to iteratively optimize all prompt statements obtained in step (4) to obtain multiple optimized prompt statements. (9) Using all the prompt statements optimized in step (8), the file indexes of all the prompt statements obtained in step (4) are updated to obtain updated file indexes of multiple prompt statements. (10) Using the file indexes of all updated prompt statements obtained in step (9), the GIF-SD model is updated to obtain an updated GIF-SD model. (11) Perform expansion processing on each data in the updated GIF-SD model obtained in step (10) to obtain expanded data.
2. The method for expanding a data set based on a cultural graph model according to claim 1, characterized in that: The dataset category-related knowledge text in step (3) includes the subject label of each data subject, the appearance features of the data subject, and the usage scenarios of the data subject, etc.
3. The dataset expansion method based on the cultural graph model according to claim 1 or 2, characterized in that: Step (5) specifically includes, first, annotating the construction method of the prompt statement in the source code of the GIF-SD model to obtain a blank prompt statement list, then using the open function in the Python language to upload the file indexes of all prompt statements obtained in step (4) to the blank prompt statement list to obtain a new prompt statement list, and finally, saving the new prompt statement list to the GIF-SD model to obtain an updated GIF-SD model.
4. The method for expanding a data set based on a cultural graph model according to any one of claims 1 to 3, characterized in that: Step (6) specifically includes executing the instruction of the expansion task in the updated GIF-SD model, thereby performing expansion processing on each data in the GIF-SD model to obtain the expanded data.
5. The method for expanding a data set based on a cultural graph model according to claim 4, characterized in that: Step (8) comprises the following steps: (8-1) Set counter i=1. (8-2) Determine whether i is greater than or equal to a preset number of iterations (the value range is 30 to 70, preferably 50). If so, the process ends; otherwise, proceed to step (8-3). (8-3) Determine whether i is equal to 1. If so, proceed to step (8-4); otherwise, proceed to step (8-5). (8-4) Use all prompt statements obtained in step (4) as the initial population in the evolutionary algorithm, and then proceed to step (8-5). (8-5) Perform a crossover operation on the initial population, that is, randomly select any two prompt statements in the initial population and combine their features to obtain multiple prompt statements after one update. (8-6) Perform a mutation operation on each of the once-updated prompt statements obtained in step (8-5) to obtain a second-updated prompt statement. (8-7) Perform an evaluation operation on each prompt statement after the first update obtained in step (8-5) and each prompt statement after the second update obtained in step (8-6) to obtain an excellence score for each prompt statement. (8-8) From all the excellence scores obtained in step (8-7), select multiple prompt sentences with the highest excellence scores to form an initial population. (8-9) Set i=i+1 and return to step (8-2).
6. The method for expanding a data set based on a cultural graph model according to claim 5, characterized in that: Step (8-7) is for each prompt statement obtained. The file index of the prompt statement is used to update the GIF-SD model to obtain an updated GIF-SD model. Then, each data in the updated GIF-SD model is expanded to obtain expanded data. Subsequently, the expanded data is used to run the classification task, and the prompt statement is scored according to the classification accuracy. The higher the accuracy, the higher the excellence score of the prompt statement, and vice versa.
7. A dataset expansion method based on a text graph model, characterized in that: include: The first module is used to obtain an initial data set, which includes multiple data subjects. The second module is used to input the initial data set obtained in the first module into the guided imagination framework GIF-SD model based on the stable diffusion model to obtain the image classification accuracy of the GIF-SD model. The third module is used to obtain the Wikipedia knowledge graph and process it using a crawler algorithm to obtain knowledge texts related to multiple data set categories. The fourth module is used to input the dataset category-related knowledge text obtained in the third module into the large language model GPT-3.5 to obtain multiple prompt word sentences, and obtain the corresponding topic label in the dataset category-related knowledge text according to the data subject corresponding to each prompt sentence as the file index of the prompt sentence. The fifth module is used to update the GIF-SD model using the file indexes of all prompt statements obtained by the fourth module to obtain an updated GIF-SD model. The sixth module is used to perform expansion processing on each data in the updated GIF-SD model obtained by the fifth module to obtain expanded data. The seventh module is used to obtain the task to be classified, and use the expanded data obtained in the sixth module to run the task to be classified to obtain the accuracy of the updated GIF-SD model, and determine whether the accuracy is greater than the image classification accuracy of the GIF-SD model obtained in the second module. If so, record the accuracy, otherwise proceed to the eighth module. The eighth module is used to use an evolutionary algorithm to iteratively optimize all prompt statements obtained in the fourth module to obtain multiple prompt statements after optimization. The ninth module is used to update the file indexes of all prompt statements obtained by the fourth module using all prompt statements optimized by the eighth module to obtain updated file indexes of multiple prompt statements. The tenth module is used to update the GIF-SD model using the file indexes of all updated prompt statements obtained by the ninth module to obtain an updated GIF-SD model. The eleventh module is used to perform expansion processing on each data in the updated GIF-SD model obtained by the tenth module to obtain expanded data.
Citation Information
Patent Citations
Construction method of intelligent question answering system based on computer subject knowledge graph
CN115840805A
Specific field text classification labeling method and system based on large language model
CN118093870A
Text video retrieval optimization method based on text-to-image technology
CN118377933A