Sample generation method and device based on artificial intelligence, computer equipment and medium
By training the business model, filtering and correcting weak samples, and applying a sample expansion strategy to generate target sample data, the problem of low efficiency and quality in existing sample generation methods is solved, and the application effect of the language model is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PING AN TECH (SHENZHEN) CO LTD
- Filing Date
- 2026-01-19
- Publication Date
- 2026-05-12
AI Technical Summary
Existing sample generation methods suffer from low quality and low generation efficiency, resulting in poor performance of language models in the fields of finance, insurance, and healthcare.
By acquiring a basic dataset, training a business model, using a greedy decoding strategy to filter out weak samples, using a decision model to correct the samples, and applying a sample expansion strategy to generate target sample data.
This improved the quality and efficiency of sample data generation, and enhanced the performance and application effectiveness of the language model.
Smart Images

Figure CN122020161A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology and can be applied to fields such as fintech and digital healthcare, particularly to artificial intelligence-based sample generation methods, devices, computer equipment, and storage media. Background Technology
[0002] In the application of language models with tool-invoking capabilities, current models are widely used to perform tasks such as computation, retrieval, database queries, and complex task planning. Their performance is highly dependent on the sample data used for training. However, existing sample generation methods have significant limitations, mainly relying on static datasets constructed manually or generated using strong models. When using strong models to generate data, evaluating the quality of each data point requires extensive manual annotation, which not only consumes a large amount of manpower and time but also results in uncontrollable sample data quality and widespread labeling errors. This situation directly leads to low efficiency and accuracy in sample generation methods, severely restricting the further development and application of language models with tool-invoking capabilities.
[0003] For example, in the financial insurance sector, the sample data traditionally used to train language models to assist in insurance product recommendations and risk assessments is often collected and organized manually or generated by simple models. This results in inconsistent data quality and frequent labeling errors. Consequently, models trained on these samples struggle to accurately understand customer needs and provide precise insurance recommendations and risk assessments when faced with complex and ever-changing insurance business scenarios, thus reducing the quality and efficiency of insurance services. Similarly, in the medical field, sample data used to train language models to assist in disease diagnosis and medical decision-making suffers from similar problems. Due to imperfect sample generation methods, data quality is difficult to guarantee, and labeling errors can mislead the model's learning and judgment, thereby affecting the accuracy of disease diagnosis and the scientific nature of medical decisions, posing potential risks to patients' health.
[0004] Therefore, there is an urgent need to provide an improved sample generation method to enhance the quality and efficiency of sample data generation, thereby improving the performance and application effectiveness of language models with tool-calling capabilities. Summary of the Invention
[0005] The purpose of this application is to propose a sample generation method, apparatus, computer device, and storage medium based on artificial intelligence, so as to solve the technical problems of low quality and low generation efficiency in existing sample generation methods.
[0006] Firstly, an artificial intelligence-based sample generation method is provided, including: Obtain a pre-built base dataset and extract a sample set from the base dataset; The preset business model is trained based on the sample set to obtain the trained target business model. Based on a preset greedy decoding strategy, the target business model is used to perform capability detection processing on the sample set in order to filter out the corresponding weak capability sample set from the sample set. Based on a preset decision model, the set of weak samples is subjected to sample correction processing to obtain the corresponding first sample set; The first sample set is expanded based on a preset sample expansion strategy to obtain the corresponding second sample set. Based on the first sample set and the second sample set, sample update processing is performed to obtain the corresponding target sample data; The target sample data is then processed for output.
[0007] Secondly, an artificial intelligence-based sample generation device is provided, comprising: The processing module is used to acquire a pre-built basic dataset and extract a sample set from the basic dataset; The training module is used to train the preset business model based on the sample set to obtain the trained target business model. The filtering module is used to perform capability detection processing on the sample set based on the preset greedy decoding strategy and the target business model, so as to filter out the corresponding weak capability sample set from the sample set. The correction module is used to perform sample correction processing on the set of weak samples based on a preset decision model to obtain the corresponding first sample set. An extension module is used to perform sample extension processing on the first sample set based on a preset sample extension strategy to obtain a corresponding second sample set. The update module is used to perform sample update processing based on the first sample set and the second sample set to obtain the corresponding target sample data; The output module is used to process the target sample data.
[0008] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described artificial intelligence-based sample generation method.
[0009] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described artificial intelligence-based sample generation method.
[0010] In the above-mentioned scheme implemented by the artificial intelligence-based sample generation method, apparatus, computer equipment, and storage medium, a pre-constructed basic dataset is first acquired, and a sample set is extracted from the basic dataset. Then, a pre-defined business model is trained based on the sample set to obtain a trained target business model. Subsequently, based on a pre-defined greedy decoding strategy, the target business model is used to perform capability detection processing on the sample set to filter out a corresponding set of samples with weak capabilities. The set of samples with weak capabilities is then corrected based on a pre-defined decision model to obtain a corresponding first sample set. Subsequently, the first sample set is expanded based on a pre-defined sample expansion strategy to obtain a corresponding second sample set. Further, a sample update process is performed based on the first and second sample sets to obtain the corresponding target sample data. Finally, the target sample data is output. Based on the above automated processing flow, unlike existing sample generation methods that rely on manual construction or the use of strong models to generate static data, this application, by introducing greedy capability detection, decision model label verification, and an error-driven data expansion mechanism based on a sample expansion strategy, can efficiently and accurately construct target sample data that matches the model's capabilities, effectively improving the generation quality and efficiency of the target sample data. Attached Figure Description
[0011] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is an exemplary system architecture diagram to which this application can be applied; Figure 2 This is a flowchart of an embodiment of the artificial intelligence-based sample generation method according to this application; Figure 3 This is a schematic diagram of the structure of an embodiment of the artificial intelligence-based sample generation device according to this application; Figure 4 This is a schematic diagram of the structure of one embodiment of the computer device according to this application. Detailed Implementation
[0013] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0014] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0015] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0016] like Figure 1 As shown, system architecture 100 may include terminal device 101, network 102, and server 103. Terminal device 101 may be a laptop 1011, tablet 1012, or mobile phone 1013. Network 102 is used as a medium to provide a communication link between terminal device 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0017] Users can use terminal device 101 to interact with server 103 via network 102 to receive or send messages, etc. Various communication client applications can be installed on terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.
[0018] Terminal device 101 can be various electronic devices with a display screen and support web browsing. In addition to laptops 1011, tablets 1012, or mobile phones 1013, terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer, and a desktop computer, etc.
[0019] Server 103 can be a server that provides various services, such as a backend server that provides support for the pages displayed on terminal device 101.
[0020] It should be noted that the artificial intelligence-based sample generation method provided in this application embodiment is generally executed by a server / terminal device, and correspondingly, the artificial intelligence-based sample generation device is generally set in the server / terminal device.
[0021] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0022] Continue to refer to Figure 2 This document illustrates a flowchart of an embodiment of the AI-based sample generation method according to this application. The order of steps in the flowchart can be changed, and some steps can be omitted, depending on different requirements. The AI-based sample generation method provided in this application can be applied to any scenario requiring sample generation, and thus can be applied to products in these scenarios, such as sample generation products in the financial insurance field. The AI-based sample generation method includes the following steps: Step S201: Obtain the pre-built basic dataset and extract the sample set from the basic dataset.
[0023] In this embodiment, the artificial intelligence-based sample generation method runs on an electronic device (e.g., Figure 1The server / terminal device shown can obtain a pre-built basic dataset via wired or wireless connection. It should be noted that the aforementioned wireless connection methods may include, but are not limited to, 3G / 4G / 5G connections, WiFi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB (ultra-wideband) connections, and other currently known or future-developed wireless connection methods. The executing entity of this application is specifically a sample generation system, which can be simply referred to as the system. Furthermore, this application can be applied to sample generation scenarios in the fields of fintech and digital healthcare.
[0024] The construction process of the aforementioned basic dataset includes: 1) Determining the tool call scenarios and sample structure: Clearly define the tool call scenarios to which the dataset will be constructed, such as database queries, file processing, and API calls. For each scenario, define the basic structure of the samples, i.e., each sample contains an input instruction x, a target tool call sequence y, and an optional execution result r. For example, in the database query scenario, the input instruction is the query request submitted by the user, the target tool call sequence is the SQL statement conforming to the database query syntax rules, and the execution result is the actual data obtained from the database based on the SQL statement.
[0025] 2) Collecting Input Commands: Input commands are collected through various means. These can include recording user requests from actual business scenarios, or being written by domain experts based on the tool's functionality and common use cases. For example, in database query scenarios, different types of query requests such as "query product names with sales exceeding 1000" or "count the number of customers in each region" can be collected as input commands.
[0026] 30. Generate Target Tool Call Sequence: Based on the input command, a domain expert or a rule engine generates the corresponding target tool call sequence. The domain expert, leveraging their expertise and experience, transforms the input command into a sequence conforming to tool call specifications; the rule engine then parses and transforms the input command according to predefined rules. For example, for the input command "Query product names with sales exceeding 1000", the SQL statement "SELECT product_name FROM salesWHERE amount>1000" is generated as the target tool call sequence.
[0027] 4) Obtain the execution results: If possible, execute the generated target tool call sequence in a real environment and obtain the corresponding execution results. For example, execute the above SQL statement in the database to obtain a list of specific product names as the execution result.
[0028] 5) Data Normalization: All collected data is normalized to ensure a consistent format for the target tool's call sequences. For example, in SQL statements, keyword case and indentation are standardized, and parameter representation is normalized. Input commands and execution results are also appropriately formatted, such as removing redundant spaces and special characters.
[0029] Data construction is the starting point of the entire process, providing the foundational data for subsequent stages such as model training and capability exploration. Constructing a dataset with a standardized format ensures consistency and accuracy in subsequent processing. Standardized data helps the model better learn the patterns and rules of tool calls, improving the model's generalization ability and performance.
[0030] In addition, a sample set (x, y) is extracted from the constructed basic dataset, where x is the input instruction and y is the target tool call sequence.
[0031] Step S202: Based on the sample set, the preset business model is trained to obtain the trained target business model.
[0032] In this embodiment, the aforementioned business model can be a language model with tool invocation capabilities built according to actual business needs. For example, it may include a recommendation model applied to insurance product recommendation, or an analysis model applied to disease data analysis, and so on.
[0033] The training process for the aforementioned business model includes: 1) Selecting a model architecture: Choosing a suitable model architecture based on task requirements and data characteristics, such as a Transformer-based sequence generation model. This model has powerful capabilities in processing sequence data, capturing the complex relationship between input instructions and target tool call sequences. 2) Preparing training data: Extracting a sample set (x, y) from the constructed base dataset, where x is the input instruction and y is the target tool call sequence. Dividing the dataset into training, validation, and test sets for model training, parameter tuning, and performance evaluation. 3) Defining a loss function: Selecting a suitable loss function to measure the difference between the tool call sequence generated by the model and the target sequence. For example, the cross-entropy loss function is commonly used in sequence generation tasks; it effectively measures the difference between two probability distributions, guiding the model to generate outputs that are closer to the target sequence. 4) Training the model: Supervised learning of the model using the training set, updating the model parameters through the backpropagation algorithm to gradually reduce the loss function value. During training, adjusting the model's hyperparameters, such as the learning rate and batch size, based on the performance on the validation set to prevent overfitting or underfitting. 5) Evaluate model performance: Use the test set to evaluate the trained model, calculate the model's accuracy, recall, F1 score and other metrics on the task of generating tool call sequences, and evaluate whether the model has the basic ability to understand call formats and generate structured sequences.
[0034] Model training is a crucial step in equipping a model with basic capabilities. Through supervised learning on a well-constructed foundational dataset, the model learns the mapping relationship between input commands and target tool call sequences, gaining a preliminary understanding of the format and structure of tool calls. This step provides a foundational model for subsequent capability exploration. Only when the model possesses certain initial capabilities can its weaknesses be identified and targeted improvements made.
[0035] Step S203: Based on a preset greedy decoding strategy, the target business model is used to perform capability detection processing on the sample set in order to filter out the corresponding weak capability sample set from the sample set.
[0036] In this embodiment, the specific implementation process of using the target business model to perform capability detection processing on the sample set based on the preset greedy decoding strategy to filter out the corresponding weak capability sample set from the sample set will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0037] Step S204: Based on the preset decision model, perform sample correction processing on the weak sample set to obtain the corresponding first sample set.
[0038] In this embodiment, the specific implementation process of performing sample correction processing on the weak sample set based on the preset decision model to obtain the corresponding first sample set will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0039] Step S205: Perform sample expansion processing on the first sample set based on a preset sample expansion strategy to obtain the corresponding second sample set.
[0040] In this embodiment, the specific implementation process of performing sample expansion processing on the first sample set based on the preset sample expansion strategy to obtain the corresponding second sample set will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0041] Step S206: Perform sample update processing based on the first sample set and the second sample set to obtain the corresponding target sample data.
[0042] In this embodiment, the specific implementation process of performing sample update processing based on the first sample set and the second sample set to obtain the corresponding target sample data will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0043] Step S207: Output the target sample data.
[0044] In this embodiment, the generated target sample data can be sent to relevant business personnel via email, message, or interface display to complete the output processing of the target sample data.
[0045] This application first acquires a pre-constructed basic dataset and extracts a sample set from it. Then, it trains a pre-defined business model based on the sample set to obtain a trained target business model. Next, based on a pre-defined greedy decoding strategy, the target business model is used to perform capability detection processing on the sample set to filter out a corresponding set of samples with weak capabilities. Based on a pre-defined decision model, the set of samples with weak capabilities is then corrected to obtain a corresponding first sample set. Subsequently, based on a pre-defined sample expansion strategy, the first sample set is expanded to obtain a corresponding second sample set. Further, a sample update process is performed based on the first and second sample sets to obtain the corresponding target sample data. Finally, the target sample data is output. Based on this automated processing flow, unlike existing sample generation methods that rely on manual construction or the use of strong models to generate static data, this application, by introducing greedy capability detection, decision model label verification, and an error-driven data expansion mechanism based on a sample expansion strategy, can efficiently and accurately construct target sample data that matches the model's capabilities, effectively improving the generation quality and efficiency of the target sample data.
[0046] This effectively improves the efficiency of generating target sample data, and enhances the accuracy and compliance of the generated target sample data.
[0047] In some alternative implementations, step S203 includes the following steps: Based on the greedy decoding strategy, the target business model is used to perform prediction processing on the sample set to obtain the corresponding prediction sequence.
[0048] In this embodiment, the target business model, which has been trained so far, is used to predict all training samples in the aforementioned sample set, and a greedy decoding strategy is employed to generate the prediction sequence. Greedy decoding is a simple decoding strategy that selects the symbol with the highest probability at each step of output generation, until a complete sequence is generated.
[0049] The predicted sequence is compared with the corresponding reference label item by item to obtain the corresponding comparison results.
[0050] In this embodiment, the predicted sequence generated by the target business model is compared item by item with the reference label (i.e., the target tool call sequence) to determine whether the target business model has generated the correct sequence, and the corresponding comparison result is generated (including whether the correct sequence has been generated or not). For example, each keyword, table name, column name, parameter, etc. in the SQL statement must be precisely compared.
[0051] Based on the comparison results, a first sample data is selected from the sample set; wherein the first sample data is a sample in which the target business model failed to generate the correct sequence.
[0052] In this embodiment, the comparison results can be analyzed to filter out the first sample data that failed to generate the correct sequence from the sample set.
[0053] Calculate the perplexity of the sample set, and select a second sample data whose perplexity is greater than a preset threshold from the sample set.
[0054] In this embodiment, to further identify the target business model's mastery of the sample set, a general perplexity calculation formula can be used to calculate the perplexity (PPL) of each training sample in the sample set. Perplexity is an indicator of language model performance, reflecting the model's uncertainty in predicting samples. The higher the perplexity, the more uncertain the model's prediction of that sample, and the lower its mastery. Then, a second set of sample data with a perplexity greater than a preset threshold is selected from the sample set. The preset threshold refers to the perplexity threshold; its value is not specifically limited and can be determined based on actual business needs.
[0055] The first sample data and the second sample data are integrated to obtain the corresponding integrated sample set.
[0056] In this embodiment, the obtained first sample data (samples for which the model failed to generate the correct sequence) and the second sample data (samples with significantly high perplexity) can be integrated, and the resulting integrated sample set can be used as the corresponding weak sample set.
[0057] The integrated sample set is used as the set of samples with weak capabilities.
[0058] This application employs a greedy decoding strategy to predict a sample set using a target business model, obtaining corresponding predicted sequences. These predicted sequences are then compared item-by-item with their corresponding reference labels to obtain alignment results. Based on these results, a first set of sample data is selected from the sample set; this first set consists of samples for which the target business model failed to generate correct sequences. Next, the perplexity of the sample set is calculated, and a second set of sample data with a perplexity exceeding a preset threshold is selected. The first and second sets of sample data are then integrated to obtain a unified sample set. Finally, this unified sample set is used as a set of samples with weak capabilities. Based on this process, this application, by using a greedy decoding strategy to probe the sample set with the target business model, can accurately identify the weaknesses in the target business model after training—that is, on which samples the model performs poorly. This set of samples with weak capabilities provides direction for subsequent data repair and hard example expansion, making subsequent processing more targeted and contributing to improved overall model performance.
[0059] In some optional implementations of this embodiment, step S204 includes the following steps: Based on the target business model, the set of samples with weak capabilities is subjected to prediction processing to obtain the corresponding target prediction sequence.
[0060] In this embodiment, the target business model, which has been trained beforehand, can be used to predict all samples in the aforementioned weak sample set. A greedy decoding strategy is employed to generate the prediction sequence. Greedy decoding is a simple decoding strategy that selects the symbol with the highest probability at each step of output generation until a complete target prediction sequence is generated.
[0061] Based on the decision model, the target prediction sequence and the corresponding target reference label are predicted to obtain the corresponding prediction result.
[0062] In this embodiment, the target prediction sequence output by the target business model and the corresponding reference label are input into the decision model. The decision model will return one of four prediction results based on semantic and structural consistency: model prediction error, label error, both correct, or both incorrect. For example, the decision model can determine whether the two sequences are consistent by analyzing their syntactic structure, keyword matching degree, semantic logic, etc.
[0063] The model construction process of the aforementioned decision model includes: Data preparation: Collecting a large number of samples with clear semantic and structural correctness, including original samples and validated extended samples, as training data for the decision model. Simultaneously, preparing some samples with semantic or structural problems as negative samples. Feature extraction: Extracting information reflecting the semantic and structural features from the samples. For text samples, word vectors, syntactic structure features, etc., can be extracted; for image samples, features such as texture, color, and shape, as well as features of operation sequences (such as operation type, order, parameters, etc.), can be extracted. Model selection and training: Selecting appropriate machine learning or deep learning models, such as Support Vector Machines (SVM), neural networks, etc., to model and train the extracted features. During training, positive and negative samples are used for supervised learning, enabling the model to learn the ability to distinguish between semantically and structurally correct and incorrect samples.
[0064] Obtain the preset correction and processing strategy.
[0065] In this embodiment, the above-mentioned correction processing strategy includes the following: when the label is determined to be incorrect, the system will use the prediction generated by the decision model to replace the original label to correct the error in the data. If both the model prediction and the label are incorrect, the sample is discarded because such a sample cannot provide effective information for model training. If both the model prediction and the label are correct, the sample remains unchanged and continues to be used for subsequent training and expansion.
[0066] Based on the prediction results, the correction processing strategy is used to correct the weak sample set to obtain the corrected sample set.
[0067] In this embodiment, based on the strategy content of the above-mentioned correction processing strategy, the corresponding correction processing can be performed on the weak sample set according to the content of the above-mentioned prediction results, and the obtained corrected sample set can be used as the corresponding first sample set.
[0068] The corrected sample set is used as the first sample set.
[0069] This application performs prediction processing on a set of weak-capability samples based on a target business model to obtain corresponding target prediction sequences. Then, based on a decision model, it performs prediction processing on the target prediction sequences and their corresponding target reference labels to obtain corresponding prediction results. Next, it obtains a preset correction processing strategy and, based on the prediction results, uses this strategy to correct the weak-capability sample set, resulting in a corrected sample set. This corrected sample set is then used as the first sample set. Based on this processing flow, since the generated weak-capability sample set may contain various errors, directly using it for training would impair model performance. Therefore, this application intelligently utilizes the results of the capability detection stage during the decision label verification stage to correct label errors in the weak-capability sample set. By introducing a decision model, it can accurately determine the source of errors and correct label errors, effectively improving the data quality of the corrected first sample set. Furthermore, the corrected first sample set can provide more reliable data support for subsequent model training, helping the model learn more accurate knowledge.
[0070] In some alternative implementations, step S205 includes the following steps: Select the target extension method from a variety of preset extension methods.
[0071] In this embodiment, the above-mentioned expansion methods may include at least the following: 1) Parameter variation: For samples containing parameters, change the value of the parameters. For example, in a database query sample, increase, decrease, or randomly change the numerical parameters in the query conditions. 2) Semantic equivalence rewriting: Rewrite the input command using synonyms, near-synonyms, or different expressions while maintaining its semantics. For example, rewrite "query product names with sales exceeding 1000" as "find product names with sales exceeding 1000". 3) Partial replacement of the call chain: For complex tool call sequences, replace part of the call chain. For example, in a sequence containing multiple API calls, replace the calling method or parameters of one of the APIs.
[0072] The specific implementation process of selecting the target extension method from a variety of preset extension methods will be described in more detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0073] Construct the corresponding target extension function based on the target extension method.
[0074] In this embodiment, a corresponding target extension function can be written according to the selected extension method. For example, for parameter changes, a function can be written to randomly or according to certain rules change the parameter values in the samples; for semantic equivalence rewriting, a thesaurus or a natural language processing model can be used for rewriting.
[0075] The first sample set is input into the target expansion function to expand the first sample set based on the target expansion method, thereby obtaining the corresponding third sample set.
[0076] In this embodiment, the first sample set can be input into the target expansion function, and the target expansion function will expand the first sample set based on the corresponding target expansion method to generate a new sample set with similar structure but with perturbation, namely the third sample set.
[0077] For example, the following examples illustrate how these extension methods can be used to generate new samples in the fields of financial insurance and digital healthcare: In the insurance claim review scenario within the financial insurance sector, consider the following challenging sample (x, y): Input instruction x: "Review a car insurance claim. The accident occurred on May 10, 2024, in Chaoyang District, Beijing. The accident type is a rear-end collision. The requested claim amount is 5,000 yuan. The accident photos provided by the applicant clearly show the vehicle damage." Reference label y: "The car insurance claim is approved; the claim amount of 5,000 yuan is reasonable."
[0078] Extended sample generation can include: 1. Parameter changes. Change the accident time: Change the accident time from "May 10, 2024" to "June 15, 2024". New input instruction x1: "Review a car insurance claim application. The accident time is June 15, 2024. The accident location is Chaoyang District, Beijing. The accident type is rear-end collision. The claimed claim amount is 5,000 yuan. The accident photos provided by the applicant clearly show the damage to the vehicle." Reference label y1: "The car insurance claim application is approved. The claim amount of 5,000 yuan is reasonable." (Assuming that the time change does not affect the claim review result) Change the claimed claim amount: Change the claimed claim amount from "5,000 yuan" to "8,000 yuan". New input command x2: "Review a car insurance claim application. The accident occurred on May 10, 2024, in Chaoyang District, Beijing. The accident type is a rear-end collision. The claimed amount is 8,000 yuan. The accident photos provided by the applicant clearly show the damage to the vehicle." Reference tag y2: "This car insurance claim application needs further verification. The claimed amount of 8,000 yuan may not match the extent of the vehicle damage." (Assuming the amount changes and affects the review result).
[0079] 2. Semantic Equivalence Rewriting. Rewrite the input instruction: The original text "Review a car insurance claim application. The accident occurred on May 10, 2024, in Chaoyang District, Beijing. The accident type is rear-end collision. The claimed compensation amount is 5000 yuan. The accident photos provided by the applicant clearly show the vehicle damage." is rewritten as "Review a car insurance claim application. The accident occurred on May 10, 2024, in Chaoyang District, Beijing. The accident was caused by a rear-end collision. The claimed compensation amount is 5000 yuan. The accident photos submitted by the applicant clearly show the vehicle damage." New input instruction x3: "Review a car insurance claim application. The accident occurred on May 10, 2024, in Chaoyang District, Beijing. The accident was caused by a rear-end collision. The claimed compensation amount is 5000 yuan. The accident photos submitted by the applicant clearly show the vehicle damage." Reference tag y3: "The car insurance claim application has been approved. The compensation amount of 5000 yuan is reasonable."
[0080] 3. Partial Replacement of Call Chain (assuming the review process involves multiple internal system calls). Original Call Chain: First, the vehicle information query system is called to confirm the vehicle's insurance status; then, the accident photo analysis system is called to assess the extent of vehicle damage; finally, the claim amount is determined based on the assessment results and insurance terms. Replaced Part of the Call Chain: The step of calling the accident photo analysis system to assess the extent of vehicle damage is replaced with manual review of accident photos and the generation of a damage assessment report. New Input Instruction x4: "Review a car insurance claim application. The accident occurred on May 10, 2024, in Chaoyang District, Beijing. The accident type is a rear-end collision. The claimed claim amount is 5,000 yuan. A manually generated accident photo damage assessment report has been received." Reference Tag y4: "The car insurance claim application has been approved. The claim amount of 5,000 yuan is reasonable."
[0081] Furthermore, in the disease analysis and suggestion scenario within the digital healthcare field, consider the following difficult sample (x, y): Input instruction x: "A 45-year-old male patient presents with headache and dizziness for one week, accompanied by nausea and vomiting. He has a history of hypertension, with a blood pressure measurement of 160 / 100 mmHg. Please provide a disease diagnosis suggestion." Reference label y: "Preliminary diagnosis: hypertensive encephalopathy. A head CT scan is recommended to rule out serious complications such as cerebral hemorrhage. Simultaneously, the antihypertensive medication treatment plan should be adjusted."
[0082] Extended sample generation can include: 1. Parameter changes. Change blood pressure measurement: Change the blood pressure measurement from "160 / 100 mmHg" to "180 / 110 mmHg". New input instruction x1: "Patient is a 45-year-old male, complaining of headache and dizziness for one week, accompanied by nausea and vomiting. He has a history of hypertension. His blood pressure measurement is 180 / 110 mmHg. Please provide a diagnosis suggestion." Reference label y1: "Preliminary diagnosis is hypertensive crisis. It is recommended to be hospitalized immediately for comprehensive examinations such as a head CT scan, and to quickly adjust antihypertensive medication to lower blood pressure." Change age: Change the patient's age from "45 years old" to "65 years old". New input command x2: "The patient is a 65-year-old male, presenting with headache and dizziness for one week, accompanied by nausea and vomiting. He has a history of hypertension, with a blood pressure measurement of 160 / 100 mmHg. Please provide a diagnostic suggestion." Reference label y2: "The preliminary diagnosis is highly probable hypertensive encephalopathy. Considering the patient's advanced age, it is recommended to perform head CT and MRI scans as soon as possible, closely monitor changes in the condition, and cautiously adjust antihypertensive medications."
[0083] 2. Semantic Equivalence Rewriting. Rewrite the input command: The original text "A 45-year-old male patient presents with headache and dizziness for one week, accompanied by nausea and vomiting. He has a history of hypertension, and his blood pressure is 160 / 100 mmHg. Please provide diagnostic suggestions." is rewritten as: "A 45-year-old male patient reports headache and dizziness for one week, accompanied by nausea and vomiting. He has a history of hypertension, and his current blood pressure is 160 / 100 mmHg. Please provide diagnostic suggestions." New input command x3: "A 45-year-old male patient reports headache and dizziness for one week, accompanied by nausea and vomiting. He has a history of hypertension, and his current blood pressure is 160 / 100 mmHg. Please provide diagnostic suggestions." Reference tag y3: "Preliminary diagnosis: hypertensive encephalopathy. A head CT scan is recommended to rule out serious complications such as cerebral hemorrhage. Simultaneously, adjust the antihypertensive medication regimen."
[0084] 3. Partial Replacement of Call Chain (assuming the disease analysis process involves multiple medical system calls). Original Call Chain: First, the electronic medical record system is called to obtain the patient's past medical history; then, the examination and testing system is called to obtain current blood pressure and other test results; finally, a diagnostic suggestion is given based on the medical knowledge base and clinical experience. Replaced Part of the Call Chain: The step of calling the examination and testing system to obtain current blood pressure and other test results is replaced with blood pressure data from the patient's recent physical examination report. New Input Command x4: "Male patient, 45 years old, chief complaint: headache and dizziness for one week, accompanied by nausea and vomiting. History of hypertension. A recent physical examination report shows a blood pressure measurement of 160 / 100 mmHg. Please provide a disease diagnosis suggestion." Reference Tag y4: "Preliminary diagnosis: hypertensive encephalopathy. A head CT scan is recommended to rule out serious complications such as cerebral hemorrhage. Simultaneously, the antihypertensive medication treatment plan should be adjusted."
[0085] The third sample set is filtered based on a preset filtering strategy to obtain the corresponding fourth sample set.
[0086] In this embodiment, the specific implementation process of filtering the third sample set based on the preset filtering strategy to obtain the corresponding fourth sample set will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0087] The fourth sample set is used as the second sample set.
[0088] This application selects a target expansion method from a set of preset expansion methods; constructs a corresponding target expansion function based on the target expansion method; inputs a first sample set into the target expansion function to expand the first sample set based on the target expansion method, resulting in a third sample set; then filters the third sample set based on a preset filtering strategy to obtain a fourth sample set; and finally uses the fourth sample set as the second sample set. Based on the above processing flow, this application provides an error-driven data expansion step that generates new difficult sample sets (the second sample set) based on a purified set of weak-capability sample sets. Since the capability shortcomings of the target business model are concentrated in the set of weak-capability sample sets, this application, by specifically generating difficult sample sets, can further enrich the sample data, improve the diversity, effectiveness, and accuracy of the generated second sample set, and enable the target business model to learn in more complex and diverse scenarios. This helps to improve the model's capabilities in weak areas and enhance its generalization ability and robustness.
[0089] In some optional implementations, selecting the target extension method from a variety of preset extension methods includes the following steps: The first sample set is subjected to sample feature identification to obtain the corresponding sample feature identification results.
[0090] In this embodiment, the above-mentioned sample feature identification includes: 1) Data type identification: clarifying whether the sample is text, image, audio, structured data, etc. For example, in e-commerce recommendation scenarios, the sample may be a user's historical browsing records (a combination of text and structured data); in the field of security monitoring, the sample may be surveillance video (images and video sequences). 2) Key feature extraction: identifying the key features in the sample, which have a significant impact on model performance. In e-commerce recommendation samples, key features may include the user's age, gender, the category of browsed products, browsing time, etc.; in security monitoring samples, key features may include the person's behavior, clothing features, scene background, etc. 3) Sample distribution evaluation: analyzing the distribution of samples across different feature dimensions. For example, in insurance recommendation data, checking whether the number of samples from different age groups is balanced; in security monitoring data, evaluating the differences in the number of samples in different scenarios (such as indoor and outdoor).
[0091] Obtain the training target corresponding to the first sample set.
[0092] In this embodiment, the process of determining the training objectives includes: Defining the core tasks: Identifying the main tasks the business model needs to accomplish, such as improving the accuracy of insurance product recommendations in insurance recommendation and increasing the detection rate of abnormal behavior in security monitoring. Setting performance indicators: Setting specific performance indicators based on the core tasks, such as recommendation accuracy, recall, false positive rate, and false negative rate for abnormal behavior detection. Determining improvement directions: Analyzing the current model's performance on these indicators and identifying areas that need focused improvement. For example, if the model has low accuracy when recommending less popular products, it needs to expand the sample size for that part.
[0093] The results of the sample feature analysis are compared with the training target to obtain the corresponding data analysis results.
[0094] In this embodiment, the obtained sample characteristic analysis results can be analyzed in conjunction with the training objective to obtain corresponding data analysis results. These data analysis results may include: the sample characteristics are relatively simple, and the training objective is clear and only requires improvement in one aspect; or the sample has multiple key features, and the training objective needs to comprehensively consider multiple aspects.
[0095] Select the specified extension method that matches the data analysis results from the various extension methods.
[0096] In this embodiment, when the data analysis results indicate that the sample characteristics are relatively simple and the training objective is clear and only requires improvement in a specific aspect, an expansion method can be randomly selected. For example, in insurance recommendation, if the main problem is the scarcity of male user data in the sample and only the number of male user samples needs to be increased, then a rule-based synthesis method can be chosen to generate more virtual samples of male users. However, when the sample has multiple key features and the training objective requires comprehensive consideration of multiple aspects, multiple expansion methods (2 or 3) can be combined. For example, in security monitoring, it is necessary to increase the number of samples in different scenarios (rotation and scaling in data augmentation) and generate new samples with different behavioral patterns (model-based synthesis) to improve the model's ability to recognize various situations.
[0097] The specified extension method is used as the target extension method.
[0098] Based on the above processing flow, this application obtains the sample feature identification result by performing sample feature identification on the first sample set, and then performs data analysis on the sample feature analysis result and the training target. In turn, it can select the matching target expansion method from multiple expansion methods based on the obtained data analysis result, which effectively improves the flexibility and intelligence of selecting target expansion methods.
[0099] In some optional implementations of this embodiment, the step of filtering the third sample set based on a preset filtering strategy to obtain the corresponding fourth sample set includes the following steps: The third sample set is subjected to syntax detection based on preset syntax rules to obtain the corresponding syntax detection results.
[0100] In this embodiment, the above-mentioned grammar detection includes: 1) Clarifying grammar rules. First, for the tool call sequences involved in the extended samples (third sample set), their grammar rules are thoroughly analyzed and clarified. For example, in text generation tasks, if the extended samples are sentences generated by specific templates and rules, then the order of the various components in the sentence (such as subject, predicate, object, etc.), collocation rules, and punctuation usage rules need to be clarified. For image processing tasks, if the extended samples are generated by performing a series of operations on the original image (such as rotation, scaling, filtering, etc.), then the order of these operations, parameter ranges, and combination rules need to be clarified. For example, rotation is performed first, followed by scaling, the rotation angle should be between -90° and 90°, and the scaling ratio should be between 0.5 and 2, etc. 2) Designing a grammar checking process. The tool call sequences of the extended samples are decomposed according to a certain structure. For example, for text samples, they can be decomposed into units at different levels such as words, phrases, and sentences; for image processing samples, they can be decomposed into each independent operation step and corresponding parameters. Each decomposed unit is checked one by one to see if it conforms to the grammar rules. For text samples, check if words are spelled correctly, phrases are structured logically, and sentences are grammatically correct. For image processing samples, check if the parameters of each operation are within the allowed range and if the order of operations conforms to regulations. If units that do not conform to grammatical rules are found, record their location and specific problems, and mark them. 3) Handling grammatical errors. For minor grammatical errors, such as misspellings or improper punctuation, automatic correction can be attempted. For example, use spell check tools to automatically correct spelling errors and automatically add or remove punctuation according to grammatical rules. For serious grammatical errors, such as incorrect operation order or parameters exceeding the range, if automatic correction is not possible, directly mark the extended sample as unqualified and remove it from the candidate sample set.
[0101] The third sample set is filtered based on the syntax detection results to obtain third sample data that has passed the syntax detection.
[0102] In this embodiment, after using grammar rules to perform grammar detection on the third sample set and obtaining the grammar detection result, the content of the obtained grammar detection result may include passing the grammar detection result or failing the grammar detection result.
[0103] The third sample data is processed based on the aforementioned decision model to obtain the corresponding decision result.
[0104] In this embodiment, third-party sample data that has passed grammar checks is input into the decision model. For text samples, sentences are converted into word vectors or other suitable feature representations; for image samples, corresponding features are extracted and combined into feature vectors. Then, the decision model judges the semantic and structural consistency of the samples based on the input features and returns four types of decision results: model prediction error, label error, both correct, or both incorrect.
[0105] Based on the judgment result, the third sample data is filtered to obtain the filtered fourth sample data.
[0106] In this embodiment, the above-mentioned filtering process refers to filtering out samples in the third sample data that have semantic or structural problems based on the judgment result, in order to obtain the corresponding fourth sample data. The specific implementation process includes: Model prediction error: If the judgment model determines that the model prediction is incorrect, it indicates that the extended sample may have semantic or structural problems, causing the model to be unable to correctly understand or process it. In this case, the sample is marked as unqualified and removed from the third sample data. Label error: If the judgment model determines that the label is incorrect, it indicates that the reference label of the extended sample is inaccurate, while the prediction generated by the model may be correct. In this case, the original label is replaced by the prediction generated by the model, and the sample is retained in the third sample data. Both correct: When the judgment model determines that both the model and the label are correct, it indicates that the extended sample is semantically and structurally reasonable, and it is directly retained in the third sample data. Both incorrect: If the judgment model determines that both the model and the label are incorrect, it indicates that the extended sample has serious problems and cannot provide effective information. In this case, the sample is marked as unqualified and removed from the third sample data.
[0107] The fourth sample data is used as the fourth sample set.
[0108] This application performs syntax detection on a third sample set based on preset syntax rules to obtain corresponding syntax detection results. Then, based on the syntax detection results, the third sample set is filtered to obtain third sample data that passes the syntax detection. Next, a decision model is used to process the third sample data, yielding corresponding decision results. Finally, based on the decision results, the third sample data is filtered again to obtain filtered fourth sample data. This fourth sample data is then used as the fourth sample set. Based on this processing flow, this application performs syntax detection and decision processing on the third sample set by combining syntax rules and a decision model. Based on the obtained syntax detection and decision results, it can automatically and accurately complete the sample filtering process for the third sample set, effectively ensuring the validity and correctness of the resulting fourth sample set.
[0109] In some optional implementations of this embodiment, step S206 includes the following steps: The first sample set and the second sample set are integrated to obtain the corresponding first generated data.
[0110] In this embodiment, the above integration process includes: Selecting a merging tool: Choosing an appropriate tool for merging based on the data type and format. If the data is stored in a database, database merge query statements, such as the UNION operation in SQL (suitable for relational databases), can be used to merge data from different tables. For data stored in file format, such as CSV files, JSON files, etc., relevant libraries in programming languages (such as Python) can be used for merging. For example, the pandas library can be used to easily read multiple CSV files and merge them into a single data frame. Executing the merging operation: Merging the labeled samples (second sample set) and the generated hard sample samples (first sample set) according to the selected tool and method. During the merging process, attention should be paid to the correspondence of the data to ensure that the fields or features of each sample are correctly aligned. For example, when merging image datasets, it is necessary to ensure that the image files and their corresponding labels are correctly associated.
[0111] Record relevant information during the merger process, such as the source of the merged data, the merger time, and the amount of data after the merger, for subsequent querying and auditing.
[0112] The first generated data is processed to obtain the corresponding second generated data.
[0113] In this embodiment, the data processing includes: Data format unification: Checking for inconsistencies in the format of the merged data. For example, some samples might have string labels while others might have numeric labels; or the image sizes might be inconsistent. These issues are addressed by uniformly converting labels to appropriate types and adjusting image sizes. It is also ensured that the field order and naming are consistent across all samples. If there are differences in field order or naming between the original dataset, the labeled samples, and the difficult examples, adjustments are needed to ensure a unified field structure in the merged dataset. Data sorting: Sorting the data according to actual needs. For example, sorting by sample category, generation time, difficulty level, etc. Sorting facilitates subsequent data viewing and analysis and can also improve training efficiency in certain training scenarios.
[0114] The second generated data is deduplicated to obtain the corresponding third generated data.
[0115] In this embodiment, the deduplication process includes: determining deduplication rules: determining the basis for deduplication based on the characteristics of the data. For image data, the image hash value can be used as the basis for deduplication; if two images have the same hash value, they are considered duplicates. For text data, text summaries or specific feature vectors can be used for deduplication. Considering whether to retain specific information in duplicate samples. For example, in some cases, although two samples may have similar content, their generation time or source may be different, and it may be necessary to decide whether to retain one of the samples based on this information. Performing deduplication: using appropriate tools or algorithms to perform deduplication. In programming languages, a Set data structure can be used to remove duplicate elements; for large-scale datasets, deduplication functions in distributed computing frameworks (such as Spark) can be used for efficient processing. Recording the deduplication results, including the number of duplicate samples removed, the number of remaining unique samples, and other information.
[0116] The third generated data is used as the target sample data.
[0117] In this embodiment, the generated target sample data can be stored. Specifically, this includes selecting a suitable storage method based on the data size, usage frequency, and access requirements. If the data volume is small, a local file system can be used for storage; if the data volume is large, a distributed file system or database can be considered for storage. Then, the target sample data is stored according to the selected storage method. Simultaneously, information such as the storage location and storage time is recorded to facilitate subsequent data management and use.
[0118] Based on the above processing flow, this application integrates the sample data that has undergone label correction and error expansion, thereby fully utilizing the processing results of each stage and improving the quality and richness of the generated target sample data. Furthermore, the updated target sample data better reflects the needs and complexities of the actual task, providing more valuable data support for model training.
[0119] In some optional implementations of this embodiment, the system also provides a closed-loop training phase based on GRPO, the specific implementation process of which includes: 1. Selection of training algorithm: The Group Relative Policy Optimization (GRPO) algorithm is adopted. This algorithm is a reinforcement learning algorithm that enables the model to gradually optimize its tool calling ability under the drive of reward signals.
[0120] 2. Define the reward function: Define a reward function based on the quality and performance of the tool call sequence generated by the model. The reward function can comprehensively consider multiple factors, such as the accuracy, completeness, and efficiency of the sequence. For example, for a database query task, if the SQL statement generated by the model can be executed correctly and return the expected result, a higher reward is given; if the statement has syntax errors or the execution result is inaccurate, a lower reward or penalty is given.
[0121] 3. Closed-loop training: After the data has been corrected and expanded, the system enters the next round of training. The model generates a tool invocation sequence based on the current input command and obtains the corresponding reward signal according to the reward function. Through continuous iterative training, the model adjusts its parameters based on the reward signal, gradually optimizing its tool invocation capability.
[0122] 4. Triggering a New Round of Stages: After a new round of training, a new round of stages such as capability detection, label correction, and error expansion will be triggered. Capability detection identifies weaknesses in the model after the new training, label correction corrects erroneous labels in the data, and error expansion generates new difficult examples. Then, data updates and closed-loop training are performed again to continuously optimize model performance.
[0123] The GRPO-based closed-loop training phase forms a closed loop with the preceding data processing phase. Through continuous iterative training, the model gradually improves its capabilities on updated datasets. After each training round, capability probing and other processes identify model issues, and the data is processed and expanded accordingly to provide more targeted data for the next training round. This closed-loop training approach enables the model to continuously adapt to complex and changing task requirements, continuously optimize its tool invocation capabilities, and improve the overall performance and stability of the model.
[0124] In some alternative implementations, the user information obtained is subject to user consent and complies with relevant laws and policies.
[0125] Furthermore, any software tools or components not belonging to our company that appear in the embodiments of this application are merely illustrative examples and do not represent actual use.
[0126] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0127] It should be emphasized that, in order to further ensure the privacy and security of the aforementioned target sample data, the target sample data can also be stored in a blockchain node.
[0128] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0129] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).
[0130] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0131] Further reference Figure 3 As a response to the above Figure 2 To implement the method shown, this application provides an embodiment of an artificial intelligence-based sample generation device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0132] like Figure 3As shown, the artificial intelligence-based sample generation device 300 described in this embodiment includes: a processing module 301, a training module 302, a screening module 303, a correction module 304, an expansion module 305, an update module 306, and an output module 307. Wherein: Processing module 301 is used to obtain a pre-built basic dataset and extract a sample set from the basic dataset; Training module 302 is used to train a preset business model based on the sample set to obtain a trained target business model; The filtering module 303 is used to perform capability detection processing on the sample set based on the preset greedy decoding strategy and the target business model, so as to filter out the corresponding weak capability sample set from the sample set. The correction module 304 is used to perform sample correction processing on the weak sample set based on a preset decision model to obtain the corresponding first sample set. The extension module 305 is used to perform sample expansion processing on the first sample set based on a preset sample expansion strategy to obtain the corresponding second sample set; The update module 306 is used to perform sample update processing based on the first sample set and the second sample set to obtain the corresponding target sample data; The output module 307 is used to output the target sample data.
[0133] In some optional implementations of this embodiment, the filtering module 303 includes: The first prediction submodule is used to perform prediction processing on the sample set based on the greedy decoding strategy and the target business model to obtain the corresponding prediction sequence; The alignment submodule is used to perform item-by-item alignment between the predicted sequence and the corresponding reference label to obtain the corresponding alignment result; The first filtering submodule is used to filter out first sample data from the sample set based on the comparison results; wherein, the first sample data is the sample in which the target business model failed to generate the correct sequence; The second filtering submodule is used to calculate the perplexity of the sample set and filter out second sample data with a perplexity greater than a preset threshold from the sample set. The first integration submodule is used to integrate the first sample data and the second sample data to obtain the corresponding integrated sample set; The first determining submodule is used to use the integrated sample set as the weak sample set.
[0134] In some optional implementations of this embodiment, the correction module 304 includes: The second prediction submodule is used to perform prediction processing on the set of weak capability samples based on the target business model to obtain the corresponding target prediction sequence; The third prediction submodule is used to perform prediction processing on the target prediction sequence and the corresponding target reference label based on the decision model to obtain the corresponding prediction result; The `get` submodule is used to obtain the preset correction and processing strategy; The correction submodule is used to correct the weak sample set based on the prediction results using the correction processing strategy, so as to obtain the corrected sample set. The second determining submodule is used to use the corrected sample set as the first sample set.
[0135] In some optional implementations of this embodiment, the extension module 305 includes: The third filtering submodule is used to filter out the target extension method from a variety of preset extension methods; A submodule is constructed to build the corresponding target extension function based on the target extension method. An extension submodule is used to input the first sample set into the target extension function to extend the first sample set based on the target extension method, thereby obtaining the corresponding third sample set. The filtering submodule is used to filter the third sample set based on a preset filtering strategy to obtain the corresponding fourth sample set. The third determining submodule is used to use the fourth sample set as the second sample set.
[0136] In some optional implementations of this embodiment, the third filtering submodule includes: The identification unit is used to identify sample features in the first sample set and obtain the corresponding sample feature identification results. An acquisition unit is used to acquire the training target corresponding to the first sample set; The analysis unit is used to perform data analysis on the sample feature analysis results and the training target to obtain the corresponding data analysis results. A filtering unit is used to filter out a specified extension method that matches the data analysis result from the multiple extension methods; The first determining unit is used to select the specified extension method as the target extension method.
[0137] In some optional implementations of this embodiment, the filtering submodule includes: The detection unit is used to perform grammar detection on the third sample set based on preset grammar rules and obtain the corresponding grammar detection results. The first filtering unit is used to filter the third sample set based on the syntax detection result to obtain third sample data that has passed the syntax detection. The processing unit is used to perform decision processing on the third sample data based on the decision model to obtain the corresponding decision result; The second filtering unit is used to filter the third sample data based on the decision result to obtain the filtered fourth sample data. The second determining unit is used to take the fourth sample data as the fourth sample set.
[0138] In some optional implementations of this embodiment, the update module 306 includes: The second integration submodule is used to integrate the first sample set and the second sample set to obtain the corresponding first generated data; The data processing submodule is used to process the first generated data to obtain the corresponding second generated data. The deduplication submodule is used to deduplicatize the second generated data to obtain the corresponding third generated data. The fourth determining submodule is used to use the third generated data as the target sample data.
[0139] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0140] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected via a system bus. It should be noted that only the computer device 4 with components 41-43 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0141] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.
[0142] The memory 41 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 4. Of course, the memory 41 may also include both the internal storage unit and its external storage device of the computer device 4. In this embodiment, the memory 41 is typically used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions for sample generation methods based on artificial intelligence. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or will be output.
[0143] In some embodiments, the processor 42 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to execute computer-readable instructions stored in the memory 41 or to process data, for example, to execute computer-readable instructions for the artificial intelligence-based sample generation method.
[0144] The network interface 43 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 4 and other electronic devices.
[0145] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by at least one processor to cause the at least one processor to perform the steps of the artificial intelligence-based sample generation method described above.
[0146] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0147] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.
Claims
1. A sample generation method based on artificial intelligence, characterized in that, Includes the following steps: Obtain a pre-built base dataset and extract a sample set from the base dataset; The preset business model is trained based on the sample set to obtain the trained target business model. Based on a preset greedy decoding strategy, the target business model is used to perform capability detection processing on the sample set in order to filter out the corresponding weak capability sample set from the sample set. Based on a preset decision model, the set of weak samples is subjected to sample correction processing to obtain the corresponding first sample set; The first sample set is expanded based on a preset sample expansion strategy to obtain the corresponding second sample set. Based on the first sample set and the second sample set, sample update processing is performed to obtain the corresponding target sample data; The target sample data is then processed for output.
2. The sample generation method based on artificial intelligence according to claim 1, characterized in that, The step of using the target business model to perform capability detection processing on the sample set based on the preset greedy decoding strategy, in order to filter out the corresponding weak capability sample set from the sample set, specifically includes: Based on the greedy decoding strategy, the target business model is used to perform prediction processing on the sample set to obtain the corresponding prediction sequence; The predicted sequence is compared item by item with the corresponding reference label to obtain the corresponding comparison results; Based on the comparison results, a first sample data is selected from the sample set; wherein, the first sample data is a sample in which the target business model failed to generate a correct sequence; Calculate the perplexity of the sample set, and select a second sample data whose perplexity is greater than a preset threshold from the sample set; The first sample data and the second sample data are integrated to obtain a corresponding integrated sample set. The integrated sample set is used as the set of samples with weak capabilities.
3. The sample generation method based on artificial intelligence according to claim 1, characterized in that, The step of performing sample correction processing on the set of weak samples based on a preset decision model to obtain the corresponding first sample set specifically includes: Based on the target business model, the set of samples with weak capabilities is subjected to prediction processing to obtain the corresponding target prediction sequence; Based on the decision model, the target prediction sequence and the corresponding target reference label are predicted to obtain the corresponding prediction result. Obtain the preset correction and processing strategy; Based on the prediction results, the correction processing strategy is used to correct the weak sample set to obtain the corrected sample set. The corrected sample set is used as the first sample set.
4. The sample generation method based on artificial intelligence according to claim 1, characterized in that, The step of performing sample expansion processing on the first sample set based on a preset sample expansion strategy to obtain the corresponding second sample set specifically includes: Select the target extension method from a variety of preset extension methods; Construct the corresponding target extension function based on the target extension method; The first sample set is input into the target expansion function to expand the first sample set based on the target expansion method, thereby obtaining the corresponding third sample set. The third sample set is filtered based on a preset filtering strategy to obtain the corresponding fourth sample set. The fourth sample set is used as the second sample set.
5. The sample generation method based on artificial intelligence according to claim 4, characterized in that, The step of selecting the target extension method from a variety of preset extension methods specifically includes: Perform sample feature identification on the first sample set to obtain the corresponding sample feature identification results; Obtain the training target corresponding to the first sample set; The results of the sample feature analysis are compared with the training target to obtain the corresponding data analysis results. Select the specified extension method that matches the data analysis results from the multiple extension methods; The specified extension method is used as the target extension method.
6. The sample generation method based on artificial intelligence according to claim 4, characterized in that, The step of filtering the third sample set based on a preset filtering strategy to obtain the corresponding fourth sample set specifically includes: The third sample set is subjected to syntax detection based on preset syntax rules to obtain the corresponding syntax detection results; The third sample set is filtered based on the syntax detection results to obtain third sample data that has passed the syntax detection. Based on the aforementioned decision model, the third sample data is processed to obtain the corresponding decision result; Based on the judgment result, the third sample data is filtered to obtain the filtered fourth sample data. The fourth sample data is used as the fourth sample set.
7. The sample generation method based on artificial intelligence according to claim 1, characterized in that, The step of performing sample update processing based on the first sample set and the second sample set to obtain the corresponding target sample data specifically includes: The first sample set and the second sample set are integrated to obtain the corresponding first generated data; The first generated data is processed to obtain the corresponding second generated data; The second generated data is deduplicated to obtain the corresponding third generated data; The third generated data is used as the target sample data.
8. A sample generation device based on artificial intelligence, characterized in that, include: The processing module is used to acquire a pre-built basic dataset and extract a sample set from the basic dataset; The training module is used to train the preset business model based on the sample set to obtain the trained target business model. The filtering module is used to perform capability detection processing on the sample set based on a preset greedy decoding strategy and the target business model, so as to filter out the corresponding weak capability sample set from the sample set. The correction module is used to perform sample correction processing on the weak sample set based on a preset decision model to obtain the corresponding first sample set. An extension module is used to perform sample extension processing on the first sample set based on a preset sample extension strategy to obtain a corresponding second sample set. The update module is used to perform sample update processing based on the first sample set and the second sample set to obtain the corresponding target sample data; The output module is used to process the target sample data.
9. A computer device, characterized in that, It includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the artificial intelligence-based sample generation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the artificial intelligence-based sample generation method as described in any one of claims 1 to 7.