Model training data set generation method and device, computer equipment, readable storage medium and program product
By generating chart source data and forming question-answer pairs using a large language model, the problem of insufficient datasets for chart analysis models is solved, enabling efficient generation of training datasets for chart analysis models and improving the model's analytical capabilities.
Patent Information
- Application Number
- CN202411714900.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-11
AI Technical Summary
In existing technologies, the number of datasets used to train chart analysis models is insufficient, resulting in low model performance, and the construction of datasets requires a lot of human and material resources.
The system generates source data for charts that meet given conditions using a large language model, and then generates question-and-answer pairs that are related to the content of the charts based on this data. Finally, it draws the chart images and question-and-answer pairs to form a chart question-and-answer dataset for training the model.
It enables the rapid and efficient generation of high-quality chart question-and-answer datasets, improving the ability of multimodal chart analysis models to understand and analyze chart content and enhancing model performance.
Smart Images

Figure CN119600619A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial technology, and in particular to a method, apparatus, computer device, computer-readable storage medium and computer program product for generating a model training data set. Background Art
[0002] In the field of multimodal artificial intelligence, the chart analysis model can understand and analyze chart data and answer various questions related to the chart. This model combines large language models and computer vision technology to identify values, trends and patterns in charts and provide in-depth data analysis and prediction. It can be widely used in education, business intelligence, scientific research and other fields to help users quickly analyze and obtain information and make data-driven decisions.
[0003] However, there are also problems with chart analysis models. The number of data sets used to train chart analysis models is often relatively small, and traditional technologies require a lot of manpower and material resources to build data sets for training chart analysis models, which is often not conducive to improving the application and effectiveness of chart analysis models.
[0004] Therefore, the chart analysis models in traditional technologies are constrained by limited data sets and have the problem of low efficiency. Summary of the invention
[0005] Based on this, it is necessary to provide a model training data set generation method, device, computer equipment, computer-readable storage medium and computer program product that can improve the effectiveness of chart analysis models in response to the above technical problems.
[0006] In a first aspect, the present application also provides a method for generating a model training data set, the method comprising:
[0007] Generate chart source data through a large language model; the chart source data includes chart content that meets a given chart generation condition;
[0008] Generate at least one set of question-answer pairs associated with the content of the chart based on the chart source data through the large language model; each set of the question-answer pairs includes question information for the content of the chart and answer information in response to the question information;
[0009] According to the chart source data, a chart image including the chart content is drawn, and the chart image and the at least one set of question-answer pairs are organized to obtain a chart question-answer dataset; the chart question-answer dataset is used to train a chart analysis model.
[0010] In one embodiment, generating chart source data by using a large language model includes:
[0011] Acquire a first prompt word; the first prompt word is used to instruct the large language model to acquire chart data according to the chart generation condition and generate chart content including the chart data; the chart generation condition at least includes a chart theme;
[0012] The first prompt word is input into the large language model, and the large language model responds to the first prompt word, outputs at least one chart content satisfying the chart theme, and obtains the chart source data.
[0013] In one embodiment, the chart generation condition further includes data trend and chart structure, and the step of responding to the first prompt word through the large language model to output at least one chart content that meets the chart generation condition includes:
[0014] Outputting at least one target chart content in response to the first prompt word through the large language model;
[0015] The target chart content includes a chart title and chart content of target chart data; the target chart data is chart data that meets the chart theme and the data trend and is organized according to the chart structure.
[0016] In one embodiment, generating at least one set of question-answer pairs associated with the content of the chart based on the chart source data by the large language model includes:
[0017] Acquire a second prompt word; the second prompt word is used to instruct the large language model to output a preset number of question-answer pairs according to the chart source data;
[0018] The second prompt word is input into the large language model, and the large language model responds to the second prompt word to output at least one set of question-answer pairs associated with the chart content; each set of the question-answer pairs includes question information output by the large language model for the chart content, and answer information provided by the large language model based on the chart content to answer the question information.
[0019] In one embodiment, the second prompt word is further used to instruct the large language model to output a question-answer pair in a given question-answer pair format, and the large language model responds to the second prompt word to output at least one set of question-answer pairs associated with the content of the chart, including:
[0020] Outputting at least one target question-answer pair in response to the second prompt word through the large language model;
[0021] The target question-answer pair includes a question-answer pair obtained by organizing at least one question information and answer information corresponding to the question information by the large language model according to the question-answer pair format.
[0022] In one embodiment, drawing a chart image including the chart content according to the chart source data comprises:
[0023] Randomly determine at least one set of chart appearance attributes; the chart appearance attributes include at least one of chart color, line style, font style, font size, or legend style;
[0024] According to the chart drawing style corresponding to the at least one group of chart appearance attributes, a target chart image is drawn based on the chart source data; the target chart image is a chart image including the chart content.
[0025] In a second aspect, the present application also provides a device for generating a model training data set, the device comprising:
[0026] A chart data generation module, used to generate chart source data through a large language model; the chart source data includes chart content that meets a given chart generation condition;
[0027] A question-answer data generation module, configured to generate at least one set of question-answer pairs associated with the content of the chart based on the chart source data through the large language model; each set of the question-answer pairs includes question information for the content of the chart and answer information in response to the question information;
[0028] A data set generation module is used to draw a chart image including the chart content based on the chart source data, and organize the chart image and the at least one set of question and answer pairs to obtain a chart question and answer data set; the chart question and answer data set is used to train a chart analysis model.
[0029] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0030] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0031] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.
[0032] The above-mentioned model training data set method, apparatus, computer equipment, computer-readable storage medium and computer program product generate chart source data through a large language model, and the chart source data includes chart content that meets given chart generation conditions; and generate at least one set of question-answer pairs associated with the chart content based on the chart source data through the large language model; each set of question-answer pairs includes question information for the chart content, and answer information in response to the question information; then, based on the chart source data, a chart image including the chart content is drawn, and the chart image and at least one set of question-answer pairs are organized to obtain a chart question-answer data set for training the chart analysis model; in this way, it is possible to quickly and effectively generate a chart question-answer data set whose quality and language meet the model training requirements through a large language model to support the training of a large multimodal chart analysis model, effectively improve the ability of the large multimodal chart analysis model in understanding and analyzing chart content, and improve the effectiveness of the chart analysis model. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 An application environment diagram of a method for generating a model training data set in one embodiment;
[0035] Figure 2 A schematic diagram of a flow chart of a method for generating a model training data set in one embodiment;
[0036] Figure 3a A rendering of a target chart image in one embodiment;
[0037] Figure 3b It is a rendering of another target chart image in one embodiment;
[0038] Figure 3c A rendering of yet another target chart image in one embodiment;
[0039] Figure 4 A schematic diagram of a flow chart of a method for generating a model training data set in another embodiment;
[0040] Figure 5 A structural block diagram of a model training data set generating device in one embodiment;
[0041] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application 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 application and are not used to limit the present application.
[0043] The model training data set generation method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. A large language model is deployed on the server 104. In actual applications, the terminal 102 can generate chart source data through the large language model deployed on the server 104; the chart source data includes chart content that meets the given chart generation conditions; the terminal 102 can generate at least one set of question-answer pairs associated with the chart content based on the chart source data through the large language model deployed on the server 104; each set of question-answer pairs includes question information for the chart content, and answer information in response to the question information; the terminal 102 can draw a chart image including the chart content according to the chart source data, and organize the chart image and at least one set of question-answer pairs to obtain a chart question-answer data set; the chart question-answer data set is used to train the chart analysis model. Of course, the above-mentioned large language model can also be deployed locally on the terminal 102 for operation, and the mode of operation of the large language model is not limited here. The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, etc. The server 104 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0044] In an exemplary embodiment, Figure 2 As shown, a method for generating a model training data set is provided, and the method is applied to Figure 1 The terminal 102 in the example is used as an example to illustrate, including the following steps S202 to S206. Among them:
[0045] Step S202, generating chart source data through a large language model; the chart source data includes chart content that meets given chart generation conditions.
[0046] The chart source data may refer to source data used to generate a chart object.
[0047] The chart generation conditions may refer to some conditions or requirements that need to be met when generating a chart object to meet the purpose or needs of the user. For example, the chart generation conditions may include chart theme, data source, chart format, data trend, chart category, etc.
[0048] In a specific implementation, the terminal can obtain a chart source data generation instruction; the chart source data generation instruction is configured with the user's chart generation conditions for the chart content, and the terminal can input the chart source data generation instruction into the large language model. The large language model can generate chart content that meets the given chart generation conditions, such as chart data, chart title, etc., according to the chart generation conditions expressed by the chart source data generation instruction, to output the chart source data.
[0049] Step S204: Generate at least one set of question-answer pairs associated with the content of the chart based on the chart source data using a large language model.
[0050] Each question-answer pair includes question information regarding the content of the chart and answer information in response to the question information.
[0051] The question information may refer to questions raised about the chart content of the chart source data, for example, asking about the chart title, chart trend, analyzing chart content, maximum and minimum values, abnormal values, etc.
[0052] The answer information may refer to the answers to the above questions based on the chart content of the corresponding chart source data.
[0053] In a specific implementation, the terminal can obtain a question-answer pair generation instruction; the question-answer pair generation instruction is configured with a series of generation requirements of the user for the question-answer pair; the terminal can input the question-answer pair generation instruction into the large language model, and the large language model can generate at least one set of question-answer pairs associated with the chart content that meets the question-answer pair generation requirements expressed by the question-answer pair generation instruction.
[0054] Step S206, drawing a chart image including the chart content according to the chart source data, and organizing the chart image and at least one set of question-answer pairs to obtain a chart question-answer dataset; the chart question-answer dataset is used to train the chart analysis model.
[0055] In practical applications, manual sampling can also be used to ensure the quality of the model training data set. In practical applications, the quality of the question-answer pairs generated by the large language model can be tested by manually sampling the chart source data generated in step S204 and the question-answer pairs generated in step S206. If they do not meet the preset requirements, the contents of the chart source data generation instructions and the question-answer pair generation instructions can be adjusted in time to generate more expected question-answer pairs.
[0056] In a specific implementation, the terminal can also draw a chart image including chart content based on the chart source data; specifically, the terminal can call a preconfigured chart drawing tool to draw chart images with diverse styles to increase the visual diversity of the data set, so that the model can adapt to learning charts of different styles and styles.
[0057] Then, the terminal can organize the chart image and at least one set of question-answer pairs to obtain a chart question-answer dataset. Specifically, the terminal can organize the chart image and at least one set of question-answer pairs into a dataset that satisfies the training format required by the chart analysis model; for example, the terminal can organize the chart image and at least one set of question-answer pairs into the following json format:
[0058] {
[0059] "id": "bar_1",
[0060] "image": "bar_1.jpg",
[0061] "conversations": [
[0062] {
[0063] "from": "human",
[0064] "value": " \nWhat is the title of the picture? "
[0065] },
[0066] {
[0067] "from": "gpt",
[0068] "value": "Use of environmentally friendly bicycles in cities"
[0069] }
[0070] }
[0071] In practical applications, the language used in question-answer pairs can be Chinese, which makes the chart question-answering dataset a Chinese chart question-answering dataset for training Chinese multimodal large models, improving the ability of the modal chart analysis large model to understand and analyze chart content in a Chinese environment.
[0072] In the above-mentioned model training data set generation method, chart source data is generated through a large language model, and the chart source data includes chart content that meets given chart generation conditions; and at least one set of question-answer pairs associated with the chart content is generated based on the chart source data through the large language model; each set of question-answer pairs includes question information for the chart content, and answer information in response to the question information; then, based on the chart source data, a chart image including the chart content is drawn, and the chart image and at least one set of question-answer pairs are organized to obtain a chart question-answer data set for training the chart analysis model; in this way, it is possible to quickly and effectively generate a chart question-answer data set whose quality and language meet the model training requirements through a large language model, so as to support the training of a large multimodal chart analysis model, effectively improve the ability of the large multimodal chart analysis model in understanding and analyzing chart content, and improve the effectiveness of the chart analysis model.
[0073] In an exemplary embodiment, generating chart source data through a large language model includes: obtaining a first prompt word; the chart generation condition includes at least a chart theme; inputting the first prompt word into the large language model, and responding to the first prompt word through the large language model to output at least one chart content that meets the chart theme, thereby obtaining the chart source data.
[0074] The first prompt word is used to instruct the large language model to obtain chart data according to the chart generation conditions and generate chart content including the chart data. The chart generation conditions may include chart theme, data trend, chart structure, etc.
[0075] For example, an example of the first prompt word is as follows:
[0076] “You are an expert at generating data for a chart. You will be given several key features about the data. Your final output should include the title of the chart, the data. The theme of the chart is {topic}, and you can use your imagination around the topic and use real-world data whenever possible.
[0077] Different series of data in a chart may have different trends. The trends in the charted data should include as many of the given trends as possible: {trend}. The data should be diverse and contain some outliers. The number of rows in a table is {row} rows, and the number of columns in a table is {col} columns.
[0078] Generate tabular data according to the horizontal axis of the chart being the first column of the table and the vertical axis being the second column of the table, so that you can draw the chart directly using Python later.
[0079] The table titles you generate should strictly be enclosed in symbols <title> and< / title> In the example, the title should be named according to the specific data generated, and the subject should not be used directly as the title. The data should be strictly contained in the symbol <data> and< / data> middle.
[0080] Here is an example format:
[0081] <title> Energy consumption< / title>
[0082] <data>
[0083] Time, Energy consumption (kWh)
[0084] January,700
[0085] February, 600
[0086] March,500
[0087] < / data>
[0088] Please generate data according to this format."
[0089] In actual applications, the first prompt word mentioned above can be used for reference, and the first prompt word mentioned above can also be modified according to different styles of charts. For example, a bar chart or a line chart can add a trend {trend} to generate charts with various trends, trends = ["continued rise", "continued fall", "oscillation", "rise first then fall", "fall first then rise", "cyclical fluctuation", "stable", "exponential growth"], etc.
[0090] Pie charts do not need trends {trend}, and the trend description can be deleted from the prompt word. More complex charts can be generated by combining the number of rows {row} and the number of columns {col}, for example, two rows and two columns are single-column charts, and two rows and three columns are double-column charts. The topic {topic} is set in advance according to the chart style. For example, pie chart topics = ["food consumption proportion", "expenditure structure", "sales channel distribution", "energy consumption proportion", "market share", "population age distribution", "education level distribution", "income source", "company cost structure"], etc., can generate percentage topics. The topic list can be expanded indefinitely, so that the large language model can generate charts with rich and diverse topics covering various fields.
[0091] In a specific implementation, during the process of generating chart source data through a large language model, the terminal can obtain a first prompt word; the terminal can input the first prompt word into the large language model, respond to the first prompt word through the large language model, output at least one chart content that meets the chart theme, and obtain the chart source data.
[0092] When the table generation conditions also include data trends and chart structures, the terminal can respond to the first prompt word through a large language model and output at least one target chart content; wherein the target chart content includes a chart title and chart content of target chart data; the target chart data is chart data that meets the chart theme and data trends and is organized according to the chart structure.
[0093] The technical solution of this embodiment obtains a first prompt word; inputs the first prompt word into a large language model, and the large language model responds to the first prompt word and outputs at least one chart content that meets the chart theme, thereby generating chart source data that can meet the model training data requirements through the large language model. At the same time, the first prompt word can well guide the large language model to generate the title, category and value of the chart according to a specific theme, and can automatically generate chart data with rich and diverse themes, reducing the workload and time cost of manually compiling data sets.
[0094] In an exemplary embodiment, at least one set of question-answer pairs associated with the chart content is generated based on chart source data through a large language model, including: obtaining a second prompt word; inputting the second prompt word into the large language model, and responding to the second prompt word through the large language model to output at least one set of question-answer pairs associated with the chart content; each set of question-answer pairs includes question information output by the large language model for the chart content, and answer information of the large language model for answering the question information based on the chart content.
[0095] The second prompt word is used to instruct the large language model to output a preset number of question-answer pairs according to the source data of the chart. In practical applications, the preset number may be 5.
[0096] The second prompt word is also used to instruct the large language model to output a question-answer pair in a given question-answer pair format.
[0097] For example, an example of the second prompt word is as follows:
[0098] “You are an AI visual assistant that can analyze charts. You receive the raw data values about the line chart. The raw data of the chart is as follows:
[0099] {raw_data}
[0100] Contains chart name, horizontal and vertical axes, and specific numerical information.
[0101] Please design 5 question-answer pairs. Ask different questions and give corresponding answers. For example, ask about the chart title, chart trend, analyze the chart content, maximum and minimum values, outliers, etc. Be as diverse as possible when asking questions.
[0102] The answer should be accurate. Pay special attention to describing the chart in as much detail as possible when answering descriptive analysis questions, focusing on several key elements: the title of the chart, the theme, the overall trend of the data, individual trends within the data, comparisons between data, any outliers in the chart, suggested conclusions, etc.
[0103] The generated questions should strictly contain the symbol <q> and< / q> The generated answer should strictly contain the symbol andmiddle.
[0104] Here is an example of the format of a generated question-answer pair:
[0105] <q> xxx< / q>
[0106] xxx
[0107] Please generate data according to this format."
[0108] In a specific implementation, in the process of generating at least one set of question-answer pairs associated with the content of the chart based on the chart source data through a large language model, the terminal can obtain the above-mentioned second prompt word and input the above-mentioned second prompt word into the large language model, and generate questions related to the content of the chart through the chart source data generated by the large language model, and ask and answer them by itself, and accurately answer these questions in turn to form a preset number of question-answer pairs.
[0109] Optionally, in the process of the terminal responding to the second prompt word through the large language model and outputting at least one set of question-answer pairs associated with the content of the chart, the terminal may respond to the second prompt word through the large language model and output at least one target question-answer pair; wherein the target question-answer pair includes a question-answer pair obtained by organizing at least one question information and answer information corresponding to the question information according to the question-answer pair format by the large language model.
[0110] The technical solution of this embodiment obtains a second prompt word; inputs the second prompt word into a large language model, and the large language model responds to the second prompt word to output at least one target question-answer pair; wherein the target question-answer pair includes a question-answer pair obtained by organizing at least one question information and answer information corresponding to the question information in a question-answer pair format by the large language model, and can realize the use of chart source data previously generated by the large language model to automatically generate questions and answers related to the chart content, thereby effectively improving the practicality and contextual richness of the data set, and providing a more realistic and complex language environment for the training of the chart analysis model.
[0111] In an exemplary embodiment, drawing a chart image including chart content according to chart source data includes: randomly determining at least one set of chart appearance attributes; and drawing a target chart image based on the chart source data according to a chart drawing style corresponding to the at least one set of chart appearance attributes.
[0112] The target chart image is a chart image including chart content.
[0113] The chart appearance attributes include at least one of chart color, line style, font style, font size or legend style.
[0114] In a specific implementation, when the terminal draws a chart image including chart content according to the chart source data, the terminal can call a preset chart drawing tool according to the chart source data generated by the large language model, randomly select chart color, line style, font style, font size, legend style and other chart appearance attributes, and generate target chart images with various styles. To facilitate understanding by those skilled in the art, Figure 3a , Figure 3b , Figure 3c Target chart images with different chart drawing styles are provided respectively.
[0115] The technical solution of this embodiment, by randomly determining chart appearance attributes such as chart color, line style, font style, font size or legend style, draws chart images of various chart styles based on chart source data, thereby effectively increasing the visual diversity of the data set and enabling the trained chart analysis model to adapt to learning charts of different styles and styles.
[0116] In another embodiment, Figure 4 As shown, a method for generating a model training data set is provided, and the method is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:
[0117] Step S402: input the first prompt word into the large language model, and generate chart source data through the large language model; the chart source data includes chart content that meets given chart generation conditions.
[0118] Step S404, input the second prompt word into the large language model, and generate at least one set of question-answer pairs associated with the chart content based on the chart source data through the large language model; each set of question-answer pairs includes question information about the chart content and answer information in response to the question information.
[0119] Step S406, randomly determining at least one set of chart appearance attributes; the chart appearance attributes include at least one of chart color, line style, font style, font size or legend style.
[0120] Step S408, drawing a target chart image based on the chart source data in accordance with a chart drawing style corresponding to at least one set of chart appearance attributes; the target chart image is a chart image including chart content.
[0121] Step S410, organizing a chart image and at least one set of question-answer pairs to obtain a chart question-answer dataset; the chart question-answer dataset is used to train a chart analysis model.
[0122] It should be noted that the specific limitations of the above steps can refer to the specific limitations of a method for generating a model training data set above.
[0123] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0124] Based on the same inventive concept, the embodiment of the present application also provides a model training data set generation device for implementing the model training data set generation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more model training data set generation device embodiments provided below can refer to the limitations of the model training data set generation method above, and will not be repeated here.
[0125] In an exemplary embodiment, Figure 5 As shown, a model training data set generation device is provided, comprising:
[0126] A chart data generation module 510 is used to generate chart source data through a large language model; the chart source data includes chart content that meets a given chart generation condition;
[0127] A question-answer data generation module 520, configured to generate at least one set of question-answer pairs associated with the chart content based on the chart source data through the large language model; each set of the question-answer pairs includes question information for the chart content and answer information in response to the question information;
[0128] The data set generation module 530 is used to draw a chart image including the chart content based on the chart source data, and organize the chart image and the at least one set of question and answer pairs to obtain a chart question and answer data set; the chart question and answer data set is used to train the chart analysis model.
[0129] In one embodiment, the chart data generation module 510 is specifically used to obtain a first prompt word; the first prompt word is used to instruct the large language model to obtain chart data according to the chart generation condition and generate chart content including the chart data; the chart generation condition at least includes a chart theme; the first prompt word is input into the large language model, and the large language model responds to the first prompt word, outputs at least one chart content that meets the chart theme, and obtains the chart source data.
[0130] In one embodiment, the chart generation condition also includes data trends and chart structures. The chart data generation module 510 is specifically used to respond to the first prompt word through the large language model and output at least one target chart content; wherein the target chart content includes a chart title and chart content of target chart data; the target chart data is chart data that meets the chart theme and the data trend and is organized according to the chart structure.
[0131] In one embodiment, the question-answer data generation module 520 is specifically used to obtain a second prompt word; the second prompt word is used to instruct the large language model to output a preset number of question-answer pairs according to the chart source data; the second prompt word is input into the large language model, and the large language model responds to the second prompt word to output at least one group of question-answer pairs associated with the chart content; each group of the question-answer pairs includes question information output by the large language model for the chart content, and answer information of the large language model answering the question information based on the chart content.
[0132] In one of the embodiments, the second prompt word is also used to instruct the large language model to output a question-answer pair in a given question-answer pair format, and the question-answer data generation module 520 is specifically used to respond to the second prompt word through the large language model to output at least one target question-answer pair; wherein the target question-answer pair includes a question-answer pair obtained by organizing at least one question information and the answer information corresponding to the question information by the large language model in accordance with the question-answer pair format.
[0133] In one embodiment, the data set generation module 530 is specifically used to randomly determine at least one set of chart appearance attributes; the chart appearance attributes include at least one of chart color, line style, font style, font size or legend style; according to the chart drawing style corresponding to the at least one set of chart appearance attributes, draw a target chart image based on the chart source data; the target chart image is a chart image including the chart content.
[0134] Each module in the above-mentioned model training data set generation device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0135] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for generating a model training data set is implemented.
[0136] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0137] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned method for generating a model training data set. The steps of the above-mentioned method for generating a model training data set may be the steps of the above-mentioned method for generating a model training data set in each of the above-mentioned embodiments.
[0138] In one embodiment, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the processor executes the steps of the above-mentioned method for generating a model training data set. The steps of the above-mentioned method for generating a model training data set may be the steps of the above-mentioned method for generating a model training data set in each of the above-mentioned embodiments.
[0139] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the processor executes the steps of the above-mentioned method for generating a model training data set. The steps of the above-mentioned method for generating a model training data set may be the steps of the above-mentioned method for generating a model training data set in each of the above-mentioned embodiments.
[0140] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0141] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magneto resistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0142] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0143] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for generating a model training data set, characterized in that: The method comprises: Generate chart source data through a large language model; the chart source data includes chart content that meets a given chart generation condition; Generate at least one set of question-answer pairs associated with the content of the chart based on the chart source data through the large language model; each set of the question-answer pairs includes question information for the content of the chart and answer information in response to the question information; According to the chart source data, a chart image including the chart content is drawn, and the chart image and the at least one set of question-answer pairs are organized to obtain a chart question-answer dataset; the chart question-answer dataset is used to train a chart analysis model.
2. The method according to claim 1, characterized in that The generating of the chart source data by using the large language model includes: Acquire a first prompt word; the first prompt word is used to instruct the large language model to acquire chart data according to the chart generation condition and generate chart content including the chart data; the chart generation condition at least includes a chart theme; The first prompt word is input into the large language model, and the large language model responds to the first prompt word, outputs at least one chart content satisfying the chart theme, and obtains the chart source data.
3. The method according to claim 2, characterized in that The chart generation condition also includes data trends and chart structures, and the step of responding to the first prompt word through the large language model to output at least one chart content that meets the chart generation condition includes: Outputting at least one target chart content in response to the first prompt word through the large language model; The target chart content includes a chart title and chart content of target chart data; the target chart data is chart data that meets the chart theme and the data trend and is organized according to the chart structure.
4. The method according to claim 1, characterized in that: The step of generating at least one set of question-answer pairs associated with the content of the chart based on the chart source data by using the large language model includes: Acquire a second prompt word; the second prompt word is used to instruct the large language model to output a preset number of question-answer pairs according to the chart source data; The second prompt word is input into the large language model, and the large language model responds to the second prompt word to output at least one set of question-answer pairs associated with the chart content; each set of the question-answer pairs includes question information output by the large language model for the chart content, and answer information of the large language model answering the question information based on the chart content.
5. The method according to claim 4, characterized in that The second prompt word is also used to instruct the large language model to output a question-answer pair in a given question-answer pair format, and the large language model responds to the second prompt word to output at least one set of question-answer pairs associated with the content of the chart, including: Outputting at least one target question-answer pair in response to the second prompt word through the large language model; The target question-answer pair includes a question-answer pair obtained by organizing at least one question information and answer information corresponding to the question information by the large language model according to the question-answer pair format.
6. The method according to claim 1, characterized in that Drawing a chart image including the chart content according to the chart source data includes: Randomly determine at least one set of chart appearance attributes; the chart appearance attributes include at least one of chart color, line style, font style, font size, or legend style; According to the chart drawing style corresponding to the at least one group of chart appearance attributes, a target chart image is drawn based on the chart source data; the target chart image is a chart image including the chart content.
7. A device for generating a model training data set, characterized in that: The device comprises: A chart data generation module, used to generate chart source data through a large language model; the chart source data includes chart content that meets a given chart generation condition; A question-answer data generation module, configured to generate at least one set of question-answer pairs associated with the content of the chart based on the chart source data through the large language model; each set of the question-answer pairs includes question information for the content of the chart and answer information in response to the question information; A data set generation module is used to draw a chart image including the chart content based on the chart source data, and organize the chart image and the at least one set of question and answer pairs to obtain a chart question and answer data set; the chart question and answer data set is used to train a chart analysis model.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
MTU data decoupling formation and model training method, system and device and medium
CN119832579A
MTU Data Decoupling Synthesis and Model Training Method, System, Device and Medium
CN119832579B