Training data construction method, device, equipment, storage medium and program product
By generating database information and problem solutions for the target industry, combined with the rewriting of the questioner role, the training data of the business intelligence model is automatically constructed, and the problems of low efficiency and low quality of manual construction of training data are solved, achieving efficient and accurate data construction.
Patent Information
- Application Number
- CN202411838612.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-08
AI Technical Summary
In the prior art, the training data of the business intelligence (BI) model is usually constructed manually, resulting in an increase in time and labor costs, and is prone to introducing human errors, affecting the quality of the data.
By generating database information for the target industry based on the industry description and business needs of the target industry, including data tables, field business rules and association relationships, and generating initial problems and solutions based on this information. Finally, rewriting the problem based on the questioner's role information, and constructing training data.
It realizes automated construction of training data, improves the efficiency and accuracy of data construction, reduces the occurrence of human errors, and simplifies the data construction process.
Smart Images

Figure CN119782815A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a training data construction method, apparatus, device, storage medium and program product. Background Art
[0002] In the business intelligence (BI) scenario, you need to use a BI model (i.e., a large model that can solve BI problems) to complete data analysis for a specific industry or field. For example, you input a data table and a problem into the BI model, which outputs the solution corresponding to the problem. The solution is then called to process the data table to get the answer to the problem.
[0003] The training of BI large models requires a large number of training data sets. Each piece of training data in the training data set consists of a data table, questions raised about the data table, and solutions to the questions. Currently, the training data used to train BI models is usually constructed manually, which not only increases time and labor costs, but also easily introduces human errors, affecting the quality of training data. Summary of the invention
[0004] In view of the above problems, the present application provides a training data construction method, device, equipment, storage medium and program product to efficiently and accurately construct training data. The specific scheme is as follows:
[0005] The first aspect of the present application provides a training data construction method, comprising:
[0006] Based on the industry description and business requirements of the target industry, database information of the target industry is generated; the database information includes: at least one data table, description information of each data table, structure information of each data table, business rules to be followed by each field in the target industry, and associations between data tables; the description information of each data table represents an overview of the content of the data of the target industry recorded in the data table;
[0007] Corresponding to each of the preset multiple question types, generating multiple initial questions of the question type and a solution corresponding to each initial question according to the question type and the database information;
[0008] For each initial question, according to the initial question and its corresponding solution, and the role information of the questioner, the initial question is rewritten to obtain a rewritten question corresponding to the role information;
[0009] Each piece of training data consists of the at least one data table, a target problem and its corresponding solution; the target problem is an original problem or a rewritten problem.
[0010] In a possible implementation, generating database information of the target industry based on the industry description and business requirements of the target industry includes:
[0011] At least one table description information is generated according to the industry description and business requirements of the target industry; each table description information represents a content overview of the data of the target industry recorded in a data table;
[0012] According to each table description information, generate the structure information of the data table represented by each table description information;
[0013] At least according to the structural information of each data table, the association relationship between the data tables, the business rules that each field needs to follow in the target industry, and the at least one data table are generated in sequence.
[0014] In a possible implementation, the step of sequentially generating, at least according to the structural information of each data table, the association relationship between the data tables, the business rules to be followed by each field in the target industry, and the at least one data table includes:
[0015] At least establishing an association relationship between data tables based on structural information of each data table;
[0016] At least based on the structural information of each data table and the association relationship between the data tables, generate the business rules that each field should follow in the target industry;
[0017] At least according to the structural information of each data table and the business rules that each field needs to follow in the target industry, data is filled in each data table to obtain at least one data table.
[0018] In a possible implementation, filling data in each data table at least according to the structural information of each data table and the business rules that each field needs to follow in the target industry to obtain at least one data table includes:
[0019] Filling data in each data table at least according to the structural information of each data table and the business rules that each field should follow in the target industry to obtain at least one initial data table;
[0020] Each initial data table is processed and improved according to the business rules that each field needs to follow in the target industry to obtain at least one data table.
[0021] In a possible implementation, generating database information of the target industry based on the industry description and business requirements of the target industry includes:
[0022] Performing multi-step processing based on the industry description and business requirements of the target industry through the big model, sequentially generating description information of each data table, structural information in each data table, associations between data tables, business rules that each field must follow in the target industry, and the at least one data table;
[0023] In each processing step, the large model generates a processing result corresponding to the step according to the prompt word corresponding to the step.
[0024] In a possible implementation, before rewriting the initial question, the following is also included:
[0025] Proofread each solution to ensure accuracy and / or efficiency of each solution;
[0026] The process of rewriting the initial question includes:
[0027] Corresponding to each initial question, the initial question is rewritten according to the initial question and its corresponding proofread solution, as well as the role information of the questioner, to obtain a rewritten question corresponding to the role information.
[0028] In a possible implementation, the role information includes: role definition and question requirements.
[0029] A second aspect of the present application provides a training data construction device, comprising:
[0030] A first generating module is used to generate database information of the target industry based on the industry description and business requirements of the target industry; the database information includes: at least one data table, description information of each data table, structure information of each data table, business rules to be followed by each field in the target industry, and associations between data tables; the description information of each data table represents an overview of the content of the data of the target industry recorded in the data table;
[0031] A second generating module is used to generate, for each of the preset multiple question types, multiple initial questions of the question type and a solution corresponding to each initial question according to the question type and the database information;
[0032] A rewriting module is used to rewrite each initial question according to the initial question and its corresponding solution, as well as the role information of the questioner, to obtain a rewritten question corresponding to the role information;
[0033] Each piece of training data consists of the at least one data table, a target problem and its corresponding solution; the target problem is an original problem or a rewritten problem.
[0034] A third aspect of the present application provides a computer program product, comprising computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the training data construction method of the first aspect or any implementation of the first aspect.
[0035] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0036] The memory is used to store computer programs;
[0037] The processor is used to execute the computer program so that the electronic device can implement the training data construction method of the above-mentioned first aspect or any implementation manner of the first aspect.
[0038] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can use the training data construction method of the above-mentioned first aspect or any implementation of the first aspect.
[0039] By means of the above technical scheme, the training data construction method, device, equipment, storage medium and program product provided by the present application generate database information of the target industry based on the industry description and business needs of the target industry, and the database information includes: at least one data table, description information of each data table, structural information of each data table, business rules to be followed by each field in the target industry, and the association relationship between data tables; the description information of each data table represents the content overview of the data of the target industry recorded in the data table; corresponding to each of the preset multiple question types, according to the question type and the above database information, multiple initial questions of the question type and the corresponding solution of each initial question are generated; corresponding to each initial question, according to the initial question and its corresponding solution, and the role information of the questioner, the initial question is rewritten to obtain the rewritten question corresponding to the role information; each piece of training data is composed of the above at least one data table, a target question and its corresponding solution; the target question is an initial question or a rewritten question. Based on the present application, the purpose of automatically constructing the training data of the target industry is achieved, and the efficiency and accuracy of training data construction are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0041] Figure 1A flowchart for implementing the training data construction method provided in this application;
[0042] Figure 2 A flowchart for generating database information of a target industry based on the industry description and business requirements of the target industry provided for this application;
[0043] Figure 3 A flowchart for realizing the generation of association relationships between data tables, business rules to be followed by each field in a target industry, and at least one data table in sequence according to at least structural information of each data table provided in the present application;
[0044] Figure 4 A flowchart for obtaining at least one data table by filling data in each data table according to at least the structural information of each data table and the business rules that each field must follow in the target industry provided for this application;
[0045] Figure 5 A schematic diagram of a structure of a training data construction device provided in this application;
[0046] Figure 6 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0047] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0048] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0049] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0050] Business intelligence, also known as business wisdom or business intelligence, refers to the use of modern data warehouse technology, online analysis and processing technology, data mining and data presentation technology to analyze data to achieve business value. This application is proposed in order to efficiently and accurately construct training data for training BI models in BI scenarios.
[0051] like Figure 1 As shown, a flowchart of an implementation of the training data construction method provided in an embodiment of the present application may include:
[0052] Step S101: Generate database information of the target industry based on the industry description and business requirements of the target industry. The database information includes: at least one data table, description information of each data table, structure information of each data table, business rules to be followed by each field in the target industry, and associations between data tables; the description information of each data table represents the content overview of the data of the target industry recorded in the data table.
[0053] The target industry can be any industry, such as the financial industry, medical industry, power industry, etc.
[0054] Optionally, industry descriptions and business requirements may be set for each of the multiple industries in advance. When training data for any of the multiple industries needs to be generated, the industry description and business requirements corresponding to the industry are selected, and then the training data construction process of this application is triggered.
[0055] Taking the power industry as an example, the industry description can be: the data table of the power industry can record key data in the process of power production, transmission and distribution, covering power stations, transmission lines and power users. The business requirement can be: the data table will be used to analyze the operating efficiency and power supply reliability of the entire power system.
[0056] The description information of each data table is used to briefly explain which aspects of the target industry the data table records.
[0057] The structural information of each data table includes but is not limited to: the fields included in the data table, the data type of the fields, constraints, field description information, etc.
[0058] The business rules that each field must follow in the target industry may include, but are not limited to: the value rules of the field in the target industry. For example, in the power industry, the user category field supports the following values: residential, commercial, industrial, etc.; the power generation type field supports the following values: thermal power, hydropower, wind power, nuclear power, solar power, etc.
[0059] The association relationship between data tables may include but is not limited to: reference relationship, etc.
[0060] Step S102: corresponding to each of the preset multiple question types, according to the question type and the above database information, generate multiple initial questions of the question type and a solution corresponding to each initial question.
[0061] The multiple question types here refer to some question types that users often use in BI scenarios.
[0062] As an example, multiple question types may include but are not limited to the following eight question types: basic data retrieval, conditional screening, data sorting and restriction, aggregate query, window function application, advanced screening, deep data analysis, complex indicator calculation, etc., covering common query requirements in BI scenarios.
[0063] In order to further improve the accuracy of obtaining training data, for each of the preset multiple question types, multiple initial questions of the question type and the solution corresponding to each initial question can be generated based on the question type, the definition and examples of the question type, and the above-mentioned database information.
[0064] The definitions and examples for each question type are as follows:
[0065] 1. Basic data retrieval
[0066] Definition: Basic data retrieval is the process of obtaining raw data from a database or data source without involving any complex calculations or screening. It is usually used to display all or part of the data in a table.
[0067] Example: Retrieve the name, type, and installed capacity of all power plants in the power plant data table.
[0068] 2. Condition screening
[0069] Definition: According to specific conditions, select the records that meet the conditions from the data. Conditional filtering is usually implemented using the WHERE clause.
[0070] Example: Retrieve information on thermal power plants with installed capacity greater than 500 MW.
[0071] 3. Data sorting and restriction
[0072] Definition: Sort the result set in ascending or descending order according to a specific field, and the number of rows returned can be controlled by limiting the statement LIMIT or TOP.
[0073] Example: Get the top five power stations with the largest installed capacity.
[0074] 4. Aggregate Query
[0075] Definition: Aggregate query summarizes and calculates statistics on data by using functions (such as COUNT, SUM, AVG, MAX, MIN). It is usually used with the GROUP BY clause.
[0076] Example: Count the number of power plants and total installed capacity of each type of power generation by power generation type.
[0077] 5. Window function application
[0078] Definition: Window functions are used to calculate certain aggregate or cumulative values without reducing the number of rows. Window functions do not compress the result set like ordinary aggregate functions.
[0079] Example: For each power station, calculate its installed capacity rank among all power stations.
[0080] 6. Advanced Filtering
[0081] Definition: Advanced filtering usually combines multiple conditions or uses tools such as subqueries, complex logical conditions, and regular expressions to filter data.
[0082] Example: Get those power plants with an operation date before 2020 and an installed capacity greater than 500 MW.
[0083] 7. In-depth data analysis
[0084] Definition: Deep data analysis is a comprehensive and in-depth understanding of business data through multi-dimensional analysis, historical data comparison, trend analysis, etc. It usually requires complex query or data mining tools.
[0085] Example: Analyze the annual power generation trend for each power station and compare the power generation growth rate over the past three years.
[0086] 8. Calculation of complex indicators
[0087] Definition: Complex indicator calculation involves connections between multiple data sources or tables, as well as multi-step calculations and conditional judgments. It is often used in KPI, performance indicators or financial report generation.
[0088] Example: Calculate the power generation efficiency of each power station as a percentage of monthly power generation divided by installed capacity.
[0089] Assuming that M question types are preset, corresponding to each question type, assuming that based on the question type and the above database information, N initial questions of the question type and the corresponding solutions of each initial question are generated, then corresponding to the M question types, a total of M×N initial questions and the corresponding solutions of each question are generated, that is, M×N solutions. The N initial questions are all business intelligence questions.
[0090] Step S103: For each initial question, the initial question is rewritten according to the initial question and its corresponding solution, as well as the role information of the questioner, to obtain a rewritten question corresponding to the role information.
[0091] In BI scenarios, different roles of questioners may lead to different ways of asking questions. Therefore, after determining the initial question, the initial question is rewritten according to the role information of the questioner to obtain a question that matches the role information (recorded as a rewritten question).
[0092] For example, the role of the questioner may include but is not limited to: non-technical role, leadership role, etc.
[0093] By rewriting the initial questions based on the role information of the questioner, we ensure that questions corresponding to different roles are generated, thus achieving the generalization of the questions and building a large-scale generalized dataset.
[0094] Each piece of training data consists of at least one of the above data tables, a target problem and its corresponding solution; the target problem is an initial problem or a rewritten problem. That is to say, in the training data set constructed based on this application, each piece of training data includes at least one of the above data tables, a problem and a solution corresponding to the problem; the problem included in the training data can be the initial problem or a rewritten problem.
[0095] The training data construction method provided in the embodiment of the present application generates database information of the target industry based on the industry description and business requirements of the target industry. The database information includes: at least one data table, description information of each data table, structural information of each data table, business rules that each field must follow in the target industry, and the association relationship between data tables; the description information of each data table represents the content overview of the data of the target industry recorded in the data table; corresponding to each of the preset multiple question types, according to the question type and the above database information, multiple initial questions of the question type and the corresponding solution of each initial question are generated; corresponding to each initial question, according to the initial question and its corresponding solution, and the role information of the questioner, the initial question is rewritten to obtain the rewritten question corresponding to the role information; each training data is composed of the above at least one data table, a target question and its corresponding solution; the target question is an initial question or a rewritten question. Based on the present application, the user only needs to select the industry description and business requirements of the target industry to achieve the purpose of automatically constructing the training data of the target industry, which improves the efficiency and accuracy of training data construction.
[0096] Moreover, the data tables in the training data constructed based on this application are generated based on industry descriptions and business needs, rather than the actual production data of the enterprise. The disclosure of training data will not affect the security of enterprise data.
[0097] In addition, the training data construction method of the present application only requires the user to select industry descriptions and businesses to automatically construct training data, and no longer requires a large amount of manual participation. While simplifying and accelerating the training data construction process, it avoids the problem of inconsistent data constructed by different people and improves data quality.
[0098] In an optional embodiment, a flowchart for realizing the generation of database information of a target industry based on the industry description and business requirements of the target industry is as follows: Figure 2 As shown, it may include:
[0099] Step S201: Generate at least one table description information according to the industry description and business requirements of the target industry; each table description information represents the content overview of the data of the target industry recorded in a data table.
[0100] First, one or more table description information is generated according to the industry description and business requirements of the target industry. Each table description information corresponds to a data table, which is used to provide a general description of the content to be recorded in the data table.
[0101] For example, in the power industry, it includes power plant data tables and power transmission data tables, where:
[0102] The table description information corresponding to the power station data table may be: recording information of different types of power stations.
[0103] The table description information corresponding to the power transmission data table may be: recording the power transmission line information from the power station to the substation or distribution station.
[0104] Step S202: generating structure information of the data table represented by each table description information according to each table description information.
[0105] According to the description information of each table, define the field name, data type and constraint conditions in the data table represented by each table description information to ensure the integrity and rationality of the table structure.
[0106] As an example, in the power industry, the structure information of a power plant data table may include:
[0107] Field 1: Plant name (Plant_Name);
[0108] Data type: VARCHAR(100);
[0109] Constraints: NOT NULL, UNIQUE;
[0110] Description: The name of the power station, up to 100 characters long.
[0111] Field 2: Power generation type (Plant_Type);
[0112] Data type: VARCHAR(50);
[0113] Constraints: NOT NULL;
[0114] Description: The type of power station (such as thermal power, hydropower, wind power, nuclear power, etc.). The following values are supported: 'thermal power', 'hydropower', 'wind power', 'nuclear power', 'solar power'.
[0115] Field 3: Installed capacity (Installed_Capacity_MW);
[0116] ……etc.
[0117] Step S203: Generate, in sequence at least according to the structural information of each data table, the association relationship between the data tables, the business rules that each field needs to follow in the target industry, and at least one data table.
[0118] The association relationship between the data tables, the business rules that each field needs to follow in the target industry, and at least one data table can be generated in sequence only based on the structural information of each data table.
[0119] Alternatively, the association relationship between data tables, the business rules that each field needs to follow in the target industry, and at least one data table may be generated in sequence according to the description information of each table and the structural information of each data table.
[0120] In an optional embodiment, the above-mentioned association relationship between data tables, business rules to be followed by each field in the target industry, and an implementation flowchart of at least one data table are sequentially generated based on at least the structural information of each data table as shown in FIG. Figure 3 As shown, it may include:
[0121] Step S301: establishing associations between data tables at least according to structural information of each data table.
[0122] The association relationship between data tables can be established only based on the structural information of each data table.
[0123] Alternatively, an association relationship between data tables may be established based on the description information of each table and the structural information of each data table.
[0124] The association relationship between data tables can specifically be a primary-foreign key relationship between data tables. As an example, in the power industry, the primary-foreign key relationship between data tables established may include: Plant_name in the power transmission data table is associated with Plant_name in the power station data table, the primary key of the power transmission data table is Plant_name, the primary key of the power station data table is Generation_name, the foreign key of the power station data table is Plant_name, and the Plant_name in the power transmission data table is referenced.
[0125] Step S302: Generate business rules that each field must follow in the target industry based at least on the structural information of each data table and the association relationship between the data tables.
[0126] The business rules that each field must follow in the target industry can be generated based solely on the structural information of each data table and the relationship between the data tables.
[0127] Alternatively, the business rules that each field must follow in the target industry can be generated based on the description information of each table, the structural information of each data table, and the relationship between data tables.
[0128] Step S303: filling data in each data table at least according to the structural information of each data table and the business rules that each field needs to follow in the target industry to obtain at least one data table.
[0129] Data can be filled in each data table only according to the structural information of each data table and the business rules that each field needs to follow in the target industry to obtain at least one data table.
[0130] Alternatively, data may be filled in each data table according to the description information of each table, the structural information of each data table, and the business rules that each field needs to follow in the target industry to obtain at least one data table.
[0131] Alternatively, data may be filled in each data table based on the structural information of each data table, the associations between the data tables, and the business rules that each field must follow in the target industry to obtain at least one data table.
[0132] Alternatively, data may be filled in each data table according to the description information of each table, the structural information of each data table, the association relationship between the data tables, and the business rules that each field must follow in the target industry to obtain at least one data table.
[0133] In an optional embodiment, the above-mentioned data is filled in each data table according to at least the structural information of each data table and the business rules that each field must follow in the target industry to obtain an implementation flow chart of at least one data table as shown in FIG. Figure 4 As shown, it may include:
[0134] Step S401: filling data in each data table at least according to the structural information of each data table and the business rules that each field needs to follow in the target industry to obtain at least one initial data table.
[0135] Data can be filled in each data table based only on the structural information of each data table and the business rules that each field needs to follow in the target industry to obtain at least one initial data table.
[0136] Alternatively, data may be filled in each data table according to the description information of each table, the structural information of each data table, and the business rules that each field needs to follow in the target industry to obtain at least one initial data table.
[0137] Alternatively, data may be filled in each data table based on the structural information of each data table, the associations between the data tables, and the business rules that each field must follow in the target industry to obtain at least one initial data table.
[0138] Alternatively, data may be filled in each data table according to the description information of each table, the structural information of each data table, the association between data tables, and the business rules that each field must follow in the target industry to obtain at least one initial data table.
[0139] Step S402: Process and improve each initial data table according to the business rules that each field needs to follow in the target industry to obtain at least one data table as part of the database information.
[0140] That is to say, after the initial data table is generated, it is further processed and improved according to the business rules that each field must follow in the target industry, so that the industry-specific data characteristics can be reflected in the data generation process to ensure the authenticity and validity of the data.
[0141] In an optional embodiment, when the database information of the target industry is generated based on the industry description and business requirements of the target industry, a large model can be used to perform multi-step processing based on the industry description and business requirements of the target industry to sequentially generate description information of each data table, structural information in each data table, the relationship between data tables, business rules that each field must follow in the target industry, and at least one of the above data tables.
[0142] Among them, in each processing step, the large model generates the corresponding processing result of the step according to the prompt word (prompt) corresponding to the step.
[0143] Optionally, during each processing step, the information required for the processing step may be added to the prompt word template corresponding to the step to obtain the prompt word corresponding to the step.
[0144] As an example, one implementation of generating at least one table description information according to the industry description and business requirements of the target industry may be:
[0145] The industry description and business requirements of the target industry are added to the first prompt word template to obtain the first prompt word, and the first prompt word is input into the large model to obtain at least one table description information generated by the large model based on the first prompt word. As an example, the first prompt word can be: Please generate a content overview of multiple data tables in the power industry. The multiple data tables can record key data in the process of power production, transmission and distribution, covering power stations, transmission lines and power user information, etc. The data tables will be used to analyze the operating efficiency and power supply reliability of the entire power system. The first prompt word instructs the large model to generate one or more table description information based on the industry description and business requirements of the target industry.
[0146] As an example, one implementation method of generating the structure information of the data table represented by each table description information according to each table description information may be:
[0147] Each table description information is added to the second prompt word template to obtain a second prompt word, and the second prompt word is input into the large model to obtain the structure information of the data table represented by each table description information generated by the large model based on the second prompt word. The second prompt word instructs the large model to expand each table description information into a specific table structure.
[0148] As an example, one implementation of establishing the association relationship between the data tables at least according to the structural information of each data table may be:
[0149] The structural information of each data table is added to the third prompt word template to obtain the third prompt word, and the third prompt word is input into the large model to obtain the association relationship between the data tables established by the large model based on the third prompt word. The third prompt word instructs the large model to establish the association relationship between the data tables according to the structural information of each data table.
[0150] Alternatively, each table description information and each data table structure information are added to the fourth prompt word template to obtain a fourth prompt word, and the fourth prompt word is input into the large model to obtain the association relationship between the data tables established by the large model based on the fourth prompt word. The fourth prompt word instructs the large model to establish the association relationship between the data tables based on each table description information and each data table structure information.
[0151] As an example, one implementation method of generating the business rules that each field needs to follow in the target industry based on at least the structural information of each data table and the association relationship between the data tables may be:
[0152] The structural information of each data table and the relationship between the data tables are added to the fifth prompt word template to obtain the fifth prompt word, and the fifth prompt word is input into the big model to obtain the business rules that the big model generates based on the fifth prompt word for each field in the target industry. The fifth prompt word instructs the big model to give the business rules that the table fields in the target industry must follow based on the structural information of each data table and the relationship between the data tables.
[0153] Alternatively, each table description information, each data table structure information, and the relationship between data tables are added to the sixth prompt word template to obtain the sixth prompt word, and the sixth prompt word is input into the large model to obtain the business rules that each field generated by the large model based on the sixth prompt word needs to follow in the target industry. The sixth prompt word instructs the large model to give the business rules that the table fields in the target industry need to follow based on each table description information, each data table structure information, and the relationship between data tables.
[0154] As an example, one implementation of filling data in each data table based on at least the structural information of each data table and the business rules that each field must follow in the target industry to obtain at least one initial data table may be:
[0155] The structural information of each data table and the business rules that each field should follow in the target industry are added to the seventh prompt word template to obtain the seventh prompt word, and the seventh prompt word is input into the large model to obtain at least one initial data table generated by the large model based on the seventh prompt word. The seventh prompt word instructs the large model to generate one or more initial data tables according to the structural information of each data table and the business rules that each field should follow in the target industry.
[0156] Alternatively, the structural information of each data table, the association between the data tables, and the business rules that each field must follow in the target industry can be added to the eighth prompt word template to obtain the eighth prompt word, and the eighth prompt word is input into the big model to obtain at least one initial data table generated by the big model based on the eighth prompt word. The eighth prompt word instructs the big model to generate one or more initial data tables according to the structural information of each data table, the association between the data tables, and the business rules that each field must follow in the target industry.
[0157] Alternatively, the description information of each table, the structural information of each data table, and the business rules that each field must follow in the target industry can be added to the ninth prompt word template to obtain the ninth prompt word, and the ninth prompt word is input into the big model to obtain at least one initial data table generated by the big model based on the ninth prompt word. The ninth prompt word instructs the big model to generate one or more initial data tables according to the description information of each table, the structural information of each data table, and the business rules that each field must follow in the target industry.
[0158] Alternatively, the description information of each table, the structural information of each data table, the association between the data tables, and the business rules that each field must follow in the target industry can be added to the tenth prompt word template to obtain the tenth prompt word, and the tenth prompt word is input into the large model to obtain at least one initial data table generated by the large model based on the tenth prompt word. The tenth prompt word instructs the large model to generate one or more initial data tables according to the description information of each table, the structural information of each data table, the association between the data tables, and the business rules that each field must follow in the target industry.
[0159] As an example, one implementation method of processing and improving each initial data table according to the business rules that each field needs to follow in the target industry to obtain at least one data table may be:
[0160] The business rules that each field needs to follow in the target industry and the at least one initial data table are added to the eleventh prompt word template to obtain the eleventh prompt word, and the eleventh prompt word is input into the macro model to obtain at least one improved data table generated by the macro model based on the eleventh prompt word. The eleventh prompt word instructs the macro model to process and improve the at least one initial data table according to the business rules that each field needs to follow in the target industry to ensure the authenticity and validity of the data in the data table.
[0161] Optionally, the big model is not a model for solving BI problems, but can be a general big model, or a big model that is a fine-tuned general big model based on the aforementioned task of generating database information.
[0162] In an optional embodiment, each solution may be proofread before the original problem is rewritten to ensure the accuracy and / or efficiency of each solution.
[0163] Optionally, for each solution, the solution may be output, or the solution and the answer obtained by calling the solution may be output, so that the user can manually check and verify the solution to obtain a correct and / or efficient solution.
[0164] Accordingly, one implementation method of rewriting the initial problem may be:
[0165] Corresponding to each initial question, the initial question is rewritten according to the initial question and its corresponding proofread solution, as well as the role information of the questioner, to obtain a rewritten question corresponding to the role information.
[0166] Optionally, for each initial question, the initial question, the solution corresponding to the initial question, and the role information of the questioner can be added to the twelfth prompt word template to obtain the twelfth prompt word, and the twelfth prompt word is input into the large model to obtain a rewritten question obtained by rewriting the initial question based on the twelfth prompt word. The twelfth prompt word instructs the large model to rewrite the initial question into a question adapted to the role information according to the role information and the solution.
[0167] The quality of the solutions was further improved by proofreading them, which in turn improved the quality of the rephrased questions.
[0168] In an optional embodiment, the role information may include but is not limited to the following information: role definition and question requirements.
[0169] Optionally, the role definition may include but is not limited to: role description.
[0170] Question requirements may include, but are not limited to: data requirements and expected output information.
[0171] As an example, for a non-technical person role, the role information may include:
[0172] Role Description:
[0173] Non-technical personnel include business department employees, data analysts, product managers, etc. They focus on business indicators and data analysis but may lack a deep technical background.
[0174] Data requirements:
[0175] Obtain business insights: hope to support decision-making process through data analysis;
[0176] Autonomous analysis: hope to be able to perform simple data query and visualization autonomously;
[0177] Report Generation: Business reports need to be generated and reviewed regularly.
[0178] Expected output information:
[0179] I wanted to reframe the questioning through a non-technical person's perspective.
[0180] As an example, for a leadership role, the role information may include:
[0181] Role Description:
[0182] Leadership roles include senior company executives, such as CEO, CFO, etc., who need a comprehensive understanding of the business situation to support strategic decision-making.
[0183] Data requirements:
[0184] High-level overview: You need to have a comprehensive understanding of the company's overall business;
[0185] Key indicator monitoring: focus on key performance indicators and financial data;
[0186] Strategic Analysis: In-depth analysis is required to support long-term decision making.
[0187] Expected output information:
[0188] I hope to reframe the questioning through the lens of leadership.
[0189] In another optional embodiment, when the database information of the target industry is generated based on the industry description and business requirements of the target industry, a large model can be used to perform one-step processing based on the industry description and business requirements of the target industry to generate the description information of each data table, the structural information in each data table, the relationship between the data tables, the business rules that each field must follow in the target industry, and at least one of the above data tables at one time.
[0190] Optionally, the big model may be a general big model, or a big model obtained by fine-tuning the general big model based on a task of generating database information once.
[0191] In an optional embodiment, for each of the above-mentioned corresponding preset multiple question types, according to the question type and the above-mentioned database information, a plurality of initial questions of the question type and a solution corresponding to each initial question may be generated in one implementation manner:
[0192] For each question type, the definition and example of the question type and the above database information are added to the thirteenth prompt word template to obtain the thirteenth prompt word, and the thirteenth prompt word is input into the large model to obtain multiple initial questions corresponding to the question type generated by the large model based on the thirteenth prompt word, and the solution corresponding to each initial question. The thirteenth prompt word instructs the large model to generate multiple initial questions that conform to the question type according to the definition and example of the question type and the above database information, and the solution corresponding to each initial question.
[0193] Alternatively, for each question type, the question type and the above database information are added to the fourteenth prompt word template to obtain the fourteenth prompt word, and the fourteenth prompt word is input into the large model to obtain multiple initial questions corresponding to the question type generated by the large model based on the fourteenth prompt word, and the solution corresponding to each initial question. The fourteenth prompt word instructs the large model to generate multiple initial questions that meet the question type according to the question type and the above database information, and the solution corresponding to each initial question.
[0194] In an optional embodiment, the solution corresponding to each problem may be a SQL statement.
[0195] In the embodiment of the present application, the large model can be a large language model, which can automatically generate high-quality data table structures, business rules and SQL statements by utilizing the powerful natural language processing capabilities of the large language model, reduce human involvement and improve efficiency. In particular, for different industry scenarios, it can quickly adapt to and generate training data that meets industry-specific needs.
[0196] Corresponding to the method embodiment, the present application also provides a training data construction device, such as Figure 5 As shown, a schematic diagram of a structure of a training data construction device provided in an embodiment of the present application may include:
[0197] A first generating module 501, a second generating module 502 and a rewriting module 503;
[0198] The first generation module 501 is used to generate database information of the target industry based on the industry description and business requirements of the target industry; the database information includes: at least one data table, description information of each data table, structure information of each data table, business rules to be followed by each field in the target industry, and associations between data tables; the description information of each data table represents the content overview of the data of the target industry recorded in the data table;
[0199] The second generating module 502 is used to generate, corresponding to each of the preset multiple question types, multiple initial questions of the question type and the database information, and a solution corresponding to each initial question;
[0200] The rewriting module 503 is used to correspond to each initial question, and rewrite the initial question according to the initial question and its corresponding solution, as well as the role information of the questioner, to obtain a rewritten question corresponding to the role information;
[0201] Each piece of training data consists of the at least one data table, a target problem and its corresponding solution; the target problem is an original problem or a rewritten problem.
[0202] The training data construction device provided in the embodiment of the present application generates database information of the target industry based on the industry description and business requirements of the target industry. The database information includes: at least one data table, description information of each data table, structural information of each data table, business rules that each field must follow in the target industry, and the association relationship between data tables; the description information of each data table represents the content overview of the data of the target industry recorded in the data table; corresponding to each of the preset multiple question types, according to the question type and the above database information, multiple initial questions of the question type and the corresponding solution of each initial question are generated; corresponding to each initial question, according to the initial question and its corresponding solution, and the role information of the questioner, the initial question is rewritten to obtain the rewritten question corresponding to the role information; each training data is composed of the above at least one data table, a target question and its corresponding solution; the target question is an initial question or a rewritten question. Based on the present application, the user only needs to select the industry description and business requirements of the target industry to achieve the purpose of automatically constructing the training data of the target industry, thereby improving the efficiency and accuracy of training data construction.
[0203] In an optional embodiment, when the first generating module 501 generates the database information of the target industry based on the industry description and business requirements of the target industry, it is used to:
[0204] At least one table description information is generated according to the industry description and business requirements of the target industry; each table description information represents a content overview of the data of the target industry recorded in a data table;
[0205] According to each table description information, generate the structure information of the data table represented by each table description information;
[0206] At least according to the structural information of each data table, the association relationship between the data tables, the business rules that each field needs to follow in the target industry, and the at least one data table are generated in sequence.
[0207] In an optional embodiment, the first generating module 501 generates, at least according to the structural information of each data table, the association relationship between the data tables, the business rules to be followed by each field in the target industry, and the at least one data table in sequence, and is used to:
[0208] At least establishing an association relationship between data tables based on structural information of each data table;
[0209] At least based on the structural information of each data table and the association relationship between the data tables, generate the business rules that each field should follow in the target industry;
[0210] At least according to the structural information of each data table and the business rules that each field needs to follow in the target industry, data is filled in each data table to obtain at least one data table.
[0211] In an optional embodiment, the first generating module 501 fills data in each data table according to at least the structural information of each data table and the business rules that each field should follow in the target industry, and when at least one data table is obtained, is used to:
[0212] Filling data in each data table at least according to the structural information of each data table and the business rules that each field should follow in the target industry to obtain at least one initial data table;
[0213] Each initial data table is processed and improved according to the business rules that each field needs to follow in the target industry to obtain at least one data table.
[0214] In an optional embodiment, when the first generating module 501 generates the database information of the target industry based on the industry description and business requirements of the target industry, it is used to:
[0215] Performing multi-step processing based on the industry description and business requirements of the target industry through the big model, sequentially generating description information of each data table, structural information in each data table, associations between data tables, business rules that each field must follow in the target industry, and the at least one data table;
[0216] In each processing step, the large model generates a processing result corresponding to the step according to the prompt word corresponding to the step.
[0217] In an optional embodiment, before rewriting the initial question, the rewriting module 503 is further used to:
[0218] Proofread each solution to ensure accuracy and / or efficiency of each solution;
[0219] When the rewriting module 503 rewrites the initial question, it is used to:
[0220] Corresponding to each initial question, the initial question is rewritten according to the initial question and its corresponding proofread solution, as well as the role information of the questioner, to obtain a rewritten question corresponding to the role information.
[0221] In an optional embodiment, the role information includes: role definition and question requirements.
[0222] The present application also provides an electronic device in an embodiment. Figure 6As shown, it shows a structural schematic diagram of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application can be a terminal device (such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, etc.), or a server (can be a single server, can be a server cluster, or can be a cloud server, etc.). Figure 6 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0223] like Figure 6 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0224] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0225] An embodiment of the present application also provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any one of the training data construction methods provided in the embodiments of the present application.
[0226] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any training data construction method provided in the embodiment of the present application.
[0227] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0228] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0229] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product. Professionals and technicians may use different methods to implement the described functions for each specific solution, but such implementation should not be considered beyond the scope of this application.
[0230] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0231] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0232] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A training data construction method, characterized in that: include: Generate database information of the target industry based on the industry description and business requirements of the target industry; The database information includes: at least one data table, description information of each data table, structure information of each data table, business rules to be followed by each field in the target industry, and associations between data tables; the description information of each data table represents an overview of the content of the data of the target industry recorded in the data table; Corresponding to each of the preset multiple question types, generating multiple initial questions of the question type and a solution corresponding to each initial question according to the question type and the database information; For each initial question, according to the initial question and its corresponding solution, and the role information of the questioner, the initial question is rewritten to obtain a rewritten question corresponding to the role information; Each piece of training data consists of the at least one data table, a target problem and its corresponding solution; the target problem is an original problem or a rewritten problem.
2. The method according to claim 1, characterized in that The generating of the database information of the target industry based on the industry description and business requirements of the target industry includes: At least one table description information is generated according to the industry description and business requirements of the target industry; each table description information represents a content overview of the data of the target industry recorded in a data table; According to each table description information, generate the structure information of the data table represented by each table description information; At least according to the structural information of each data table, the association relationship between the data tables, the business rules that each field needs to follow in the target industry, and the at least one data table are generated in sequence.
3. The method according to claim 2, characterized in that The step of sequentially generating the association relationship between the data tables, the business rules to be followed by each field in the target industry, and the at least one data table at least according to the structural information of each data table includes: At least establishing an association relationship between data tables based on structural information of each data table; At least based on the structural information of each data table and the association relationship between the data tables, generate the business rules that each field should follow in the target industry; At least according to the structural information of each data table and the business rules that each field needs to follow in the target industry, data is filled in each data table to obtain at least one data table.
4. The method according to claim 3, characterized in that The method of filling data in each data table at least according to the structural information of each data table and the business rules that each field should follow in the target industry to obtain at least one data table includes: Filling data in each data table at least according to the structural information of each data table and the business rules that each field should follow in the target industry to obtain at least one initial data table; Each initial data table is processed and improved according to the business rules that each field needs to follow in the target industry to obtain at least one data table.
5. The method according to any one of claims 1 to 3, characterized in that: The generating of the database information of the target industry based on the industry description and business requirements of the target industry includes: Performing multi-step processing based on the industry description and business requirements of the target industry through the big model, sequentially generating description information of each data table, structural information in each data table, associations between data tables, business rules that each field must follow in the target industry, and the at least one data table; In each processing step, the large model generates a processing result corresponding to the step according to the prompt word corresponding to the step.
6. The method according to claim 1, characterized in that Before rewriting the original question, also include: Proofread each solution to ensure accuracy and / or efficiency of each solution; The process of rewriting the initial question includes: Corresponding to each initial question, the initial question is rewritten according to the initial question and its corresponding proofread solution, as well as the role information of the questioner, to obtain a rewritten question corresponding to the role information.
7. The method according to claim 1, characterized in that The role information includes: role definition and question requirements.
8. A training data construction device, characterized in that: include: A first generating module, used to generate database information of a target industry based on an industry description and business requirements of the target industry; The database information includes: at least one data table, description information of each data table, structure information of each data table, business rules to be followed by each field in the target industry, and associations between data tables; the description information of each data table represents an overview of the content of the data of the target industry recorded in the data table; A second generating module is used to generate, for each of the preset multiple question types, multiple initial questions of the question type and a solution corresponding to each initial question according to the question type and the database information; A rewriting module is used to rewrite each initial question according to the initial question and its corresponding solution, as well as the role information of the questioner, to obtain a rewritten question corresponding to the role information; Each piece of training data consists of the at least one data table, a target problem and its corresponding solution; the target problem is an original problem or a rewritten problem.
9. A computer program product, characterized in that It includes computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the training data construction method as described in any one of claims 1 to 7.
10. An electronic device, characterized in that: The electronic device comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the training data construction method as described in any one of claims 1 to 7.
11. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the training data construction method as described in any one of claims 1 to 7.