Example data amplification method, device, equipment and medium
Through a large language model, learning target role setting information and sample data, generating and evaluating target problem text, updating sample data, solving the problems of high cost of obtaining example data and low availability in the prior art, and improving the efficiency and quality of text analysis.
Patent Information
- Application Number
- CN202411014559.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-07-26
AI Technical Summary
In the prior art, the labor and time cost of obtaining example data is high, and the availability of example data is low, making it difficult to effectively decouple multi-hop problems in complex long texts.
Learn the mapping relationship between target role setting information and sample data by presetting large language models, generate target problem text, and ask and evaluate the analysis text based on the target problem text. If the evaluation result meets the preset conditions, update the example data to improve the quality and consistency of data.
Reduces labor and time costs for obtaining sample data, improves the availability and quality of sample data, and enhances the ability of large language models to analyze complex long texts.
Smart Images

Figure CN119066416A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an example data amplification method, device, electronic device and storage medium. Background Art
[0002] Large Language Models (LLMs) are a natural language processing model based on deep learning. They have a strong ability to answer single-hop reasoning questions. They learn the regular statistics and semantic representation of language by pre-training on a large amount of text data, so as to understand and generate text in subsequent tasks.
[0003] The LLMs model can be used for complex long text analysis to achieve tasks such as deconstruction, analysis, and evaluation of plots, scripts, and literature. In this case, the LLMs model is needed to solve more complex problems in more dimensions. However, the current LLMs model is not mature enough to solve coupled multi-hop problems, and it is difficult to decouple a series of complex problems, resulting in a large defect in the LLMs model's ability to analyze and decompose complex long texts.
[0004] In the prior art, the potential of the LLMs model can be "exploited" as much as possible by optimizing the prompt words, so that the LLMs model can decouple complex problems. For example, sample data can be added to the prompt words input to the LLMs model. The sample data is used to provide examples for the current task of the LLMs model, so that the LLMs model generates the output text of the current task based on the prompts of the sample data.
[0005] However, sample data often need to be manually screened. On the one hand, sample data in different fields need to be screened by practitioners with background knowledge and experience in different fields. During the screening process, the data of each processing link of the LLMs model needs to be analyzed and evaluated, including large and complex text data, which has high time and labor costs. On the other hand, the screening of sample data by the same person is often highly subjective, and the standards for example writing by different people are difficult to unify, resulting in low availability of sample data. Summary of the invention
[0006] The purpose of the embodiments of the present application is to provide a method, apparatus, device and storage medium for example data augmentation, which can solve the problems in the prior art of high labor and time costs for obtaining example data and low availability of example data.
[0007] In a first aspect, an embodiment of the present application provides an exemplary data augmentation method, including:
[0008] Obtain target role setting information and sample data; the target role setting information is used to set the identity of a preset large language model, the sample data includes sample role setting information and corresponding sample question text, and the sample question text is a text for asking questions based on the sample role setting information;
[0009] Learning a first mapping relationship between the example role setting information and the example question text through the preset large language model, and generating a target question text corresponding to the target role setting information based on the first mapping relationship;
[0010] Acquire a text to be analyzed, and ask a question to the text to be analyzed based on the target question text through the preset large language model to obtain a target answer text corresponding to the target question text;
[0011] Evaluate the target question text and the corresponding target answer text to obtain a target evaluation result;
[0012] When the target evaluation result meets the preset evaluation qualification condition, the example data is updated according to the target role setting information and the target question text.
[0013] In a second aspect, an embodiment of the present application provides an exemplary data amplification device, characterized by comprising:
[0014] An acquisition module is used to acquire target role setting information and sample data; the target role setting information is used to perform identity setting for a preset large language model, the sample data includes sample role setting information and corresponding sample question text, and the sample question text is a text for asking questions based on the sample role setting information;
[0015] A generating module, configured to learn a first mapping relationship between the example role setting information and the example question text through the preset large language model, and determine a target question text corresponding to the target role setting information based on the first mapping relationship;
[0016] An analysis module is used to obtain a text to be analyzed, and to ask a question to the text to be analyzed based on the target question text through the preset large language model to obtain a target answer text corresponding to the target question text;
[0017] An evaluation module, used to evaluate the target question text and the corresponding target answer text to obtain an evaluation text and a corresponding target evaluation result;
[0018] An updating module is used to update the example data according to the target role setting information and the target question text when the target evaluation result meets the preset evaluation qualification condition.
[0019] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0020] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0021] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0022] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0023] In this embodiment, target role setting information and example data are obtained; the target role setting information is used to perform identity setting for a preset large language model, the example data includes example role setting information and corresponding example question text, and the example question text is a text that asks questions based on the example role setting information; a first mapping relationship between the example role setting information and the example question text is learned through a preset large language model, and a target question text corresponding to the target role setting information is determined based on the first mapping relationship; a text to be analyzed is obtained, and questions are asked of the text to be analyzed based on the target question text through a preset large language model to obtain a target answer text corresponding to the target question text; the target question text and the corresponding target answer text are evaluated to obtain a target evaluation result; when the target evaluation result meets a preset evaluation qualification condition, the example data is updated according to the target role setting information and the target question text.
[0024] In this way, by learning the sample data with the preset large language model, the target question text can be determined according to the target role setting information, and the text to be analyzed can be analyzed according to the target question text to obtain the target answer text, wherein the sample role setting information and the corresponding sample question text are used as examples in the process of determining the target question text to improve the ability of the preset large language model to ask and answer questions for the text to be analyzed. Furthermore, after evaluating the target question text and the corresponding target answer text output by the preset large language model, if the target evaluation result meets the preset evaluation qualification condition, then it indicates that the content of the text to be analyzed meets the requirements, and the preset large language model can reasonably analyze the text to be analyzed and obtain an answer that meets the requirements. Therefore, based on the input and output of the preset large language model in the self-questioning and self-answering process, the sample data can be updated. When the system process starts again, the target role setting information and target question text in this process are added to the sample data used by the preset large language model. Moreover, since the target role setting information and target question text newly added to the sample data are accumulated in this system process, their format and content meet the requirements of each link of the preset large language model, thereby achieving high quality and consistency of the sample data. In other words, the system can automatically expand a large amount of excellent sample data to reduce the manpower and time costs of obtaining sample data, while improving the availability of sample data, which is beneficial to the text analysis effect of the preset large language model. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a flow chart of an exemplary data augmentation method according to an exemplary embodiment;
[0026] Figure 2 is a schematic diagram of a text analysis framework according to an exemplary embodiment;
[0027] Figure 3 is a block diagram of an exemplary data augmentation device according to an exemplary embodiment;
[0028] Figure 4 is a block diagram of an example data augmentation electronic device for a base station according to an exemplary embodiment;
[0029] Figure 5 It is a block diagram of a device for example data augmentation according to an exemplary embodiment. DETAILED DESCRIPTION
[0030] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0032] The following is a detailed description of the example data augmentation method provided in the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0033] Generally, the LLMs model can be used for complex long text analysis to achieve tasks such as deconstruction, analysis, and evaluation of plots, scripts, and literature. Specifically, this can be achieved by optimizing the prompt words. For example, sample data can be added to the prompt words input to the LLMs model. The sample data is used to provide examples for the current task of the LLMs model, so that the LLMs model generates the output text of the current task based on the prompts of the sample data.
[0034] For example, if the LLMs model is used to analyze the plot of a script to be analyzed, then the example data may include some example scripts and the plot outlines, main characters, time, place and other information of these example scripts. In this way, the LLMs model can learn the context of the example data and the script to be analyzed, and can analyze the plot outline, main characters, time, place and other information of the script to be analyzed according to the mapping relationship between the example scripts and their corresponding plot outlines, main characters, time, place and other information.
[0035] However, sample data often need to be manually screened. On the one hand, sample data in different fields need to be screened by practitioners with background knowledge and experience in different fields. During the screening process, the data of each processing link of the LLMs model needs to be analyzed and evaluated, including large and complex text data, which has high time and labor costs. On the other hand, the screening of sample data by the same person is often highly subjective, and the standards for example writing by different people are difficult to unify, resulting in low availability of sample data.
[0036] Based on this, the example data augmentation method in this application is proposed to solve the above problems. Specifically, this application can be applied to a server, a local server or other servers in a network.
[0037] The above-mentioned server can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.
[0038] Among them, cloud technology refers to a hosting technology that unifies hardware, software, network and other resources in a wide area network or local area network to realize data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which is used on demand and flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0039] Figure 1 is a flow chart of an example data augmentation method according to an exemplary embodiment. The example data augmentation method includes the following steps.
[0040] In step S11, target role setting information and sample data are obtained; the target role setting information is used to set the identity of the preset large language model, and the sample data includes sample role setting information and corresponding sample question text, and the sample question text is the text of the question based on the sample role setting information.
[0041] In this step, the target role setting information and sample data are first obtained, wherein the sample data includes the sample role setting information and the corresponding sample question text. The target role setting information is used to set the identity of the preset large language model. For example, the identity of the preset large language model can be set as a drama critic, a teacher, or a student, etc. According to different identity settings, the preset large language model may obtain different target question texts and target answer texts for the same text to be analyzed.
[0042] It can be understood that the example data is the data that provides examples for the text analysis process of the preset large language model. Each set of example data includes a set of inputs and corresponding outputs of the preset large language model. For example, the example data may include input data A and output data B that needs to be output by the preset large language model. Then, after obtaining the input data A', the preset large language model can obtain the output data B' corresponding to A' based on the mapping relationship between A and B through context learning.
[0043] In this step, the example data includes example role setting information and corresponding example question text, and thus can be used to instruct the preset large language model to determine the corresponding target question text based on the target role setting information in subsequent steps.
[0044] In step S12, a first mapping relationship between example role setting information and example question text is learned through a preset large language model, and a target question text corresponding to the target role setting information is determined based on the first mapping relationship.
[0045] In this step, the preset large language model performs context learning on the target role setting information and example data. By learning the first mapping relationship between the example role setting information and the example question text, a direction is provided for the prediction of the preset large language model. Then, the target question text corresponding to the target role setting information can be predicted based on the first mapping relationship. In this way, the association logic between the target question text and the target role setting information is similar or identical to the association logic between the example role setting information and the example question text. Therefore, the ability of the preset large language model to raise relevant questions can be effectively improved.
[0046] In other words, you can first set the role of the preset large language model, set the role of the large language model according to the type of text to be analyzed, and then use the self-developed or existing prompt word paradigm combined with the target role setting information to enable the large language model to independently raise questions that need to be analyzed for the text to be analyzed. The prompt word paradigm refers to guiding the preset large language model to generate the corresponding output text by defining a template or prompt word, so that the preset large language model has higher generation quality and efficiency.
[0047] Among them, the set role can be "learned" by the preset large language model through the prompt word project, such as using the OpenAI interface to obtain the target role setting information by calling the system role attribute (system role). Specifically, two class instances can be established, respectively calling the system role attribute of the preset large language model, and setting their own roles as questioner and answerer through the system role attribute, respectively, for asking questions and answering questions based on the identity setting of the system role attribute to the text to be analyzed.
[0048] In this application, through the guidance of the prompt word paradigm, the preset large language model can learn which questions should be asked under the setting of different target role setting information. Among them, the optional prompt word paradigm can be a simple chain thinking method such as COT (chain of thoughts); it can also be a more complex SA+SE (self-ask+search engine) method, which also displays the thinking process of asking a certain question under the setting of this target role setting information; it can also use the search engine to assist in finding more professional questions that can be used for text analysis in the relevant professional fields corresponding to the target role setting information during the thinking process; it can also further use the ReAct (reasoning and action) method to further decompose specific questions under the setting of the target role setting information, and ask single-hop or even recursive questions to the decomposed questions to enhance the preset large language model's understanding of the questions, etc., and this application does not limit this.
[0049] In one implementation, the example data includes first example data and second example data, the first example data includes example role setting information and corresponding example background information, and the second example data includes example background information and corresponding example question text;
[0050] Learning a first mapping relationship between example role setting information and example question text by using a preset large language model, and determining a target question text corresponding to the target role setting information based on the first mapping relationship, including:
[0051] Inputting the target role setting information and the first example data into a preset large language model for context learning, obtaining a second mapping relationship between the example role setting information and the example background information, and determining the target background information corresponding to the target role setting information based on the second mapping relationship;
[0052] The target background information and the second example data are input into a preset large language model for context learning to obtain a third mapping relationship between the example background information and the example question text, and the target question text corresponding to the target background information is determined based on the third mapping relationship.
[0053] That is to say, in the present application, the process of presetting a large language model to determine the target question text can be divided into two steps. First, the large language model is preset to learn the second mapping relationship between the example role setting information and the example background information, and the target background information corresponding to the target role setting information is determined based on the second mapping relationship, wherein the target background information includes the prior knowledge and background knowledge of the professional field corresponding to the target role setting information. For example, if the target role setting information indicates that the current role is a film critic, then the background knowledge may include some industry information related to the film industry and the professional knowledge required by film critics, and so on.
[0054] Then, the preset large language model learns the third mapping relationship between the example background information and the example question text, and determines the target question text corresponding to the target background information based on the third mapping relationship. That is to say, the preset large language model further determines the questions to be asked for the text to be analyzed based on the acquired target background information. In this way, the questions raised are more professional and targeted, and can be more in line with the current role settings.
[0055] Among them, when the large language model is preset to determine the target background information or the target question text, it can be obtained by searching in network resources or own knowledge, and this application does not limit this.
[0056] In this way, the process of generating the target question text by the preset large language model is divided into two steps, so that as much target background information as possible can be obtained before generating the target question text, making the generated target question text more reasonable.
[0057] In step S13, the text to be analyzed is obtained, and a question is asked to the text to be analyzed based on the target question text through a preset large language model to obtain a target answer text corresponding to the target question text.
[0058] In this step, after determining the target question text, the preset large language model can ask questions to the text to be analyzed based on the target question text, and obtain the target answer text corresponding to the target question text by analyzing the text to be analyzed.
[0059] Among them, the text to be analyzed is usually a complex and long text. In this case, it is difficult to input the entire text to be analyzed into the preset large language model. The text to be analyzed can be compressed and encoded to generate a text vector library corresponding to the text to be analyzed, so as to reduce the amount of data that needs to be input into the preset large language model. For example, the text can be encoded using a text embedding model to obtain a text vector library, or the corresponding text vector library can be obtained by calling an external application interface that can compress and encode the text to be analyzed. This application does not specifically limit this.
[0060] Furthermore, after the establishment of the text vector library is completed, the problem of the preset large language model obtaining the text to be analyzed can be converted into the preset large language model's access to the text vector library, and the preset large language model is provided with an access interface or access address to the text vector library. Then, the preset large language model can access the text vector library and search in the text vector library based on the target question text to realize the questioning of the text to be analyzed. For example, the preset large language model can realize the search in the text vector library by calling the question matching interface based on the text vector library, the integration and answer interface of related content, etc.
[0061] In this way, we can get rid of the dilemma that the preset large language model cannot quickly and cost-effectively inject a large amount of vertical information and is limited by the context window when applied, so that the preset large language model can analyze and answer the complex and long text to be analyzed.
[0062] Specifically, a large language model is preset as the answerer, and the callable action space (Action Space) includes not only the API (Application Programming Interface) that can be called by third parties, such as search engine interfaces, but also the reasoning interfaces of various self-developed small models.
[0063] Moreover, the process of obtaining the target answer text by presetting the large language model can also be guided by the prompt word paradigm, understanding the question based on the question and answer history of the questioner and the answerer, and choosing the way to answer the question. For example, the answer can be given by using the world knowledge accumulated during the pre-training of the large language model, or by calling the interface based on the understanding of the interface description in the Action Space.
[0064] For example, if the target question text requires a large language model to understand the plot of a certain script, then the search engine can be used to obtain the plot of the script.
[0065] In one implementation, a preset large language model asks questions to the text to be analyzed based on the target question text to obtain a target answer text corresponding to the target question text, including:
[0066] Acquire third sample data; the third sample data includes sample question text and sample answer text;
[0067] The target question text, the text to be analyzed and the third example data are input into a preset large language model for context learning to obtain a fourth mapping relationship between the example question text and the example answer text, and questions are asked to the text to be analyzed according to the target question text, and the target answer text is obtained based on the fourth mapping relationship.
[0068] That is to say, in the process of asking questions to the text to be analyzed based on the target question text and obtaining the target answer text corresponding to the target question text, the preset large language model can adopt a few-shot learning method by obtaining the third example data, learning the logical relationship implied in the third example data, and deriving the answer corresponding to the target question text according to the text to be analyzed.
[0069] The third example data includes an example question text and an example answer text, so that the preset large language model can learn the fourth mapping relationship between the example question text and the example answer text, and then, when processing the text to be analyzed, generate a target answer text corresponding to the target question text based on the fourth mapping relationship. It can be understood that as the quantity and quality of the third example data increase, the fourth mapping relationship will become more and more accurate, and the preset large language model will answer the target question text according to the text to be analyzed, and the quality of the target answer text will also be improved.
[0070] In step S14, the target question text and the corresponding target answer text are evaluated to obtain a target evaluation result.
[0071] Usually, the analysis of complex and long texts is not a simple logical or mathematical problem. It does not have a "standard answer" in the traditional sense, and it focuses more on the analysis process rather than just the final result. In this case, in this step, an evaluation mechanism is established for the above-mentioned target question text and target answer text, and the target evaluation results can be obtained from multiple aspects and angles.
[0072] It can be understood that the target answer text is obtained by the preset large language model answering the target question text based on the text to be analyzed. Then, if the text to be analyzed is of relatively high quality, the preset large language model can obtain a better target answer text, and then the target evaluation results of the target question text and the corresponding target answer text will also be better, and vice versa.
[0073] For example, if the text to be analyzed is a script, and the target question text is asking about the plot summary of the script, then the better the quality of the script, the richer the content of the plot summary and the more complete the plot elements in the target answer text. The target question text and the corresponding target answer text are evaluated. The target question text can respond well to the target answer text, so the target evaluation result is also better.
[0074] Therefore, by evaluating the target question text and the target answer text based on the target evaluation results output by the preset large language model, the quality of the text to be analyzed can be reflected.
[0075] In one implementation, the target question text and the corresponding target answer text are evaluated to obtain a target evaluation result, including:
[0076] Acquire fourth example data; the fourth example data includes an example question text, an example answer text, and an example evaluation result;
[0077] The target question text, target answer text and the fourth example data are input into the preset large language model for context learning to obtain a fifth mapping relationship between the example question text, the example answer text and the example evaluation result; the target question text and the target answer text are evaluated based on the fifth mapping relationship to obtain a target evaluation result.
[0078] That is to say, in the present application, the evaluation of the target question text and the target answer text can be achieved by a preset large language model, wherein the preset large language model can also adopt a small amount of target learning method in the process of evaluating the target question text and the target answer text to obtain the target evaluation result, by obtaining the fourth example data and learning how to evaluate the target question text and the target answer text according to the logical relationship implied in the fourth example data.
[0079] The fourth example data includes an example question text, an example answer text, and an example evaluation result, so that the preset large language model can learn the fifth mapping relationship between the example question text, the example answer text, and the example evaluation result, and then, in the subsequent answer evaluation process, the target question text and the target answer text can be evaluated based on the fifth mapping relationship to generate the corresponding target evaluation result. It can be understood that as the quantity and quality of the fourth example data increase, the fifth mapping relationship will become more and more accurate, and the answer evaluation based on the preset large language model will become more and more accurate.
[0080] In addition, the present application may also use other methods, models or interfaces to evaluate the target question text and the target answer text, and the present application is not limited to this.
[0081] In step S15, when the target evaluation result meets the preset evaluation qualification conditions, the sample data is updated according to the target role setting information and the target question text.
[0082] In this step, if the target evaluation result of the evaluation phase meets the preset evaluation qualification conditions, it can be considered that the self-questioning and answering process of the preset large language model is in line with expectations and can provide an example for subsequent self-questioning and answering processes. Therefore, the sample data can be updated according to the target role setting information and the target question text.
[0083] In one implementation, the target evaluation result includes a target evaluation score. When the target evaluation result meets the preset evaluation qualification condition, the sample data is updated according to the target role setting information and the target question text, including:
[0084] When the target evaluation score is greater than the preset threshold, the sample data is updated according to the target role setting information and the target question text.
[0085] Among them, the target evaluation score can intuitively represent the performance of the target question text and the target answer text in the evaluation process. The higher the target evaluation score, the better the performance of the target question text and the target answer text, and vice versa. Therefore, threshold filtering can be performed based on the comparison between the target evaluation score and the preset threshold. If the target evaluation score is greater than the preset threshold, it means that the target evaluation result meets the preset evaluation qualification conditions. Then, only the target role setting information and target question text whose target evaluation score is greater than the preset threshold will be used as new sample data.
[0086] Alternatively, the target evaluation result may also include a target evaluation text, that is, the target question text and the target answer text are evaluated through a paragraph of text. In the present application, the target evaluation text may also be analyzed by a text analysis model to determine whether the target evaluation result meets the preset evaluation qualification conditions. In addition, the target evaluation text may also be combined with the target evaluation score to determine whether the target evaluation result meets the preset evaluation qualification conditions, thereby more accurately finding the target role setting information and target question text that meet the user's expectations as example data.
[0087] In addition, the above process of determining whether the target evaluation result meets the preset evaluation qualification conditions can also be implemented manually, so that the labor cost is also transformed from manual writing to manual selection. This application does not make any specific limitations on this.
[0088] In one implementation, the sample data includes first sample data and second sample data. Then, when the target evaluation result meets the preset evaluation qualification condition, the sample data is updated according to the target role setting information and the target question text, including:
[0089] When the target evaluation result meets the preset evaluation qualification conditions, the first example data is updated according to the target role setting information and the target background information; the second example data is updated according to the target background information and the target question text.
[0090] That is to say, in the present application, if the process of determining the target question text by the preset large language model refers to the first example data and the second example data respectively, first, the preset large language model determines the target background information corresponding to the target role setting information based on the first example data, and then, based on the acquired target background information and the second example data, further determines the question to be asked for the text to be analyzed to obtain the target question text. Then, when the target evaluation result meets the preset evaluation qualification conditions, the input data and output data of the preset large language model in the two links of determining the target background information and determining the target question text, that is, the target role setting information and the target background information, as well as the target background information and the target question text, can be obtained respectively, and the first example data and the second example data can be updated respectively.
[0091] In this way, in the subsequent calling process of the preset large language model, the steps of generating target background information and target question text can refer to the updated first example data and second example data. As the first example data and the second example data are continuously updated, the quality of the generated target background information and target question text will continue to improve, making the processing effect of the preset large language model better and better.
[0092] In one implementation, if the target question text, the text to be analyzed, and the third example data are input into a preset large language model for context learning, a fourth mapping relationship between the example question text and the example answer text is obtained, and a question is asked to the target text to be analyzed according to the target question text, and a target answer text is obtained based on the fourth mapping relationship, then, if the target evaluation result meets the preset evaluation qualification condition, the example data augmentation method further includes:
[0093] The third example data is updated according to the target question text, the text to be analyzed and the target answer text.
[0094] That is to say, in the present application, if the preset large language model learns how to obtain the answer corresponding to the target question text based on the text to be analyzed according to the fourth mapping relationship between the example question text and the example answer text by acquiring the third example data, then, when the target evaluation result meets the preset evaluation qualification conditions, the input data and output data of the preset large language model in the question answering link, that is, the target question text, the text to be analyzed and the target answer text, can also be obtained to update the third example data.
[0095] In this way, in the subsequent calling process of the preset large language model, the step of generating the target answer text can refer to the updated third example data. As the third example data is continuously updated, the quality of the generated target answer text will continue to improve, making the processing effect of the preset large language model better and better.
[0096] In one implementation, if the target question text, the target answer text and the fourth example data are input into a preset large language model for context learning, a fifth mapping relationship between the example question text, the example answer text and the example evaluation result is obtained, and the target question text and the target answer text are evaluated based on the fifth mapping relationship to obtain a target evaluation result, then, if the target evaluation result meets the preset evaluation qualification condition, the example data augmentation method further includes:
[0097] The fourth example data is updated according to the target question text, the target answer text and the target evaluation result.
[0098] That is to say, in the present application, if the preset large language model evaluates the target question text and the target answer text based on the fifth mapping relationship between the example question text and the example answer text and the example evaluation text and the example evaluation score, and obtains the target evaluation result, then, if the target evaluation result meets the preset evaluation qualification conditions, the input data and output data of the preset large language model in the evaluation and answering link, that is, the target question text, the target answer text and the target evaluation result, can also be obtained to update the fourth example data.
[0099] In this way, in the subsequent calling process of the preset large language model, the answer evaluation process of the preset large language model can refer to the updated fourth example data. As the fourth example data is continuously updated, the answer evaluation effect of the preset large language model will continue to improve, making the processing effect of the preset large language model better and better.
[0100] In one implementation, obtaining target role setting information and sample data includes:
[0101] Obtain target role setting information; determine the current task based on the target role setting information, and obtain candidate example data corresponding to the current task; select candidate example data that matches the context window length of the preset large language model as example data.
[0102] The context window length that matches the preset large language model refers to the maximum length of input data that the preset large language model can receive. If the length of the input data exceeds the context window length, the preset large language model will not be able to process the input data. In this embodiment, the target role setting information is the data required for the preset large language model to generate the target question text. Therefore, the length of the input data can be limited by screening the sample data.
[0103] That is to say, as the amount of example data increases, some optimization strategies can be added. For example, when the number of candidate example data has reached the context window limit, some of them can be screened as example data. For example, the screening can be based on the chronological order of the generation of the example data or the text length of the example data, etc. This application does not limit this.
[0104] In this way, when there is a large amount of example data, a part of it can be selected according to different application scenarios, thereby reducing the computing resources required for calculation without affecting the processing accuracy of the preset large language model.
[0105] In one implementation, selecting candidate example data that matches a context window length of a preset large language model as example data includes:
[0106] According to the order of generation time of the candidate example data from back to front, the candidate example data that matches the context window length of the large language model is determined as the example data.
[0107] That is to say, N candidate example data that can meet the window can be selected as example data in the order in which the example data are generated, starting from the most recent generation. In this way, the example data input into the preset large language model is the most recent generation, and the most recent generation of the example data refers to the past example data during the generation process, and the presentation effect is better. Therefore, the screened example data is also more representative, which can further improve the subsequent processing effect.
[0108] In addition, in one implementation, when the target evaluation result does not meet the preset evaluation qualification condition, the method further includes:
[0109] Obtain the importance of the text to be analyzed; when the importance of the text to be analyzed meets a preset importance condition, and / or the number of example data is less than a preset number, return to the step of learning a first mapping relationship between example role setting information and example question text through a preset large language model, and determining a target question text corresponding to the target role setting information based on the first mapping relationship.
[0110] That is to say, if the target evaluation result does not meet the preset evaluation qualification conditions, it can be determined whether the text to be analyzed can be directly abandoned or needs to be retried based on the importance of the text to be analyzed and the number of existing sample data.
[0111] Among them, for some texts to be analyzed whose importance does not meet the preset importance conditions, there is no need to retry and just give up. For some texts to be analyzed whose importance meets the preset importance conditions, you can return to the step of learning the first mapping relationship between the example role setting information and the example question text through the preset large language model, regenerate a new target question text, and re-ask and evaluate the text to be analyzed. It can be understood that the output of the preset large language model is random, that is, when the same input data is input, the preset large language model may also obtain different output data, and its randomness is related to the temperature value of the preset large language model. The higher the temperature value, the stronger the randomness of the output data, and the lower the temperature value, the weaker the randomness of the output data. By setting the temperature value of the preset large language model, the preset large language model can maintain a balance between concentration and creativity. Its specific value can be set according to specific business scenarios or actual needs, and there is no specific limitation.
[0112] In this way, the more important part of the text to be analyzed can be processed in a targeted manner and added to the sample data as much as possible to avoid the omission of important data, thereby improving the processing efficiency of the preset large language model. The importance of the text to be processed can be manually input or determined by analyzing the importance of the text to be analyzed, and there is no specific limitation.
[0113] In addition, if the current amount of sample data is large, then the text to be analyzed does not need to be retried and can be skipped. If the current amount of sample data is small, it can be reanalyzed. In this way, different sample data expansion strategies can be adopted in different situations. When sample data is urgently needed, the expansion speed of sample data can be accelerated, thereby improving the processing efficiency of the preset large language model.
[0114] In the present application, determining whether to ask questions to the text to be analyzed again based on the text importance of the text to be analyzed, and determining whether to ask questions to the text to be analyzed again based on the number of example data can be performed simultaneously. For example, in some cases, as long as one of the items is met, the text to be analyzed can be asked questions again, while in other cases, both items need to be met before the text to be analyzed can be asked questions again. In addition, the execution of the two may also have a sequence, that is, only when one item is met, will it be determined whether the other item is met, and the text to be analyzed can be asked questions again only when both items are met, and so on. The present application does not make any specific limitations on this.
[0115] In one implementation, returning a first mapping relationship between example role setting information and example question text learned by a preset large language model includes:
[0116] Obtain the number of questions asked by the preset large language model based on the target question text to the text to be analyzed;
[0117] When the number of questions asked is less than the preset number, the process returns to the step of learning the first mapping relationship between the example role setting information and the example question text through the preset large language model.
[0118] That is to say, there is a certain limit on the number of times the text to be analyzed can be re-questioned. The text to be analyzed will be re-questioned only when the number of re-questions does not exceed the preset number. In this way, the waste of system resources caused by unlimited retries can be avoided.
[0119] The number of questions asked may be a fixed value input manually, or may be determined based on information such as the current system load, and this application does not impose any specific limitation on this.
[0120] In one implementation, when the number of questions asked is greater than or equal to a preset number, the data augmentation method of this example further includes:
[0121] The text to be analyzed is used as the waiting text, and a new text to be analyzed is obtained;
[0122] The method returns to the step of learning the first mapping relationship between the example role setting information and the example question text through the preset large language model, until the example data is updated according to the target role setting information and the target question text, and the waiting text is used as the new text to be analyzed, and returns to the step of learning the first mapping relationship between the example role setting information and the example question text through the preset large language model.
[0123] That is to say, if the number of times the question is re-asked exceeds the preset number of times, but the target evaluation result still cannot meet the preset evaluation qualification conditions, then the current text to be analyzed can be placed after other texts to be analyzed for analysis. It can be understood that after other texts to be analyzed are processed, the sample data may be expanded, and the processing capacity of the preset large language model will also be enhanced. Then, in this case, the current text to be analyzed can be re-analyzed, and the self-expanded sample data can be used as a reference. The evaluation result obtained may be better than before. Therefore, the current text to be analyzed can be fully utilized.
[0124] The example data augmentation method proposed in the embodiment of the present application can be applied to Figure 2 In the text analysis framework shown in Figure 2As shown, the following processes are performed in the text analysis framework: preset large language models (LLMs) role setting (set the role); prompt rendering (Prompt rendering), using the preset large language model (LLMs) to propose the target question text; using the preset large language model (LLMs) to answer the target question text and obtain the target answer text (Documents retrieval); target answer text selection and evaluation (Answer choice / evaluation); based on the expected multi-path feedback in the target question text proposal stage, the target question text answer stage, the target answer text selection and evaluation stage, multi-layer sample enhancement is performed in the target question text proposal stage, the target question text answer stage, the target answer text selection and evaluation stage to achieve the expansion of example data.
[0125] (1) Preset large language model role setting
[0126] The role of the preset large language model is set according to the type of text to be analyzed. The target role setting information is made known to the preset large language model through prompt rendering. For example, using OpenAI, the role of the preset large language model can be set through the initial system role.
[0127] For example, in engineering implementation, two class instances can be created, each of which uses the call of the preset large language model as its own usable method. Each instance has its own Prompt attribute, which sets the role of the preset large language model as the questioner and the answerer respectively.
[0128] (2) Propose the target question text
[0129] For the questioner, the Prompt paradigm is combined with the set role to enable the preset large language model to independently propose the target question text corresponding to the text to be analyzed. The guidance of the Prompt paradigm allows the preset large language model to think about which target question text should be proposed under the current role.
[0130] Optionally, the Prompt paradigm can be a chain thinking method such as COT; or it can be a more complex SA+SE method, which also displays the thinking process of why this role raises a certain target question text, and can also use search engines to assist in finding professional questions that can be used for text analysis in the professional field related to the role during the thinking process; it can also further use the ReAct method to further decompose the specific target question text, and ask single-hop or even recursive questions to the decomposed target question text to enhance the preset large language model's understanding of the target question text; of course, other methods can also be used to analyze the text to be analyzed in order to raise the target question text.
[0131] (3) Answer the target question text
[0132] As an answerer, you can build a tool library that can be used by the preset large language model, and use your own knowledge, network resources, and text vector library to answer questions in the target question text based on the question and answer context.
[0133] Define the action space that can be called by the respondent. In addition to the API (Application Program Interface) that can be called by the third party (such as the search engine interface, etc.), the reasoning interface of various models can also be registered in the Action Space.
[0134] Guided by the prompt paradigm, the target question text can be understood by the preset large language model based on the question and answer history of the questioner and the answerer, and the method of analyzing the target question text can be selected. The world knowledge accumulated during pre-training can be used to answer; or the interface call can be used to solve the problem based on the understanding of the interface description in the Action Space. For example, for the understanding of the plot, relevant information can be obtained with the help of search engines. For the analysis of complex and long texts, the problem matching based on the text vector library and the integration and answer of related content can be used to get rid of the dilemma that the preset large language model cannot quickly and cost-effectively inject a large amount of vertical information and the context window limitation during application.
[0135] By analyzing complex long texts, we can obtain the refined content of the text and build a text vector library based on the refined content of the text. The subsequent preset large language model can convert the target question text into a text vector library request, thereby obtaining an answer based on the text vector library.
[0136] (4) Target answer text selection and evaluation
[0137] Given that the analysis of complex and long texts is not a simple logical or mathematical problem, it usually does not have a "standard answer" in the traditional sense, and it focuses more on the analysis process rather than just the final result. Therefore, an evaluation mechanism can be established to answer the above questions and obtain the target evaluation results.
[0138] (5) Example data expansion
[0139] Then, if the result of the evaluation phase meets expectations, the data of the entire process of question raising, answering, and evaluation will be used as reflux samples to add back to the sample data to achieve sample reflux, so that the preset large language model can obtain better performance and further enhance the accuracy and stability of the process; if the evaluation result does not meet expectations, then based on the number of existing sample data and the importance of the text to be analyzed, it is determined whether the text to be analyzed can be skipped directly or retried. After the number of retries is met, if the expected result still cannot be obtained, the text will be placed after other texts for analysis, so as to use the text that can generate the expected result to self-expand the system example before trying again.
[0140] In this way, starting with fewer artificial examples, the system can gradually expand to a larger number of examples, producing more accurate results, and using more accurate results as examples, thus forming a positive feedback.
[0141] As can be seen from the above, the technical solution provided by the embodiment of the present application can determine the target question text according to the target role setting information through the learning of the example data by the preset large language model, and analyze the text to be analyzed according to the target question text to obtain the target answer text, wherein the example role setting information and the corresponding example question text are used as examples in the process of determining the target question text to improve the ability of the preset large language model to ask and answer questions for the text to be analyzed. Furthermore, after evaluating the target question text and the corresponding target answer text output by the preset large language model, if the target evaluation result meets the preset evaluation qualification conditions, then it indicates that the content of the text to be analyzed meets the requirements, and the preset large language model can reasonably analyze the text to be analyzed and obtain answers that meet the requirements. Therefore, based on the input and output of the preset large language model in the self-questioning and self-answering process, the example data can be updated. When the system process starts again, the target role setting information and target question text in this process are added to the sample data used by the preset large language model. Moreover, since the target role setting information and target question text newly added to the sample data are accumulated in this system process, their format and content meet the requirements of each link of the preset large language model, thereby achieving high quality and consistency of the sample data. In other words, the system can automatically expand a large amount of excellent sample data to reduce the manpower and time costs of obtaining sample data, while improving the availability of sample data, which is beneficial to the text analysis effect of the preset large language model.
[0142] The example data augmentation method provided in the embodiment of the present application may be executed by an example data augmentation device. In the embodiment of the present application, the example data augmentation device performs the example data augmentation method as an example to illustrate the device of the example data augmentation method provided in the embodiment of the present application.
[0143] Figure 3 is a block diagram of an exemplary data augmentation device according to an exemplary embodiment, the device comprising:
[0144] The acquisition module 201 is used to acquire target role setting information and sample data; the target role setting information is used to set the identity of the preset large language model, and the sample data includes sample role setting information and corresponding sample question text, and the sample question text is a text for asking questions based on the sample role setting information;
[0145] A generating module 202 is used to learn a first mapping relationship between the example role setting information and the example question text through the preset large language model, and determine a target question text corresponding to the target role setting information based on the first mapping relationship;
[0146] The analysis module 203 is used to obtain the text to be analyzed, and to ask questions to the text to be analyzed based on the target question text through the preset large language model to obtain a target answer text corresponding to the target question text;
[0147] An evaluation module 204 is used to evaluate the target question text and the corresponding target answer text to obtain a target evaluation result;
[0148] The updating module 205 is used to update the example data according to the target role setting information and the target question text when the target evaluation result meets the preset evaluation qualification condition.
[0149] As can be seen from the above, the technical solution provided by the embodiment of the present application can determine the target question text according to the target role setting information through the learning of the example data by the preset large language model, and analyze the text to be analyzed according to the target question text to obtain the target answer text, wherein the example role setting information and the corresponding example question text are used as examples in the process of determining the target question text to improve the ability of the preset large language model to ask and answer questions for the text to be analyzed. Furthermore, after evaluating the target question text and the corresponding target answer text output by the preset large language model, if the target evaluation result meets the preset evaluation qualification conditions, then it indicates that the content of the text to be analyzed meets the requirements, and the preset large language model can reasonably analyze the text to be analyzed and obtain answers that meet the requirements. Therefore, based on the input and output of the preset large language model in the self-questioning and self-answering process, the example data can be updated. When the system process starts again, the target role setting information and target question text in this process are added to the sample data used by the preset large language model. Moreover, since the target role setting information and target question text newly added to the sample data are accumulated in this system process, their format and content meet the requirements of each link of the preset large language model, thereby achieving high quality and consistency of the sample data. In other words, the system can automatically expand a large amount of excellent sample data to reduce the manpower and time costs of obtaining sample data, while improving the availability of sample data, which is beneficial to the text analysis effect of the preset large language model.
[0150] Figure 4 It is a block diagram of an electronic device for example data augmentation according to an exemplary embodiment, including a processor and a memory, wherein the memory is used to store computer programs; and the processor is used to execute the programs stored in the memory.
[0151] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0152] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0153] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor of an electronic device to perform the above method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0154] In an exemplary embodiment, a computer program product is also provided. When the computer program product is executed on a computer, the computer implements the above-mentioned method for augmenting comment example data.
[0155] As can be seen from the above, the technical solution provided by the embodiment of the embodiment of the present invention can determine the target question text according to the target role setting information through the learning of the example data by the preset large language model, and analyze the text to be analyzed according to the target question text to obtain the target answer text, wherein the example role setting information and the corresponding example question text are used as examples in the process of determining the target question text to improve the ability of the preset large language model to ask and answer questions for the text to be analyzed. Furthermore, after evaluating the target question text and the corresponding target answer text output by the preset large language model, if the target evaluation result meets the preset evaluation qualification condition, then it indicates that the content of the text to be analyzed meets the requirements, and the preset large language model can reasonably analyze the text to be analyzed and obtain an answer that meets the requirements. Therefore, based on the input and output of the preset large language model in the self-questioning and self-answering process, the example data can be updated. When the system process starts again, the target role setting information and target question text in this process are added to the sample data used by the preset large language model. Moreover, since the target role setting information and target question text newly added to the sample data are accumulated in this system process, their format and content meet the requirements of each link of the preset large language model, thereby achieving high quality and consistency of the sample data. In other words, the system can automatically expand a large amount of excellent sample data to reduce the manpower and time costs of obtaining sample data, while improving the availability of sample data, which is beneficial to the text analysis effect of the preset large language model.
[0156] Figure 5 It is a block diagram of a device 800 for example data augmentation according to an exemplary embodiment.
[0157] For example, apparatus 800 may be a mobile phone, a computer, a digital broadcast electronic device, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0158] Reference Figure 5 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0159] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0160] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0161] The power supply component 807 provides power to the various components of the device 800. The power supply component 807 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0162] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data to be processed. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0163] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0164] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0165] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0166] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0167] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the methods described in the first and second aspects.
[0168] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to complete the above method. Optionally, for example, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0169] In an exemplary embodiment, a computer program product including instructions is also provided. When the computer program product is run on a computer, the computer is enabled to perform the exemplary data augmentation method described in any one of the above embodiments.
[0170] As can be seen from the above, the technical solution provided by the embodiment of the present application can determine the target question text according to the target role setting information through the learning of the example data by the preset large language model, and analyze the text to be analyzed according to the target question text to obtain the target answer text, wherein the example role setting information and the corresponding example question text are used as examples in the process of determining the target question text to improve the ability of the preset large language model to ask and answer questions for the text to be analyzed. Furthermore, after evaluating the target question text and the corresponding target answer text output by the preset large language model, if the target evaluation result meets the preset evaluation qualification conditions, then it indicates that the content of the text to be analyzed meets the requirements, and the preset large language model can reasonably analyze the text to be analyzed and obtain answers that meet the requirements. Therefore, based on the input and output of the preset large language model in the self-questioning and self-answering process, the example data can be updated. When the system process starts again, the target role setting information and target question text in this process are added to the sample data used by the preset large language model. Moreover, since the target role setting information and target question text newly added to the sample data are accumulated in this system process, their format and content meet the requirements of each link of the preset large language model, thereby achieving high quality and consistency of the sample data. In other words, the system can automatically expand a large amount of excellent sample data to reduce the manpower and time costs of obtaining sample data, while improving the availability of sample data, which is beneficial to the text analysis effect of the preset large language model.
[0171] Those skilled in the art will readily appreciate other implementations of the embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The embodiments of the present invention are intended to cover any variations, uses, or adaptations of the embodiments of the present invention that follow the general principles of the embodiments of the present invention and include common knowledge or customary technical means in the art that are not disclosed in the embodiments of the present invention. The specification and embodiments are to be regarded as exemplary only, and the true scope and spirit of the embodiments of the present invention are indicated by the following claims.
[0172] It should be understood that the embodiments of the present invention are not limited to the precise structures described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the embodiments of the present invention is limited only by the appended claims.
Claims
1. An example data augmentation method, characterized in that: include: Obtain target role setting information and sample data; the target role setting information is used to set the identity of a preset large language model, the sample data includes sample role setting information and corresponding sample question text, and the sample question text is a text for asking questions based on the sample role setting information; Learning a first mapping relationship between the example role setting information and the example question text through the preset large language model, and determining a target question text corresponding to the target role setting information based on the first mapping relationship; Acquire a text to be analyzed, and ask a question to the text to be analyzed based on the target question text through the preset large language model to obtain a target answer text corresponding to the target question text; Evaluate the target question text and the corresponding target answer text to obtain a target evaluation result; When the target evaluation result meets the preset evaluation qualification condition, the example data is updated according to the target role setting information and the target question text.
2. The example data augmentation method according to claim 1, characterized in that: The example data includes first example data and second example data, the first example data includes example role setting information and corresponding example background information, and the second example data includes the example background information and corresponding example question text; The step of learning a first mapping relationship between the example role setting information and the example question text by using the preset large language model, and determining a target question text corresponding to the target role setting information based on the first mapping relationship, includes: Inputting the target role setting information and the first example data into a preset large language model for context learning to obtain a second mapping relationship between the example role setting information and the example background information, and determining the target background information corresponding to the target role setting information based on the second mapping relationship; The target background information and the second example data are input into the preset large language model for context learning to obtain a third mapping relationship between the example background information and the example question text, and the target question text corresponding to the target background information is determined based on the third mapping relationship.
3. The example data augmentation method according to claim 2, characterized in that: When the target evaluation result meets the preset evaluation qualification condition, the example data is updated according to the target role setting information and the target question text, including: When the target evaluation result meets the preset evaluation qualification condition, the first example data is updated according to the target role setting information and the target background information; The second example data is updated according to the target background information and the target question text.
4. The example data augmentation method according to claim 1, characterized in that: The step of asking a question to the text to be analyzed based on the target question text by using the preset large language model to obtain a target answer text corresponding to the target question text includes: Acquire third sample data; the third sample data includes sample question text and sample answer text; The target question text, the text to be analyzed and the third example data are input into the preset large language model for context learning to obtain a fourth mapping relationship between the example question text and the example answer text, and questions are asked to the target text to be analyzed according to the target question text, and a target answer text is obtained based on the fourth mapping relationship.
5. The example data augmentation method according to claim 4, characterized in that: When the target evaluation result meets the preset evaluation qualification condition, the method further includes: The third example data is updated according to the target question text, the text to be analyzed and the target answer text.
6. The example data augmentation method according to claim 1, characterized in that: The step of evaluating the target question text and the corresponding target answer text to obtain a target evaluation result includes: Acquire fourth example data; the fourth example data includes an example question text, an example answer text, and an example evaluation result; The target question text, the target answer text and the fourth example data are input into the preset large language model for context learning to obtain a fifth mapping relationship between the example question text, the example answer text and the example evaluation result; the target question text and the target answer text are evaluated based on the fifth mapping relationship to obtain a target evaluation result.
7. The example data augmentation method according to claim 6, characterized in that: When the target evaluation result meets the preset evaluation qualification condition, the method further includes: The fourth example data is updated according to the target question text, the target answer text and the target evaluation result.
8. The example data augmentation method according to claim 1, characterized in that: The target evaluation result includes a target evaluation score. When the target evaluation result meets a preset evaluation qualification condition, the example data is updated according to the target role setting information and the target question text, including: When the target evaluation score is greater than a preset threshold, the example data is updated according to the target role setting information and the target question text.
9. The example data augmentation method according to claim 1, characterized in that: In the case where the target evaluation result does not meet the preset evaluation qualification condition, the method further includes: Obtaining the importance of the text to be analyzed; When the importance of the text to be analyzed meets a preset importance condition, and / or the amount of the example data is less than a preset amount, return to the step of learning the first mapping relationship between the example role setting information and the example question text through the preset large language model, and determine the target question text corresponding to the target role setting information based on the first mapping relationship.
10. The example data augmentation method according to claim 9, characterized in that: The returning the first mapping relationship between the example role setting information and the example question text learned by the preset large language model includes: Obtaining the number of questions asked by the preset large language model to the text to be analyzed based on the target question text; When the number of questions asked is less than the preset number, the step of returning to the step of learning the first mapping relationship between the example role setting information and the example question text by using the preset large language model is performed.
11. The example data augmentation method according to claim 10, characterized in that: When the number of questions is greater than or equal to the preset number, the method further includes: Using the text to be analyzed as waiting text, and obtaining new text to be analyzed; Return to the step of learning the first mapping relationship between the example role setting information and the example question text through the preset large language model, until the example data is updated according to the target role setting information and the target question text, and then use the waiting text as the new text to be analyzed, and return to the step of learning the first mapping relationship between the example role setting information and the example question text through the preset large language model.
12. The example data augmentation method according to claim 1, characterized in that: The step of obtaining target role setting information and sample data includes: Get the target role setting information; Based on the target role setting information, determine the current task, and obtain candidate example data corresponding to the current task; The candidate example data that matches the context window length of the preset large language model is selected as the example data.
13. The example data augmentation method according to claim 12, characterized in that: The selecting the candidate example data matching the context window length of the preset large language model as the example data includes: According to the order of generation time of the candidate example data from back to front, the candidate example data matching the context window length of the preset large language model is determined as the example data.
14. An exemplary data augmentation device, characterized in that: include: An acquisition module is used to acquire target role setting information and sample data; the target role setting information is used to perform identity setting for a preset large language model, the sample data includes sample role setting information and corresponding sample question text, and the sample question text is a text for asking questions based on the sample role setting information; A generating module, configured to learn a first mapping relationship between the example role setting information and the example question text through the preset large language model, and determine a target question text corresponding to the target role setting information based on the first mapping relationship; An analysis module is used to obtain a text to be analyzed, and to ask a question to the text to be analyzed based on the target question text through the preset large language model to obtain a target answer text corresponding to the target question text; An evaluation module, used to evaluate the target question text and the corresponding target answer text to obtain a target evaluation result; An updating module is used to update the example data according to the target role setting information and the target question text when the target evaluation result meets the preset evaluation qualification condition.
15. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the example data augmentation method as described in any one of claims 1 to 13 are implemented.
16. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the image processing method according to any one of claims 1 to 13.
17. A computer program product, characterized in that The program product is stored in a storage medium, and the program product is executed by at least one processor to implement the exemplary data augmentation method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Dialogue generation and corpus expansion method and device, computer equipment and storage medium
CN111061847A
Knowledge base construction method and question and answer dialogue method and system based on generative large language model
CN117056471A
Problem generation method and device based on context information, equipment and medium
CN118152529A
Corpus Augmentation System
US20160196334A1
Cited By
Device for controlling results of model questions and answers through role definition
CN120804273A
