Device and method for constructing training data, storage medium, and program product
By acquiring and evaluating business data and prompt information, a high-quality training data set is constructed, which solves the problem of poor public data quality in the existing technology and improves the performance and stability of the machine learning model.
Patent Information
- Application Number
- CN202410780676.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-09-24
AI Technical Summary
In the existing technology, the quality of public data captured through web crawlers is poor, resulting in poor quality of constructed training data, which affects the accuracy, generalization ability and stability of the machine learning model.
By obtaining the original business data and prompt information, construct the input data set and target output set, evaluate the data richness and complexity, filter and cluster based on the evaluation results, and build a high-quality training data set to train the model.
It improves the quality of training data, improves the generalization ability and stability of the model, and ensures the reduction of model learning bias.
Smart Images

Figure CN118690196A
Abstract
Description
Technical Field
[0001] The present disclosure relates to a training data construction device, method, storage medium and program product. Background Art
[0002] With the rapid development of artificial intelligence technology, machine learning models are playing an increasingly important role in all walks of life, and the performance of machine learning models depends largely on the quality of the constructed training data.
[0003] In the prior art, the process of constructing training data includes data collection, cleaning, labeling, etc., wherein data collection is generally automatically captured by web crawlers.
[0004] However, since the collected data is generally public data with varying quality, the training data constructed based on the collected data is of poor quality. When using this training data for model training, it is easy to cause model learning bias, thereby affecting the accuracy, generalization ability and stability of the model. Summary of the invention
[0005] The present disclosure provides a training data construction device, method, storage medium and program product.
[0006] According to one aspect of the present disclosure, a training data construction device is provided, including: a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following process:
[0007] Obtain original business data and first prompt information;
[0008] Acquire an input data set according to the original business data and the first prompt information;
[0009] Obtaining a target output set corresponding to the input data set;
[0010] Acquire a first evaluation result according to the input data set and the target output set;
[0011] Acquire a training data set according to the first evaluation result, the input data set, and the target output set;
[0012] The training data set is used to train the model to be trained, and the first prompt information is used to guide the model to be trained to generate corresponding output.
[0013] The training data construction device according to at least one embodiment of the present disclosure further includes:
[0014] The training data set is managed according to preset labels.
[0015] According to the training data construction device of at least one embodiment of the present disclosure, the first prompt information is preset information or information expanded based on the preset information;
[0016] The expansion based on the preset information includes semantic expansion based on the preset information.
[0017] According to the training data construction device of at least one embodiment of the present disclosure, the step of obtaining a first evaluation result according to the input data set and the target output set includes:
[0018] Obtaining data richness and data complexity of the input data set;
[0019] Obtaining output quality according to the target output set and an initial output set corresponding to the input data set;
[0020] The first evaluation result is obtained according to the data richness, the data complexity and the output quality.
[0021] According to the training data construction device of at least one embodiment of the present disclosure, the step of acquiring the training data set according to the first evaluation result, the input data set, and the target output set includes:
[0022] Determining whether the first evaluation result is greater than a preset evaluation threshold;
[0023] If the first evaluation result is greater than a preset evaluation threshold, a training data set is constructed using the input data set and the target output set.
[0024] According to the training data construction device of at least one embodiment of the present disclosure, if the first evaluation result is not greater than a preset evaluation threshold, the acquiring of the training data set according to the first evaluation result, the input data set and the target output set further includes:
[0025] Performing clustering processing on the data in the input data set to obtain at least one cluster;
[0026] Obtaining an instruction following score of the data in the at least one cluster;
[0027] Filtering the data in the at least one cluster according to the instruction following score of the data in the at least one cluster to obtain filtered data;
[0028] Obtaining a second evaluation result corresponding to the screening data;
[0029] After the current first evaluation result is updated to the second evaluation result, the step of determining whether the first evaluation result is greater than a preset evaluation threshold is performed.
[0030] According to another aspect of the present disclosure, a method for constructing training data is provided, comprising:
[0031] Obtain original business data and first prompt information;
[0032] Acquire an input data set according to the original business data and the first prompt information;
[0033] Obtaining a target output set corresponding to the input data set;
[0034] Acquire a first evaluation result according to the input data set and the target output set;
[0035] Acquire a training data set according to the first evaluation result, the input data set, and the target output set;
[0036] The training data set is used to train the model to be trained, and the first prompt information is used to guide the model to be trained to generate corresponding output.
[0037] According to another aspect of the present disclosure, a readable storage medium is provided, wherein a computer program is stored in the readable storage medium, and when the computer program is executed by a processor, it is used to implement the method for constructing training data in any embodiment of the present disclosure.
[0038] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method for constructing training data in any embodiment of the present disclosure is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0040] Figure 1 It is a schematic diagram of an application scenario of the training data construction method according to an embodiment of the present disclosure.
[0041] Figure 2 It is an interactive schematic flow chart of a training data construction method according to an embodiment of the present disclosure.
[0042] Figure 3 It is a schematic diagram of the structure of the training data construction device provided in Example 1 of the present disclosure.
[0043] Figure 4 This is the process of the method for constructing training data provided in Example 2 of the present disclosure. Figure 1 .
[0044] Figure 5 yes Figure 4 Flowchart of the method for obtaining input data set in the method for constructing training data shown in FIG.
[0045] Figure 6 yes Figure 4 Flowchart of a method for obtaining a target output set in a method for constructing training data shown in FIG.
[0046] Figure 7 yes Figure 4 A flowchart of a method for obtaining a first evaluation result in a method for constructing training data is shown.
[0047] Figure 8 yes Figure 7 A flowchart of a method for obtaining data complexity in a method for obtaining a first evaluation result is shown.
[0048] Fig. 9 yes Figure 7 A flowchart of a method for obtaining data richness in a method for obtaining a first evaluation result is shown.
[0049] Fig.10 yes Figure 4 The process of obtaining the training data set method in the training data construction method shown in Figure 1 .
[0050] Fig.11 yes Figure 4 The process of obtaining the training data set method in the training data construction method shown in Figure 2 .
[0051] Fig.12 This is the process of the method for constructing training data provided in Example 2 of the present disclosure. Figure 2 .
[0052] Fig.13 This is the process of the method for constructing training data provided in Example 2 of the present disclosure. Figure 3 . DETAILED DESCRIPTION
[0053] The present disclosure is further described in detail below in conjunction with the accompanying drawings and examples. It is understood that the specific examples described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.
[0054] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0055] Since machine learning models need to learn the potential relationship between input and output based on training data and use the learned potential relationship to predict or classify new data, the performance of machine learning models depends largely on the quality of the constructed training data. Since the process of constructing training data requires crawling public data through web crawlers, and the quality of public data varies, the quality of training data constructed based on the collected data is poor. When using this training data for model training, it is easy to cause model learning deviation, which in turn affects the accuracy, generalization ability and stability of the model.
[0056] Figure 1 The application scenario of the method for constructing training data of an embodiment of the present disclosure is shown. In this application scenario, a business system 10 and a construction device 20 may be included, and the business system 10 communicates with the construction device 20 through a network. When the construction device 20 constructs the training data, the original business data is obtained through the business system 10 to implement the construction process of the training data.
[0057] Figure 2 An interactive schematic flow chart of a method for constructing training data according to an embodiment of the present disclosure is shown.
[0058] refer to Figure 2 The method for constructing training data in this embodiment includes:
[0059] Step S210: The construction device obtains original business data from the business system according to a preset business ratio.
[0060] In some embodiments of the present disclosure, the preset business proportion in step S210 can be set in advance according to the complexity, function, application scenario, etc. of the business; such as obtaining data of a first proportion from data source A of the business system, obtaining data of a second proportion from data source B of the business system, etc.
[0061] Step S220: The construction device performs a first process on the original business data to obtain preliminary data.
[0062] Step S230: The construction device expands the preset initial prompt information to obtain the first prompt information.
[0063] In some embodiments of the present disclosure, step S230 can evolve each prompt information in the initial prompt information into multiple similar prompt information, thereby improving the diversity of the prompt information; it helps to improve the generalization ability and stability of the model during model training. The initial prompt information in step S230 should include a task description, which is used to clearly indicate the specific tasks that the model needs to perform; in addition to the task description, the initial prompt information may also include one or more of the task background (such as specific business application scenarios, etc.), role description (such as defining role A as B, etc.), output requirements (such as what format needs to be output, etc.) and precautions (such as certain data cannot be empty, etc.). The expansion process of step S230 can also be executed in advance, and the first prompt information can be directly obtained, which is convenient to use and shortens the construction time. The training data set is used to train the model to be trained, and the first prompt information is used to guide the model to be trained to generate the corresponding output.
[0064] Step S240: The construction device obtains an initial input set according to a preset prompt ratio in combination with the previous data and the first prompt information.
[0065] In some embodiments of the present disclosure, the process of obtaining the initial input set through step S240 can be: for any prompt information in the first prompt information, obtain the prompt ratio corresponding to the prompt information; obtain the first data from the previous data according to the prompt ratio corresponding to the prompt information; merge the first data with the prompt information to obtain the corresponding input data; the initial input set is composed of the input data corresponding to the information in the first prompt information.
[0066] In some embodiments of the present disclosure, adjusting the ratio according to the preset business ratio and the preset prompt ratio can further improve the quality of the training data, thereby improving the generalization ability and stability of the model.
[0067] Step S250: The construction device performs a second process on the initial input set to obtain an input data set.
[0068] In some embodiments of the present disclosure, the type of the first processing or the second processing may include: data cleaning and / or data conversion; in particular, in the second processing, specific processing may be performed in combination with prompt information. Specifically, the first processing may include converting the data in the initial input set into a standard format, adding role information to the data, removing data with no information or less information, converting the data into a specific length, etc.; the second processing may include removing abnormal data, aligning the data format, removing non-Chinese data, etc. The quality of the training data can be further improved through the first processing and / or the second processing.
[0069] Step S260: The construction device inputs the data in the input data set into the preset first model respectively to obtain an initial output set.
[0070] Step S270: The construction device updates the initial output set to obtain a target output set.
[0071] In some embodiments of the present disclosure, step S270 may update the initial output set according to manual instructions.
[0072] Step S280: The construction device obtains the data richness and data complexity of the input data set.
[0073] Step S290: The construction device obtains output quality according to the target output set and the initial output set.
[0074] Step S291, constructing a device to obtain a first evaluation result based on data richness, data complexity and output quality.
[0075] Step S292: The construction device determines whether the first evaluation result is greater than a preset evaluation threshold.
[0076] In some embodiments of the present disclosure, if it is determined through step S292 that the first evaluation result is greater than a preset evaluation threshold, step S293 is executed; otherwise, step S294 is executed.
[0077] Step S293: The construction device constructs a training data set using the input data set and the target output set.
[0078] In some embodiments of the present disclosure, the data of the training data set can be managed according to preset tags, which may include one or more of: date, scene, data version, data batch, data volume, prompt standard, prompt version, data processing method and data address.
[0079] Step S294: The construction device performs clustering processing on the data in the input data set to obtain at least one cluster.
[0080] Step S295: The construction device obtains the instruction following score of the data in at least one cluster.
[0081] In some embodiments of the present disclosure, the instruction following score in step S295 may also be referred to as an instruction following difficulty (IFD) score, and the instruction following score may be obtained by evaluating data flow difficulty or the like.
[0082] Step S296: The construction device filters the data in at least one cluster according to the instruction follow-up score of the data in at least one cluster to obtain filtered data.
[0083] In some embodiments of the present disclosure, when the input data set is evaluated low, the data is filtered by the instruction following score to improve the data quality; the instruction following score can be used to filter data in a targeted manner, thereby realizing model training with fewer resources and saving training resources.
[0084] Step S297: The construction device obtains a second evaluation result corresponding to the screening data.
[0085] In some embodiments of the present disclosure, the method of obtaining the second evaluation result through step S297 is similar to the method of obtaining the first evaluation result.
[0086] Step S298: The construction device updates the current first evaluation result to the second evaluation result.
[0087] In some embodiments of the present disclosure, after the first evaluation result is updated in step S298, step S293 is executed again.
[0088] Step S299: The construction device uses the training data set to train the model to be trained to obtain the target model.
[0089] In some embodiments of the present disclosure, the model to be trained and the first model may be the same model, in which case step S299 is specifically a process of fine-tuning the model; the model to be trained and the first model may also be different models, such as the first model being a publicly available Qianwen, GPT or other model, and the model to be trained being a neural network model that needs to be trained, etc.
[0090] Combine the following Figure 3 The training data construction device disclosed in the present invention is described in detail.
[0091] Embodiment 1:
[0092] Figure 3 A schematic diagram of a device for constructing training data according to an embodiment of the present disclosure.
[0093] refer to Figure 3 The training data construction device 300 of this embodiment includes: a processor 310 and a memory 320, the memory 320 stores a computer program, and when the computer program is executed by the processor 310, the processor 310 performs the following process:
[0094] Obtain original business data and first prompt information;
[0095] Acquire an input data set according to the original business data and the first prompt information;
[0096] Get the target output set corresponding to the input data set;
[0097] Obtain a first evaluation result according to the input data set and the target output set;
[0098] Acquire a training data set according to the first evaluation result, the input data set, and the target output set;
[0099] The training data set is used to train the model to be trained, and the first prompt information is used to guide the model to be trained to generate corresponding output.
[0100] The training data construction device provided by the present disclosure obtains the training data set through the first evaluation result, the input data set and the target output set to realize the construction of the training data. Since the training data set is constructed according to the first evaluation result, the quality of the training data can be guaranteed; in addition, since the input data set is related to the original business data, and the original business data is highly targeted and of high quality, the construction of training data based on the original business data can further improve the data quality. The device solves the problem in the prior art that the quality of the training data constructed based on the collected data is poor because the collected data is generally public data with varying quality. When the training data is used for model training, it is easy to cause model learning deviation, thereby affecting the accuracy, generalization ability and stability of the model.
[0101] Furthermore, the training data construction device provided by the present disclosure also includes:
[0102] Use the training data set to train the model to be trained to obtain the target model.
[0103] Furthermore, the training data construction device provided by the present disclosure also performs the following process:
[0104] Manage training datasets according to preset labels.
[0105] The original business data may be obtained according to a preset business ratio.
[0106] The first prompt information may be preset information or information expanded based on the preset information; wherein the expansion based on the preset information includes semantic expansion based on the preset information.
[0107] The input data set may be obtained by combining the original business data and the first prompt information according to a preset prompt ratio.
[0108] In some embodiments of the present disclosure, obtaining an input data set based on original business data and first prompt information includes: performing a first processing on the original business data to obtain preliminary data; obtaining an initial input set based on the preliminary data and the first prompt information; and performing a second processing on the data in the initial input set to obtain an input data set.
[0109] In some embodiments of the present disclosure, obtaining a target output set corresponding to an input data set includes: inputting data in the input data set into a preset first model to obtain an initial output set; and updating the initial output set to obtain a target output set.
[0110] In some embodiments of the present disclosure, a first evaluation result is obtained based on an input data set and a target output set, including: obtaining data richness and data complexity of the input data set; obtaining output quality based on an initial output set corresponding to the target output set and the input data set; and obtaining the first evaluation result based on data richness, data complexity, and output quality.
[0111] Among them, obtaining the data richness and data complexity of the input data set may include: respectively obtaining the data length and prompt length of each data in the input data set; obtaining the input complexity of each data according to the data length and prompt length of each data; obtaining the prompt complexity of each data according to the prompt length of each data; obtaining the data complexity of the input data set according to the input complexity and prompt complexity of each data.
[0112] Acquiring data richness and data complexity of the input data set may include: performing clustering processing on the data in the input data set to obtain at least one cluster; and acquiring data richness of the input data set according to the at least one cluster.
[0113] Obtaining the output quality according to the target output set and the initial output set corresponding to the input data set may include: performing data comparison between the initial output set and the target output set to obtain the output quality.
[0114] Obtaining the first evaluation result according to data richness, data complexity, and output quality may include: performing weighted processing on the data richness, data complexity, and output quality to obtain the first evaluation result.
[0115] In some embodiments of the present disclosure, the input complexity of each piece of data may be the sum of the data length of the data multiplied by the data weight and the prompt length of the data multiplied by the prompt weight; the data complexity may be the sum of the input complexity of the input data set multiplied by the first weight and the prompt complexity of the input data set multiplied by the second weight; wherein, the input complexity of the input data set may be the sum of the input complexities of all data in the input data set divided by the amount of data; the prompt complexity of the input data set may be the sum of the prompt complexities of all data in the input data set divided by the amount of data.
[0116] In some embodiments of the present disclosure, in order to further improve the quality of training data, when clustering the data in the input data set, it can also be performed according to a preset number of clusters, that is, the amount of data in the cluster clusters is limited according to the preset number of clusters, thereby reducing similar data while ensuring data diversity. In conventional clustering, the number of clusters can be directly used as data richness; when clustering is performed according to a preset number of clusters, the data richness can be the total amount of cluster data included in all clusters multiplied by the number of clusters divided by the total amount of original data.
[0117] In some embodiments of the present disclosure, the output quality can be divided according to a preset level, such as high quality and low quality, high quality, medium quality and low quality, etc., and the level can be set as needed. The output quality can be determined according to the similarity between the output data, such as taking completely identical data as high quality data, taking most of the same data as medium quality data, taking most of the different or completely different data as low quality data, etc.
[0118] In some embodiments of the present disclosure, by performing verification of indicators such as c-eval, mmlu, and AlignBench based on the first evaluation results, it can be found that the data model training effect is better when the first evaluation result is high. Therefore, the training data constructed based on the first evaluation result can improve the model training quality.
[0119] In some embodiments of the present disclosure, obtaining a training data set according to a first evaluation result, an input data set, and a target output set includes: determining whether the first evaluation result is greater than a preset evaluation threshold; if the first evaluation result is greater than the preset evaluation threshold, using the input data set and the target output set to construct a training data set. When the first evaluation result is not greater than the preset evaluation threshold, obtaining a training data set according to the first evaluation result, the input data set, and the target output set also includes: clustering the data in the input data set to obtain at least one cluster cluster; obtaining the instruction following score of the data in at least one cluster cluster; filtering the data in at least one cluster cluster according to the instruction following score of the data in at least one cluster cluster to obtain filtered data; obtaining a second evaluation result corresponding to the filtered data; and after updating the current first evaluation result to the second evaluation result, executing a judgment on whether the first evaluation result is greater than the preset evaluation threshold. Among them, the method of obtaining the second evaluation result is similar to the method of obtaining the first result; when using the input data set and the target output set to construct a training data set, the instruction following score can also be used to filter data, which will not be repeated here.
[0120] Combine the following Figures 4 to 13 The method for constructing the training data disclosed in the present invention is described in detail.
[0121] Embodiment 2:
[0122] Figure 4 The present invention is a flowchart of a method for constructing training data according to an embodiment of the present invention.
[0123] refer to Figure 4 The training data construction method M400 of this embodiment includes:
[0124] Step S410, obtaining original business data and first prompt information.
[0125] In some embodiments of the present disclosure, the original business data in step S410 can be obtained from the business system arbitrarily, or can be obtained from the business system according to a preset ratio, etc. The first prompt information in step S410 can be preset information. In order to improve the model capability, the first prompt information can also be information obtained by expanding based on the preset information. The expansion can be carried out in real time or in advance, etc. Among them, the expansion based on the preset information includes semantic expansion based on the preset information. The semantic expansion can be implemented using a word vector model, a synonym dictionary or a vocabulary network, a topic model (such as Latent Dirichlet Allocation, LDA), context expansion, semantic similarity calculation, etc., and can also be implemented based on large models such as GPT, WizardLM, etc.
[0126] Step S420: acquiring an input data set according to the original business data and the first prompt information.
[0127] In some embodiments of the present disclosure, the input data set may be obtained in any manner in step S420, or may be obtained by combining the original business data and the first prompt information according to a preset prompt ratio. Figure 5 As shown, the process of obtaining the input data set through step S420 may include: step S421, performing a first process on the original business data to obtain preliminary data; step S422, obtaining an initial input set according to the preliminary data and the first prompt information; step S423, performing a second process on the data in the initial input set to obtain the input data set. This step S422 can be obtained arbitrarily, or according to a preset prompt ratio. Among them, the training data set is used to train the model to be trained, and the first prompt information is used to guide the model to be trained to generate corresponding outputs.
[0128] Step S430, obtaining a target output set corresponding to the input data set.
[0129] In some embodiments of the present disclosure, Figure 6As shown, the process of obtaining the target output set through step S430 may include: step S431, inputting the data in the input data set into the preset first model respectively to obtain the initial output set; step S432, updating the initial output set to obtain the target output set. The method of updating the initial output set through step S432 may be updating according to user instructions, etc.
[0130] Step S440: Obtain a first evaluation result according to the input data set and the target output set.
[0131] In some embodiments of the present disclosure, Figure 7 As shown, the process of obtaining the first evaluation result through step S440 may include: step S441, obtaining the data richness and data complexity of the input data set; step S442, obtaining the output quality according to the target output set and the initial output set corresponding to the input data set; step S443, obtaining the first evaluation result according to the data richness, data complexity and output quality. Among them, the way to obtain the output quality in step S442 may be to compare the initial output set with the target output set to obtain the output quality, etc.; the way to obtain the first evaluation result through step S443 may be to perform weighted processing on the data richness, data complexity and output quality to obtain the first evaluation result, etc.; the weighted processing may be performed based on the importance of the evaluation index and / or the weight set for the training purpose, and the weighted processing may be weighted sum, weighted average, weighted median, weighted standard deviation / variance, etc.
[0132] like Figure 8 As shown, step S441 may include: step S4411, respectively obtaining the data length and the hint length of each data in the input data set; step S4412, obtaining the input complexity of each data according to the data length and the hint length of each data; step S4413, obtaining the hint complexity of each data according to the hint length of each data; step S4414, obtaining the data complexity of the input data set according to the input complexity and the hint complexity of each data. Further, as Fig. 9 As shown, step S441 may further include: step S4415, clustering the data in the input data set to obtain at least one cluster; step S4416, obtaining the data richness of the input data set according to the at least one cluster.
[0133] Step S450, obtaining a training data set according to the first evaluation result, the input data set and the target output set.
[0134] In some embodiments of the present disclosure, Fig.10As shown, step S450 may include: step S451, determining whether the first evaluation result is greater than a preset evaluation threshold; step S452, if the first evaluation result is greater than the preset evaluation threshold, constructing a training data set using the input data set and the target output set. Fig.11 As shown, step S450 may also include: step S453, clustering the data in the input data set to obtain at least one cluster; step S454, obtaining the instruction following score of the data in at least one cluster; step S455, filtering the data in at least one cluster according to the instruction following score of the data in at least one cluster to obtain filtered data; step S456, obtaining a second evaluation result corresponding to the filtered data; step S457, after updating the current first evaluation result to the second evaluation result, executing step S451.
[0135] Furthermore, if Fig.12 As shown, the method for constructing training data in this embodiment may further include:
[0136] Step S460: Use the training data set to train the model to be trained to obtain a target model.
[0137] Furthermore, if Fig.13 As shown, the method for constructing training data in this embodiment may further include:
[0138] Step S470: managing the training data set according to the preset labels.
[0139] In some embodiments of the present disclosure, step S460 and step S470 may also be performed simultaneously.
[0140] The present disclosure also provides a readable storage medium, in which a computer program is stored, and the computer program is used to implement the above method when executed by a processor. "Readable storage medium" can be any device that can contain, store, communicate, propagate or transmit a program for use in an instruction execution system, device or equipment or in combination with these instruction execution systems, devices or equipment. More specific examples of readable storage media include the following: an electrical connection portion (electronic device) with one or more wirings, a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM), etc.
[0141] The present disclosure also provides a computer program product. The method of the present disclosure can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed, the process or function of the present disclosure is executed in whole or in part.
[0142] The computer program or instructions may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The readable storage medium may be any available medium that can be accessed or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid state drive. The computer readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0143] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0144] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0145] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0146] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0147] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment / method or example. Moreover, the specific features, structures, or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments / methods or examples described in this specification and features of different embodiments / methods or examples, unless they are contradictory.
[0148] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0149] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.
Claims
1. A training data construction device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following process: Obtain original business data and first prompt information; Acquire an input data set according to the original business data and the first prompt information; Obtaining a target output set corresponding to the input data set; Acquire a first evaluation result according to the input data set and the target output set; Acquire a training data set according to the first evaluation result, the input data set, and the target output set; The training data set is used to train the model to be trained, and the first prompt information is used to guide the model to be trained to generate corresponding output.
2. The training data construction device according to claim 1, characterized in that: Also includes: The training data set is managed according to preset labels.
3. The training data construction device according to claim 1, characterized in that: The first prompt information is preset information or information expanded based on the preset information; The expansion based on the preset information includes semantic expansion based on the preset information.
4. The training data construction device according to any one of claims 1 to 3, characterized in that: The obtaining of a target output set corresponding to the input data set includes: Input the data in the input data set into a preset first model respectively to obtain an initial output set; The initial output set is updated to obtain the target output set.
5. The training data construction device according to any one of claims 1 to 3, characterized in that: The obtaining a first evaluation result according to the input data set and the target output set includes: Obtaining data richness and data complexity of the input data set; Obtaining output quality according to the target output set and an initial output set corresponding to the input data set; The first evaluation result is obtained according to the data richness, the data complexity and the output quality.
6. The training data construction device according to any one of claims 1 to 3, characterized in that: The acquiring of a training data set according to the first evaluation result, the input data set and the target output set includes: Determining whether the first evaluation result is greater than a preset evaluation threshold; If the first evaluation result is greater than a preset evaluation threshold, a training data set is constructed using the input data set and the target output set.
7. The training data construction device according to claim 6, characterized in that: If the first evaluation result is not greater than a preset evaluation threshold, acquiring a training data set according to the first evaluation result, the input data set, and the target output set further includes: Performing clustering processing on the data in the input data set to obtain at least one cluster; Obtaining an instruction following score of the data in the at least one cluster; Filtering the data in the at least one cluster according to the instruction following score of the data in the at least one cluster to obtain filtered data; Obtaining a second evaluation result corresponding to the screening data; After the current first evaluation result is updated to the second evaluation result, the step of determining whether the first evaluation result is greater than a preset evaluation threshold is performed.
8. A method for constructing training data, characterized in that: include: Obtain original business data and first prompt information; Acquire an input data set according to the original business data and the first prompt information; Obtaining a target output set corresponding to the input data set; Acquire a first evaluation result according to the input data set and the target output set; as well as Acquire a training data set according to the first evaluation result, the input data set, and the target output set; The training data set is used to train the model to be trained, and the first prompt information is used to guide the model to be trained to generate corresponding output.
9. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the method for constructing training data as claimed in claim 8.
10. A computer program product, characterized in that The computer program product comprises a computer program, which is used at least to implement the method for constructing training data according to claim 8 when executed by a processor.
Citation Information
Cited By
Method, system and equipment for constructing model training data and medium
CN119558399A
