Example data augmentation methods, apparatuses, devices, and media
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING QIYI CENTURY SCI & TECH CO LTD
- Filing Date
- 2024-07-26
- Publication Date
- 2026-08-07
AI Technical Summary
[0006]本申请实施例的目的是提供一种示例数据扩增方法、装置、设备和存储介质,能够解决现有技术中,获取示例数据的人力成本及时间成本较高,且示例数据的可用性较低等问题
[0024]这样,通过预设大语言模型对示例数据的学习,可以根据目标角色设定信息确定目标问题文本,并根据目标问题文本对待分析文本进行分析,得到目标回答文本,其中,确定目标问题文本的过程中会以示例角色设定信息及对应的示例问题文本为示例,以提高预设大语言模型对待分析文本进行自问自答的能力。进一步地,在对预设大语言模型输出的目标问题文本及对应的目标回答文本进行评估之后,如果目标评估结果满足预设评估合格条件,那么,表明待分析文本的内容符合需求,并且预设大语言模型可以对待分析文本进行合理的分析,得到符合需求的回答,因此,基于自问自答过程中预设大语言模型的输入及输出,可以对示例数据进行更新。当系统流程再次开始时,预设大语言模型所使用的示例数据中就增加了本次流程中目标角色设定信息及目标问题文本,而且,由于新增至示例数据中的目标角色设定信息及目标问题文本是在本次系统流程中积累下的,因此其格式及内容都符合预设大语言模型各环节的要求,从而可以达到示例数据的告高质量及一致性,也就是说,系统可以自动扩张出大量优秀的示例数据,以减少获取示例数据的人力成本及时间成本,同时提高示例数据的可用性,进而有利于预设大语言模型的文本分析效果。
Smart Images

Figure CN119066416B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to an example data augmentation method, apparatus, electronic device, and storage medium. Background Technology
[0002] Large Language Models (LLMs) are natural language processing models based on deep learning. They have a strong ability to answer single-hop reasoning questions. They learn the statistical regularities and semantic representations of language by pre-training on a large amount of text data, thereby understanding and generating text in subsequent tasks.
[0003] Applying LLM models to the analysis of complex long texts enables tasks such as deconstructing, analyzing, and evaluating works like plots, scripts, and literature. In this case, LLM models are needed to solve more multi-dimensional and complex problems. However, current LLM models are not yet mature in solving multi-hop problems with coupling relationships, making it difficult to decouple a series of complex issues. This results in significant shortcomings in the ability of LLM models to analyze and decompose complex long texts.
[0004] In existing technologies, the potential capabilities of LLM models can be maximized by optimizing the prompt words, enabling them to decouple from complex problems. For example, example data can be added to the prompt words input to the LLM model. This example data provides paradigms for the current task of the LLM model, allowing it to generate the output text for the current task based on the prompts provided.
[0005] However, sample data often requires manual screening. On the one hand, sample data from different fields requires screening by practitioners with different background knowledge and experience. During the screening process, the data of each processing stage of the LLMs model needs to be analyzed and evaluated, including a large amount of complex text data, which results in high time and manpower costs. On the other hand, the screening of sample data by the same person is often highly subjective, and it is difficult to unify the standards for writing samples by different people, resulting in low usability of sample data. Summary of the Invention
[0006] The purpose of this application is to provide a method, apparatus, device, and storage medium for augmenting example data, which can solve the problems in the prior art, such as high human and time costs for obtaining example data and low availability of example data.
[0007] In a first aspect, embodiments of this application provide an example 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 the preset large language model, and the sample data includes sample role setting information and corresponding sample question text, wherein the sample question text is the text of asking a question based on the sample role setting information;
[0009] The preset large language model learns the first mapping relationship between the example character setting information and the example question text, and generates the target question text corresponding to the target character setting information based on the first mapping relationship;
[0010] The text to be analyzed is obtained, and a question is asked on the text based on the target question text using the preset large language model to obtain the target answer text corresponding to the target question text.
[0011] The target question text and the corresponding target answer text are evaluated to obtain the target evaluation result;
[0012] If the target evaluation result meets the preset evaluation qualification conditions, the example data is updated according to the target role setting information and the target question text.
[0013] Secondly, embodiments of this application provide an example data augmentation apparatus, characterized in that it includes:
[0014] The acquisition module 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, wherein the sample question text is the text of asking a question based on the sample role setting information;
[0015] The generation module is used to learn the first mapping relationship between the example character setting information and the example question text through the preset large language model, and to determine the target question text corresponding to the target character setting information based on the first mapping relationship;
[0016] The analysis module is used to acquire the text to be analyzed, and to ask questions about the text to be analyzed based on the target question text using the preset large language model, so as to obtain the target answer text corresponding to the target question text;
[0017] The evaluation module is used to evaluate the target question text and the corresponding target answer text to obtain the evaluation text and the corresponding target evaluation result;
[0018] The update module is used to update the example data according to the target role setting information and the target problem text when the target evaluation result meets the preset evaluation qualification conditions.
[0019] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing programs or instructions executable on the processor, the programs or instructions, when executed by the processor, implementing the steps of the method described in the first aspect.
[0020] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0021] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.
[0022] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which 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 set the identity of a preset large language model. The example data includes example role setting information and corresponding example question text, which is the text of a question asked 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 the preset large language model, and the target question text corresponding to the target role setting information is determined based on the first mapping relationship. The text to be analyzed is obtained, and a question is asked based on the target question text using the preset large language model to obtain the target answer text corresponding to the target question text. The target question text and the corresponding target answer text are evaluated to obtain the target evaluation result. If the target evaluation result meets the preset evaluation qualification conditions, the example data is updated according to the target role setting information and the target question text.
[0024] In this way, by learning from the example data through a pre-set large language model, the target question text can be determined based on the target role setting information. Then, the text to be analyzed is analyzed based on the target question text to obtain the target answer text. During the determination of the target question text, example role setting information and corresponding example question texts are used as examples to improve the pre-set large language model's ability to self-answer the text to be analyzed. Furthermore, after evaluating the target question text and corresponding target answer text output by the pre-set large language model, if the evaluation result meets the pre-set evaluation qualification conditions, it indicates that the content of the text to be analyzed meets the requirements, and the pre-set large language model can perform reasonable analysis of the text to be analyzed to obtain a satisfactory answer. Therefore, based on the input and output of the pre-set large language model during the self-answering process, the example data can be updated. When the system process restarts, the sample data used by the preset large language model is supplemented with the target role setting information and target question text from this process. Moreover, since the target role setting information and target question text added to the sample data are accumulated during this system process, their format and content meet the requirements of each stage of the preset large language model. This ensures high quality and consistency of the sample data. In other words, the system can automatically expand to generate a large amount of excellent sample data, reducing the manpower and time costs of acquiring sample data, while improving the usability of sample data, which in turn benefits the text analysis effect of the preset large language model. Attached Figure Description
[0025] Figure 1 This is a flowchart illustrating an example data augmentation method according to an exemplary embodiment;
[0026] Figure 2 This is a schematic diagram illustrating a text analysis framework according to an exemplary embodiment;
[0027] Figure 3 This is a block diagram illustrating an example data augmentation apparatus according to an exemplary embodiment;
[0028] Figure 4 This is a block diagram illustrating an example data augmentation electronic device for a base station according to an exemplary embodiment;
[0029] Figure 5 This is a block diagram illustrating an apparatus for example data augmentation according to an exemplary embodiment. Detailed Implementation
[0030] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0031] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0032] The example data amplification method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0033] Typically, LLM models can be used for complex, long text analysis to deconstruct, analyze, and evaluate works such as plots, scripts, and literature. Specifically, this can be achieved by optimizing the prompts. For example, sample data can be added to the prompts input to the LLM model. This sample data provides examples for the current task of the LLM model, enabling it to generate the output text for the current task based on the prompts from the sample data.
[0034] For example, if an LLM model is used to analyze the plot of a script, the example data can include some example scripts and information such as plot summaries, main characters, time, and location of these example scripts. In this way, by learning the context of the example data and the script to be analyzed, the LLM model can analyze the plot summary, main characters, time, and location of the script to be analyzed according to the mapping relationship between the example scripts and their corresponding plot summaries, main characters, time, and location information.
[0035] However, sample data often requires manual screening. On the one hand, sample data from different fields requires screening by practitioners with different background knowledge and experience. During the screening process, the data of each processing stage of the LLMs model needs to be analyzed and evaluated, including a large amount of complex text data, which results in high time and manpower costs. On the other hand, the screening of sample data by the same person is often highly subjective, and it is difficult to unify the standards for writing samples by different people, resulting in low usability of sample data.
[0036] Based on this, an example data augmentation method is proposed in this application to solve the above problems. Specifically, this application can be applied to a server, a local server, or other servers on a network.
[0037] The aforementioned servers can be server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0038] Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Based on the cloud computing business model, cloud technology encompasses network technology, information technology, integration technology, management platform technology, and application technology. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can only be achieved through cloud computing.
[0039] Figure 1 This is a flowchart illustrating an example data augmentation method according to an exemplary embodiment, the example data augmentation method including 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. The sample question text is the text of asking questions based on the sample role setting information.
[0041] In this step, the target role setting information and sample data are first obtained. The sample data includes sample role setting information and corresponding sample question text. The target role setting information is used to define 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, teacher, or student, etc. Depending on the 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 of 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 the preset large language model needs to output. Then, after obtaining the input data A' through context learning, the preset large language model can obtain the output data B' corresponding to A' based on the mapping relationship between A and B.
[0043] In this step, the example data includes example role setting information and corresponding example question text, which 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, the first mapping relationship between example role setting information and example question text is learned through a preset large language model, and the target question text corresponding to the target role setting information is determined based on the first mapping relationship.
[0045] In this step, the pre-defined large language model performs contextual 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, it provides direction for the prediction of the pre-defined large language model. Then, based on the first mapping relationship, it can predict the target question text corresponding to the target role setting information. In this way, the association logic between the target question text and the target role setting information is similar to or the same as the association logic between the example role setting information and the example question text. Therefore, it can effectively improve the ability of the pre-defined large language model to raise relevant questions.
[0046] In other words, the role of the pre-defined large language model can be defined first, based on the type of text to be analyzed. Then, by combining a self-developed or existing prompt paradigm with the target role setting information, the large language model can autonomously propose questions that need to be analyzed in relation to the text. A prompt paradigm refers to defining a template or prompt word to guide the pre-defined large language model in generating corresponding output text, thereby improving the generation quality and efficiency of the pre-defined large language model.
[0047] This can be achieved by allowing the pre-defined language model to "learn" about the assigned roles through prompt word engineering. For example, using the OpenAI interface, the target role setting information can be obtained by calling the system role attribute. Specifically, two instances of a class can be created, each calling the system role attribute of the pre-defined language model, and each setting its own role as the questioner and answerer based on the system role attribute. These roles are then used to ask questions and answer questions in the text to be analyzed based on the identity settings of the system role attribute.
[0048] In this application, through the guidance of prompt word paradigms, the pre-defined large language model can learn which questions should be asked under different target role setting information. The optional prompt word paradigms can be simple chain-of-thought methods like COT (chain of thoughts); or more complex methods like SA+SE (self-ask+search engine), which also demonstrates the thought process for asking a question under the target role setting information; it can also utilize a search engine during the thinking process to help find more specialized questions in relevant professional fields corresponding to the target role setting information that can be used for text analysis; it can further utilize ReAct (reasoning and action) to further break down specific questions under the target role setting information, and ask single-step or even recursive questions on the decomposed questions to enhance the pre-defined 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] The system learns the first mapping relationship between example role setting information and example question text through a pre-defined large language model, and determines the target question text corresponding to the target role setting information based on the first mapping relationship, including:
[0051] The target role setting information and the first example data are input 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. Based on the second mapping relationship, the target background information corresponding to the target role setting information is determined.
[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. Based on the third mapping relationship, the target question text corresponding to the target background information is determined.
[0053] In other words, in this application, the process of determining the target problem text using a pre-defined large language model can be divided into two steps. First, the pre-defined large language model learns the second mapping relationship between example role setting information and example background information, and determines the target background information corresponding to the target role setting information based on the second mapping relationship. The target background information includes 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, etc.
[0054] Then, the pre-defined 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. In other words, the pre-defined large language model further determines the questions to be raised 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 better fit the current role setting.
[0055] When determining the target background information or target question text using a pre-set large language model, it can be obtained by searching online resources or one's own knowledge; this application does not limit this.
[0056] In this way, the process of generating the target question text from the preset large language model is broken down into two steps, which allows for the acquisition of more target background information 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 based on the target question text using a preset large language model to obtain the target answer text corresponding to the target question text.
[0058] In this step, after determining the target question text, the pre-defined large language model can ask questions to the text to be analyzed based on the target question text. Through the analysis of the text to be analyzed, the target answer text corresponding to the target question text is obtained.
[0059] In this case, the text to be analyzed is usually a complex and long text. It is difficult to input the entire text of the text to be analyzed into the preset large language model. The text vector library corresponding to the text to be analyzed can be generated by compression encoding and other processing 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. Alternatively, 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 make any specific limitations on this.
[0060] Furthermore, after establishing the text vector library, the question of the text to be analyzed obtained by the pre-defined large language model can be transformed into the pre-defined large language model's access to the text vector library. An access interface or address for the text vector library is provided to the pre-defined large language model. Then, the pre-defined large language model can access the text vector library and perform searches within it based on the target question text to realize the query for the text to be analyzed. For example, the pre-defined large language model can perform searches within the text vector library by calling the question matching interface, related content integration, and answer interface based on the text vector library.
[0061] In this way, we can get rid of the pre-set large language model's inability to quickly and cost-effectively inject a large amount of vertical information and the limitation of the context window when applying it, so that the pre-set large language model can analyze and answer complex and long texts.
[0062] Specifically, the pre-defined large language model acts as the responder, and the action space that can be invoked includes not only third-party APIs (Application Programming Interfaces) such as search engine interfaces, but also inference interfaces of various self-developed small models.
[0063] Furthermore, the process of obtaining the target answer text from the pre-set large language model can also be guided by the prompt word paradigm. Based on the question-and-answer history of the questioner and the answerer, the question can be understood and the answering method can be selected. For example, the answer can be based on the world knowledge accumulated during the pre-training of the pre-set large language model, or the answer can be based on the understanding of the interface description in the Action Space and the interface call can be used to answer the question.
[0064] For example, if the target question text requires a pre-defined large language model to understand the plot of a certain script, then a search engine can be used to obtain the plot of the script.
[0065] In one implementation, a pre-defined large language model asks a question based on the target question text to obtain the target answer text, including:
[0066] Obtain the third sample data; the third sample data includes the sample question text and the 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. Questions are asked to the text to be analyzed based on the target question text, and the target answer text is obtained based on the fourth mapping relationship.
[0068] In other words, when the pre-defined large language model asks questions based on the target question text to obtain the target answer text, it can adopt a few-shot learning approach. By acquiring third-sample data, it learns the logical relationships implied in the third-sample data and derives the answer corresponding to the target question text based on the text to be analyzed.
[0069] The third set of example data includes example question text and example answer text. This allows the pre-defined large language model to learn a fourth mapping relationship between the example question text and the example answer text. Furthermore, when processing the text to be analyzed, it generates the target answer text corresponding to the target question text based on this fourth mapping relationship. It can be understood that as the quantity and quality of the third set of example data improve, the fourth mapping relationship will become more accurate, and the quality of the target answer text obtained by the pre-defined large language model in answering the target question text based on the text to be analyzed will also improve.
[0070] In step S14, the target question text and the corresponding target answer text are evaluated to obtain the target evaluation result.
[0071] Typically, the analysis of complex and long texts is not a simple logical or mathematical problem, and does not have a "standard answer" in the traditional sense. Moreover, 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 target question text and the target answer text, which can be analyzed from multiple aspects and angles to obtain the target evaluation results.
[0072] It is understandable that the target response text is obtained by the pre-defined large language model based on the text to be analyzed to answer the target question text. Therefore, if the text to be analyzed is of high quality, the pre-defined large language model can obtain a better target response text, and thus the target evaluation results of the target question text and the corresponding target response 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 a request for a plot summary of the script, then the better the quality of the script, the richer the plot summary and the more complete the plot elements in the target response text. In this case, the target question text can respond well to the target response text, and therefore the target evaluation result will be better.
[0074] Therefore, by evaluating the target question text and target answer text using the target evaluation results output by the pre-set large language model, the quality of the text to be analyzed can be reflected.
[0075] In one implementation, the target question text and its corresponding target answer text are evaluated to obtain a target evaluation result, including:
[0076] Obtain the fourth set of sample data; the fourth set of sample data includes the sample question text, the sample answer text, and the sample evaluation results.
[0077] The target question text, target answer text, and fourth example data are input into a pre-defined large language model for context learning to obtain a fifth mapping relationship between the example question text, example answer text, and example evaluation results. The target question text and target answer text are evaluated based on the fifth mapping relationship to obtain the target evaluation result.
[0078] In other words, in this application, the evaluation of the target question text and the target answer text can be achieved by a pre-defined large language model. In the process of evaluating the target question text and the target answer text and obtaining the target evaluation result, the pre-defined large language model can also adopt a small amount of target learning. By acquiring the fourth example data, it can learn how to evaluate the target question text and the target answer text based on the logical relationship implied in the fourth example data.
[0079] The fourth set of example data includes example question text, example answer text, and example evaluation results. This allows the pre-defined large language model to learn the fifth mapping relationship between these elements. Consequently, in subsequent answer evaluation processes, the target question text and target answer text can be evaluated based on this fifth mapping relationship, generating the corresponding target evaluation result. It is understandable that as the quantity and quality of the fourth set of example data improve, the fifth mapping relationship will become increasingly accurate, and the answer evaluations based on the pre-defined large language model will become increasingly accurate.
[0080] Alternatively, this application may use other methods, models, or interfaces to evaluate the target question text and the target answer text, and this application does not limit the scope of these methods.
[0081] In step S15, if 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 problem text.
[0082] In this step, if the target evaluation result of the evaluation stage meets the preset evaluation qualification conditions, it can be considered that the self-questioning process of the preset large language model is as expected and can provide an example for subsequent self-questioning processes. Therefore, the example 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. If the target evaluation result meets preset evaluation qualification conditions, the sample data is updated based on the target role setting information and the target question text, including:
[0084] If the target evaluation score is greater than the preset threshold, the sample data will be updated based on the target role setting information and the target question text.
[0085] The target evaluation score can intuitively represent the performance of the target question text and target answer text in the evaluation process. The higher the target evaluation score, the better the performance of the target question text and target answer text, and vice versa. Therefore, threshold filtering can be performed by comparing the target evaluation score with 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. Only the target role setting information and target question text with a target evaluation score greater than the preset threshold will be used as new example data.
[0086] Alternatively, the target evaluation results may also include target evaluation text, which is a textual evaluation of the target question text and the target answer text. In this application, the target evaluation text can also be analyzed using a text analysis model to determine whether the target evaluation results meet the preset evaluation qualification conditions. In addition, the target evaluation text can be combined with the target evaluation score to determine whether the target evaluation results meet the preset evaluation qualification conditions, thereby more accurately identifying the target role setting information and target question text that meet the user's expectations as example data.
[0087] In addition, the process of judging whether the target evaluation result meets the preset evaluation qualification conditions can also be implemented manually, which changes the labor cost from manual writing to manual selection. This application does not make any specific restrictions on this.
[0088] In one implementation, the example data includes first example data and second example data. Then, if the target evaluation result meets the preset evaluation qualification conditions, the example data is updated according to the target role setting information and the target question text, including:
[0089] If the target evaluation results meet the preset evaluation qualification conditions, the first example data is updated according to the target role setting information and target background information; the second example data is updated according to the target background information and target question text.
[0090] In other words, in this application, if the process of determining the target question text by the pre-set large language model refers to the first example data and the second example data respectively, firstly, the pre-set 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 raised for the text to be analyzed, thus obtaining the target question text, then, if the target evaluation result meets the pre-set evaluation qualification conditions, the input data and output data of the pre-set large language model in the two stages of determining the target background information and determining the target question text can be obtained respectively, namely the target role setting information and the target background information, as well as the target background information and the target question text, and the first example data and the second example data can be updated respectively.
[0091] In this way, during the subsequent invocation of the preset large language model, the steps of generating target background information and target question text can refer to the updated first and second example data. As the first and second example data are continuously updated, the quality of the generated target background information and target question text will also be continuously improved, 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 to obtain a fourth mapping relationship between the example question text and the example answer text, and questions are posed to the target text to be analyzed based on the target question text, and the target answer text is obtained based on the fourth mapping relationship, then, if the target evaluation result meets the preset evaluation qualification conditions, this example data augmentation method further includes:
[0093] The third example data is updated based on the target question text, the text to be analyzed, and the target answer text.
[0094] In other words, in this application, if the pre-defined large language model learns how to obtain the answer corresponding to the target question text based on the text to be analyzed by acquiring the third example data and according to the fourth mapping relationship between the example question text and the example answer text, then, if the target evaluation result meets the pre-defined evaluation qualification conditions, the input data and output data of the pre-defined large language model in the question-answering stage, namely the target question text, the text to be analyzed, and the target answer text, can also be acquired to update the third example data.
[0095] In this way, during the subsequent invocation of the preset large language model, the steps for 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, target answer text, and fourth example data are input into a preset large language model for context learning to obtain a fifth mapping relationship between the example question text, example answer text, and example evaluation result, and the target question text and target answer text are evaluated based on the fifth mapping relationship to obtain the target evaluation result, then, if the target evaluation result meets the preset evaluation qualification conditions, this example data augmentation method further includes:
[0097] The fourth example data is updated based on the target question text, target answer text, and target evaluation results.
[0098] In other words, in this application, if the preset large language model evaluates the target question text and target answer text based on the fifth mapping relationship between the example question text and example answer text and the example evaluation text and 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 answer stage, namely the target question text, target answer text and target evaluation result, can also be obtained to update the fourth example data.
[0099] In this way, during the subsequent invocation of the preset large language model, the evaluation process of the preset large language model's answer can refer to the updated fourth example data. As the fourth example data is continuously updated, the evaluation effect of the preset large language model's answer will also continuously 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; based on the target role setting information, determine the current task 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 of the matching 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 be unable to process the input data. In this embodiment, the target role setting information is the necessary data for the preset large language model to generate the target question text. Therefore, the length of the input data can be limited by filtering the sample data.
[0103] In other words, as the amount of sample data increases, some optimization strategies can be added. For example, when the number of candidate sample data reaches the limit of the context window, a portion of them can be selected as sample data. For example, the selection can be based on the order in which the sample data was generated or the text length of the sample data. This application does not limit this.
[0104] In this way, when there is a large amount of sample data, a portion can be selected according to different application scenarios, reducing the computational resources required for computation without affecting the processing accuracy of the preset large language model.
[0105] In one implementation, candidate example data matching the context window length of a preset large language model is selected as example data, including:
[0106] Candidate example data that matches the context window length of the large language model are determined according to the generation time of the candidate example data from latest to earliest, and are used as example data.
[0107] In other words, N candidate sample data that fit the window can be selected from the latest generated sample data in the order in which the sample data is generated. In this way, the sample data input into the preset large language model is the latest generated sample data. The latest generated sample data references the past sample data in the process of being generated, and the presentation effect is better. Therefore, the selected sample data is more representative and can further improve the subsequent processing effect.
[0108] In another implementation, if the target evaluation result does not meet the preset evaluation qualification conditions, it also includes:
[0109] The steps are as follows: 1. Obtain the importance of the text to be analyzed; 2. If the importance of the text to be analyzed meets the preset importance condition, and / or the number of example data is less than the preset number, 3. Return the first mapping relationship between the example role setting information and the example question text learned through the preset large language model, and 4. Determine the target question text corresponding to the target role setting information based on the first mapping relationship.
[0110] In other words, if the target evaluation result does not meet the preset evaluation qualification conditions, it can be determined whether to directly abandon the text to be analyzed or to retry the text to be analyzed, based on the importance of the text to be analyzed and the number of existing example data.
[0111] For texts whose importance does not meet the preset importance criteria, there is no need to retry; they can be abandoned. For texts whose importance meets the preset importance criteria, the process can return to the step of learning the first mapping relationship between example role setting information and example question text through the preset large language model, regenerating new target question text, and re-questioning and evaluating the text. It can be understood that the output of the preset large language model has randomness; that is, even with the same input data, the preset large language model may produce different output data. This 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, a balance can be maintained between focus and creativity. The specific value can be set according to specific business scenarios or actual needs, and there are no specific limitations.
[0112] This allows for targeted processing of the more important portions of the text to be analyzed, supplementing the example data as much as possible, avoiding the omission of important data, and thus improving the processing efficiency of the pre-defined large language model. The importance of the text to be processed can be manually input or determined through importance analysis; there is no specific limitation.
[0113] Furthermore, if there is a large amount of existing sample data, the text to be analyzed can be skipped without retrying. However, if there is a small amount of existing sample data, the analysis can be repeated. This allows for different sample data expansion strategies to be adopted in different situations, accelerating the expansion of sample data when it is scarce, thereby improving the processing efficiency of the pre-set large language model.
[0114] In this application, determining whether to re-question the text to be analyzed based on its text importance and determining whether to re-question the text to be analyzed based on the number of sample data can be done simultaneously. For example, in some cases, as long as one of them is met, the text to be analyzed can be re-questioned, while in other cases, both of them need to be met before the text to be analyzed can be re-questioned. In addition, the execution of the two may also have a sequential order, that is, only if one of them is met will the determination of whether the other is met continue, and only if both are met can the text to be analyzed be re-questioned, and so on. This application does not limit the specifics in this regard.
[0115] In one implementation, the first mapping relationship between example character setting information and example question text learned through a preset large language model is returned, including:
[0116] Obtain the number of questions asked by the preset large language model based on the target question text to be analyzed in the text;
[0117] If the number of questions asked is less than the preset number, return to the step of learning the first mapping relationship between the example character setting information and the example question text through the preset large language model.
[0118] In other words, there is a limit to the number of times the text to be analyzed can be retried. Only if the number of retried attempts does not exceed the preset limit will the text to be analyzed continue to be retried. This can avoid the waste of system resources caused by unlimited retries.
[0119] The number of questions can be a fixed value entered manually, or it can be determined based on information such as the current system load. This application does not specify the exact number of questions.
[0120] In one implementation, when the number of questions is greater than or equal to a preset number, this example data augmentation method further includes:
[0121] Use the text to be analyzed as the waiting text, and obtain new text to be analyzed;
[0122] Return to the step of learning the first mapping relationship between example role setting information and example question text through the preset large language model, until the example data is updated according to the target role setting information and target question text, and the waiting text is used as the new text to be analyzed, and then return to the step of learning the first mapping relationship between example role setting information and example question text through the preset large language model.
[0123] In other words, if the number of re-questions exceeds the preset number, but the target evaluation result still fails to meet the preset evaluation qualification criteria, then the current text to be analyzed can be placed after other texts to be analyzed. It is understandable that after processing other texts to be analyzed, the example data may be expanded, and the processing capability of the preset large language model will also be enhanced. In this case, re-analyzing the current text to be analyzed can use the self-expanded example data as a reference, and the evaluation result may be better than before. Therefore, the current text to be analyzed can be fully utilized.
[0124] The example data augmentation method proposed in this application embodiment can be applied to... Figure 2 In the text analysis framework shown. For example... Figure 2As shown, the following process is performed within the text analysis framework: Setting the role of the pre-defined Large Language Models (LLMs); Prompt rendering, using the pre-defined LLMs to present the target question text; Answering the target question text using the pre-defined LLMs to obtain the target answer text (Documentsretrieval); Target answer text selection and evaluation; Based on the expected multi-path feedback in the target question text presentation, target question text answering, and target answer text selection and evaluation stages, multi-level sample augmentation is performed on the target question text presentation, target question text answering, and target answer text selection and evaluation stages to expand the example data.
[0125] (1) Pre-set large language model role settings
[0126] The role of the pre-defined large language model is assigned based on the type of text being analyzed. This role setting information is then communicated to the pre-defined large language model via prompt rendering. For example, using OpenAI, the role of the pre-defined large language model can be set through an initial system role.
[0127] For example, in engineering implementation, two instances of the class can be created, each using the call to the preset large language model as its own usable method. Each instance has its own Prompt property, 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, combined with pre-defined roles, enables the pre-defined large language model to autonomously propose target question texts corresponding to the text to be analyzed. Guided by the Prompt paradigm, the pre-defined large language model can consider which target question texts it should propose under its current role.
[0130] Optionally, the Prompt paradigm can be a chain-thinking approach like COT; or a more complex SA+SE approach, which demonstrates the thought process behind why this role raises a specific target question text, and can also utilize search engines to help find professional questions in the role's relevant field that can be used for text analysis; or it can further utilize the ReAct approach to further decompose the specific target question text, and ask single-step or even recursive questions on the decomposed target question text to enhance the understanding of the pre-set large language model 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 the respondent, one can establish a tool library that can be used by a pre-defined large language model, and answer the target question text by utilizing one's own knowledge, online resources, and text vector libraries based on the question-and-answer context.
[0133] Define the action space that responders can call. In addition to APIs (Application Programming Interfaces) that can be called by third parties (such as search engine interfaces), inference interfaces of various models can also be registered in the Action Space.
[0134] Guided by the Prompt paradigm, a pre-defined large language model can be used to understand the target question text based on the questioner's and responder's question-and-answer history, allowing for the selection of a method to analyze the target question text. Answers can be provided using world knowledge accumulated during pre-training; alternatively, solutions can be found by utilizing API calls based on an understanding of the interface specifications in the Action Space. For example, understanding a plot can be achieved by using a search engine to retrieve relevant information. For the analysis of complex and long texts, questions can be matched to a text vector library, and relevant content can be integrated and answered. This overcomes the limitations of pre-defined large language models in quickly and cost-effectively injecting large amounts of in-depth information and the constraints of context windows in application.
[0135] By analyzing complex, long texts, we extract key information and build a text vector library based on this extract. A subsequent pre-defined large language model can then convert the target question text into a text vector library request, thereby obtaining an answer based on the text vector library.
[0136] (4) Target response 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 than just the final result. Therefore, an evaluation mechanism can be established to answer the above questions, thereby obtaining the target evaluation results.
[0138] (5) Example Data Augmentation
[0139] Then, if the evaluation results meet expectations, the entire process of question posing, answering, and evaluating is used as a feedback example to supplement the sample data, thus enabling the preset large language model to achieve better performance and further enhancing the accuracy and stability of the process. If the evaluation results do not meet expectations, based on the number of existing sample data and the importance of the text to be analyzed, it is determined whether to skip the text to be analyzed or to retry. If the expected result is still not obtained after the number of retries is met, the text is placed after other texts for analysis, so that the system examples can be self-expanded using texts that can generate the expected results before trying again.
[0140] In this way, starting with a small number of human examples, the system can gradually expand to a large number of examples, producing more accurate results. Using these more accurate results as examples, a positive feedback loop is formed.
[0141] As can be seen from the above, the technical solution provided by the embodiments of this application, through learning from example data using a preset large language model, can determine the target question text based on the target role setting information, and analyze the text to be analyzed based on the target question text to obtain the target answer text. In the process of determining the target question text, example role setting information and corresponding example question texts are used as examples to improve the ability of the preset large language model to perform self-questioning and self-answering of the text to be analyzed. Furthermore, after evaluating the target question text and corresponding target answer text output by the preset large language model, if the target evaluation result meets the preset evaluation qualification conditions, it indicates that the content of the text to be analyzed meets the requirements, and the preset large language model can perform reasonable analysis of the text to be analyzed to obtain a satisfactory answer. Therefore, based on the input and output of the preset large language model during the self-questioning and self-answering process, the example data can be updated. When the system process restarts, the sample data used by the preset large language model is supplemented with the target role setting information and target question text from this process. Moreover, since the target role setting information and target question text added to the sample data are accumulated during this system process, their format and content meet the requirements of each stage of the preset large language model. This ensures high quality and consistency of the sample data. In other words, the system can automatically expand to generate a large amount of excellent sample data, reducing the manpower and time costs of acquiring sample data, while improving the usability of sample data, which in turn benefits the text analysis effect of the preset large language model.
[0142] The example data amplification method provided in this application can be executed by an example data amplification device. This application uses an example data amplification device to perform the example data amplification method as an example to illustrate the apparatus of the example data amplification method provided in this application.
[0143] Figure 3 This is a block diagram of an example data augmentation apparatus according to an exemplary embodiment, the apparatus 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, wherein the sample question text is the text of asking a question based on the sample role setting information;
[0145] The generation module 202 is used to learn the first mapping relationship between the example character setting information and the example question text through the preset large language model, and to determine the target question text corresponding to the target character setting information based on the first mapping relationship;
[0146] Analysis module 203 is used to acquire the text to be analyzed, and to ask questions about the text to be analyzed based on the target question text using the preset large language model, so as to obtain the target answer text corresponding to the target question text;
[0147] Evaluation module 204 is used to evaluate the target question text and the corresponding target answer text to obtain the target evaluation result;
[0148] The update module 205 is used to update the example data according to the target role setting information and the target problem text when the target evaluation result meets the preset evaluation qualification conditions.
[0149] As can be seen from the above, the technical solution provided by the embodiments of this application, through learning from example data using a preset large language model, can determine the target question text based on the target role setting information, and analyze the text to be analyzed based on the target question text to obtain the target answer text. In the process of determining the target question text, example role setting information and corresponding example question texts are used as examples to improve the ability of the preset large language model to perform self-questioning and self-answering of the text to be analyzed. Furthermore, after evaluating the target question text and corresponding target answer text output by the preset large language model, if the target evaluation result meets the preset evaluation qualification conditions, it indicates that the content of the text to be analyzed meets the requirements, and the preset large language model can perform reasonable analysis of the text to be analyzed to obtain a satisfactory answer. Therefore, based on the input and output of the preset large language model during the self-questioning and self-answering process, the example data can be updated. When the system process restarts, the sample data used by the preset large language model is supplemented with the target role setting information and target question text from this process. Moreover, since the target role setting information and target question text added to the sample data are accumulated during this system process, their format and content meet the requirements of each stage of the preset large language model. This ensures high quality and consistency of the sample data. In other words, the system can automatically expand to generate a large amount of excellent sample data, reducing the manpower and time costs of acquiring sample data, while improving the usability of sample data, which in turn benefits the text analysis effect of the preset large language model.
[0150] Figure 4 This is a block diagram illustrating an electronic device for example data amplification according to an exemplary embodiment, including a processor and a memory, wherein the memory is used to store a computer program; and the processor is used to execute the program stored in the memory.
[0151] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0152] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0153] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, which can be executed by a processor of an electronic device to perform the above-described method. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0154] In an exemplary embodiment, a computer program product is also provided that, when run on a computer, causes the computer to implement the method for data augmentation of the above-described comment example.
[0155] As can be seen from the above, the technical solution provided by the embodiments of the present invention, through learning from example data using a preset large language model, can determine the target question text based on the target role setting information, and analyze the text to be analyzed based on the target question text to obtain the target answer text. In the process of determining the target question text, example role setting information and corresponding example question texts are used as examples to improve the ability of the preset large language model to perform self-questioning and self-answering of the text to be analyzed. Furthermore, after evaluating the target question text and corresponding target answer text output by the preset large language model, if the target evaluation result meets the preset evaluation qualification conditions, it indicates that the content of the text to be analyzed meets the requirements, and the preset large language model can perform reasonable analysis of the text to be analyzed to obtain a satisfactory answer. Therefore, based on the input and output of the preset large language model during the self-questioning and self-answering process, the example data can be updated. When the system process restarts, the sample data used by the preset large language model is supplemented with the target role setting information and target question text from this process. Moreover, since the target role setting information and target question text added to the sample data are accumulated during this system process, their format and content meet the requirements of each stage of the preset large language model. This ensures high quality and consistency of the sample data. In other words, the system can automatically expand to generate a large amount of excellent sample data, reducing the manpower and time costs of acquiring sample data, while improving the usability of sample data, which in turn benefits the text analysis effect of the preset large language model.
[0156] Figure 5 This is a block diagram illustrating an apparatus 800 for example data augmentation according to an exemplary embodiment.
[0157] For example, device 800 can be a mobile phone, computer, digital broadcasting electronic device, messaging device, game console, tablet device, medical device, fitness equipment, 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] Processing component 802 typically controls the overall operation of device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0160] Memory 804 is configured to store various types of data to support the operation of device 800. Examples of this data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, etc. 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 storage, flash memory, magnetic disk, or optical disk.
[0161] Power supply component 807 provides power to various components of device 800. Power supply component 807 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to device 800.
[0162] 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 touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data to be processed. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0163] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, 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 buttons, volume buttons, power buttons, and lock buttons.
[0165] Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of device 800. For example, sensor assembly 814 may detect the on / off state of device 800, the relative positioning of components such as the display and keypad of device 800, changes in the position of device 800 or a component of device 800, the presence or absence of user contact with device 800, the orientation or acceleration / deceleration of device 800, and temperature changes of device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0166] Communication component 816 is configured to facilitate wired or wireless communication between device 800 and other devices. Device 800 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 5G), or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may 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 perform 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, which can be executed by a processor 820 of the device 800 to perform the above-described method. Optionally, for example, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.
[0169] In an exemplary embodiment, a computer program product including instructions is also provided, which, when run on a computer, causes the computer to perform any of the example data augmentation methods described in the above embodiments.
[0170] As can be seen from the above, the technical solution provided by the embodiments of this application, through learning from example data using a preset large language model, can determine the target question text based on the target role setting information, and analyze the text to be analyzed based on the target question text to obtain the target answer text. In the process of determining the target question text, example role setting information and corresponding example question texts are used as examples to improve the ability of the preset large language model to perform self-questioning and self-answering of the text to be analyzed. Furthermore, after evaluating the target question text and corresponding target answer text output by the preset large language model, if the target evaluation result meets the preset evaluation qualification conditions, it indicates that the content of the text to be analyzed meets the requirements, and the preset large language model can perform reasonable analysis of the text to be analyzed to obtain a satisfactory answer. Therefore, based on the input and output of the preset large language model during the self-questioning and self-answering process, the example data can be updated. When the system process restarts, the sample data used by the preset large language model is supplemented with the target role setting information and target question text from this process. Moreover, since the target role setting information and target question text added to the sample data are accumulated during this system process, their format and content meet the requirements of each stage of the preset large language model. This ensures high quality and consistency of the sample data. In other words, the system can automatically expand to generate a large amount of excellent sample data, reducing the manpower and time costs of acquiring sample data, while improving the usability of sample data, which in turn benefits the text analysis effect of the preset large language model.
[0171] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. The embodiments of the invention are intended to cover any variations, uses, or adaptations of the embodiments of the invention that follow the general principles of the embodiments of the invention and include common knowledge or customary techniques in the art not disclosed in the embodiments of the invention. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of the embodiments of the 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 accompanying drawings, and various modifications and changes can be made without departing from their scope. The scope of the embodiments of the present invention is limited only by the appended claims.
Claims
1. A method for augmenting example data, characterized in that, include: Obtain 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, wherein the sample question text is the text of asking a question based on the sample role setting information; The preset large language model learns the first mapping relationship between the example character setting information and the example question text, and determines the target question text corresponding to the target character setting information based on the first mapping relationship; The text to be analyzed is obtained, and a question is asked on the text based on the target question text using the preset large language model to obtain the target answer text corresponding to the target question text. The target question text and the corresponding target answer text are evaluated to obtain the target evaluation result; If the target evaluation result meets the preset evaluation qualification conditions, 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 character setting information and corresponding example background information. The second example data includes the example background information and corresponding example question text. The step of learning the first mapping relationship between the example character setting information and the example question text through the preset large language model, and determining the target question text corresponding to the target character setting information based on the first mapping relationship, includes: The target role setting information and the first example data are input 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. Based on the second mapping relationship, the target background information corresponding to the target role setting information is determined. 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. Based on the third mapping relationship, the target question text corresponding to the target background information is determined.
3. The example data augmentation method according to claim 2, characterized in that, When the target evaluation result meets the preset evaluation qualification conditions, the example data is updated according to the target role setting information and the target question text, including: If 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 based on 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 questions about the text to be analyzed based on the target question text using the preset large language model to obtain the target answer text corresponding to the target question text includes: Obtain third example data; the third example data includes example question text and example 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. Questions are asked to the text to be analyzed based on the target question text, and the target answer text is obtained based on the fourth mapping relationship.
5. The example data augmentation method according to claim 4, characterized in that, If the target evaluation result meets the preset evaluation qualification conditions, the method further includes: The third example data is updated based on 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 evaluation of the target question text and the corresponding target answer text to obtain the target evaluation result includes: Obtain the fourth set of example data; the fourth set of example data includes example question text, example answer text, and example evaluation results; 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 the target evaluation result.
7. The example data augmentation method according to claim 6, characterized in that, If the target evaluation result meets the preset evaluation qualification conditions, the method further includes: The fourth example data is updated based on 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 preset evaluation qualification conditions, updating the example data based on the target role setting information and the target question text includes: If the target evaluation score is greater than a preset threshold, the example data is updated based on the target role setting information and the target question text.
9. The example data augmentation method according to claim 1, characterized in that, If the target evaluation result does not meet the preset evaluation qualification conditions, the method further includes: To determine the importance of the text to be analyzed; If 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, 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 determining the target question text corresponding to the target role setting information based on the first mapping relationship is returned.
10. The example data augmentation method according to claim 9, characterized in that, The step of returning the first mapping relationship between the example character setting information and the example question text learned through the preset large language model includes: The number of questions asked by the preset large language model based on the target question text to the text to be analyzed is obtained; If the number of questions asked is less than the preset number, return to the step of learning the first mapping relationship between the example character setting information and the example question text through the preset large language model.
11. The example data augmentation method according to claim 10, characterized in that, If the number of questions asked is greater than or equal to the preset number, the method further includes: The text to be analyzed is used as the waiting text, and a new text to be analyzed is obtained; Return to the step of learning the first mapping relationship between the example character setting information and the example question text through the preset large language model, until the example data is updated according to the target character setting information and the target question text, and then the waiting text is taken as the new text to be analyzed, and return to the step of learning the first mapping relationship between the example character 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 acquisition of target character setting information and sample data includes: Obtain target character setting information; Based on the target role setting information, determine the current task and obtain the 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 step of selecting candidate example data that matches the context window length of the preset large language model, as example data, includes: Based on the generation time of the candidate example data from back to front, the candidate example data that matches the context window length of the preset large language model is determined and used as example data.
14. An example data augmentation device, characterized in that, include: The acquisition module 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, wherein the sample question text is the text of asking a question based on the sample role setting information; The generation module is used to learn the first mapping relationship between the example character setting information and the example question text through the preset large language model, and to determine the target question text corresponding to the target character setting information based on the first mapping relationship; The analysis module is used to acquire the text to be analyzed, and to ask questions about the text to be analyzed based on the target question text using the preset large language model, so as to obtain the target answer text corresponding to the target question text; The evaluation module is used to evaluate the target question text and the corresponding target answer text to obtain the target evaluation result; The update 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 conditions.
15. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the example data augmentation method as described in any one of claims 1-13.
16. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the example data augmentation method as described in 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 is executed by at least one processor to implement the example data augmentation method as described in any one of claims 1 to 13.
Citation Information
Patent Citations
Knowledge base construction method and question and answer dialogue method and system based on generative large language model
CN117056471A
Corpus Augmentation System
US20160196334A1