Test text generation method and apparatus, device, medium, and program product for generating test text

By determining the natural language attribute labels of the original test text and optimizing the prompt word strategy, target test text that conforms to the characteristics of human language is generated, which solves the problem of homogeneity of text test sets in existing technologies and improves the test effect and user experience.

WO2026044601A1PCT designated stage Publication Date: 2026-03-05BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2026-03-05

AI Technical Summary

Technical Problem

Existing methods for generating text test sets produce highly homogeneous texts with a lack of fluency and depth in their language style, making it difficult to identify potential problems in the business and reducing the effectiveness of testing and user experience.

Method used

By determining the values ​​of the natural language attribute labels of the original test text, the prompt word strategy is optimized, and natural language processing technology is used to generate target test text that conforms to the characteristics of human language.

Benefits of technology

The generated test text conforms to the variations of human language, improving testing effectiveness and user experience, and meeting testers' needs for the realism of text test sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024115568_05032026_PF_FP_ABST
    Figure CN2024115568_05032026_PF_FP_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure relate to a test text generation method and apparatus, a device, a medium, and a program product. The method comprises determining the value of a label for an original test text, the label indicating a natural language property. The method further comprises, on the basis of the value, determining a prompt strategy for the original test text. In addition, the method further comprises generating a target test text on the basis of the original test text and the prompt strategy. By means of the present method for generating test text using a natural language property, test text that conforms to human language variations can be produced, thereby improving testing effectiveness and user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Methods, apparatus, devices, media, and program products for generating test text. Technical Field

[0001] This disclosure generally relates to the field of computers, and more specifically to methods, apparatus, devices, media, and program products for generating test text. Background Technology

[0002] A text test set is a dataset used in machine learning, natural language processing (NLP), and other fields to evaluate model performance. It typically contains a series of text samples that the model has not seen during training, used to test the model's ability to generalize on unknown data.

[0003] Currently, there are various methods for obtaining text test sets, including dividing a portion of data from existing text datasets, using industry-released specialized text test sets, manually constructing text test sets, and using data augmentation techniques to generate test sets. The specific method used to obtain the text test set depends on the needs of the business project and the availability of data.

[0004] Summary of the Invention

[0005] Embodiments of this disclosure provide a method, apparatus, device, medium, and program product for generating test text.

[0006] According to a first aspect of the disclosure, a method for generating test text is provided. The method includes determining values ​​for tags on the original test text, wherein the tags indicate attributes of natural language. The method also includes determining a prompting word strategy for the original test text based on the values. Furthermore, the method includes generating target test text based on the original test text and the prompting word strategy.

[0007] In a second aspect of the disclosure, an apparatus for generating test text is provided. The apparatus includes a value determination module configured to determine values ​​of tags for an original test text, wherein the tags indicate attributes of natural language. The apparatus also includes a prompt word policy determination module configured to determine a prompt word policy for the original test text based on the values. Furthermore, the apparatus includes a target test text generation module configured to generate target test text based on the original test text and the prompt word policy.

[0008] In a third aspect of this disclosure, an electronic device is provided. The electronic device includes a processor and a memory coupled to the processor, the memory having instructions stored therein, which, when executed by the processor, cause the electronic device to perform the method according to the first aspect.

[0009] In a fourth aspect of this disclosure, a computer-readable storage medium is provided. The computer-readable storage medium stores computer-executable instructions, which are executed by a processor to implement the method according to the first aspect.

[0010] In a fifth aspect of this disclosure, a computer program product is provided, which is tangibly stored on a non-volatile computer-readable medium and includes computer-executable instructions that, when executed, cause a computer to perform the method according to the first aspect.

[0011] The summary section is intended to present the chosen concepts in a simplified form, which will be further described in the detailed description below. The summary section is not intended to identify key or principal features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter. Attached Figure Description

[0012] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:

[0013] Figure 1 illustrates a schematic diagram of an example environment in which various embodiments of the present disclosure may be implemented;

[0014] Figure 2 shows a flowchart of a method for generating test text according to some embodiments of the present disclosure;

[0015] Figure 3 shows a schematic diagram of a framework for generating test text according to some embodiments of the present disclosure;

[0016] Figure 4A shows a block diagram of a process for generating test text according to some embodiments of the present disclosure;

[0017] Figure 4B shows a schematic diagram of labels, values, and their proportions according to certain embodiments of the present disclosure;

[0018] Figure 5 shows a schematic diagram of an interactive page for generating test text according to some embodiments of the present disclosure;

[0019] Figure 6 shows a schematic diagram illustrating the effect of generating test text according to certain embodiments of the present disclosure;

[0020] Figure 7 shows a block diagram of an apparatus for generating test text according to certain embodiments of the present disclosure; and

[0021] Figure 8 shows a block diagram of an electronic device according to certain embodiments of the present disclosure.

[0022] In all the accompanying figures, the same or similar reference numerals denote the same or similar elements. Detailed Implementation

[0023] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0024] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0025] In the description of embodiments of this disclosure, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects unless explicitly stated. Other explicit and implicit definitions may also be included below.

[0026] As mentioned earlier, text test sets play a crucial role in testing business models, and there are currently various methods for obtaining them. With technological advancements, data augmentation techniques are also widely used in generating text test sets. However, while these or similar text test set generation techniques closely align with business scenarios, they often exhibit high homogeneity and lack the fluency and depth of natural human language. They deviate from the contextual richness and naturalness inherent in human speech, making it difficult for testers to uncover potential problems in business models when using such text test sets, thus degrading the user experience.

[0027] Therefore, embodiments of this disclosure provide a method for generating a text test set with human natural language attributes. First, the values ​​of the natural language attributes (i.e., tags) of the original test text are determined to lay the foundation for subsequent test text generation. Then, using these tag values, a prompt word strategy is optimized for the original text. Next, the original test text and the prompt word strategy are used to generate a target test text that conforms to human language characteristics and is natural and fluent.

[0028] In summary, this method of generating test text by utilizing natural language attributes can produce test text that conforms to the variations in human language, meeting testers' needs for the realism of text test sets, thereby improving testing effectiveness and user experience.

[0029] Figure 1 illustrates a schematic diagram of an example environment 100 in which various embodiments of the present disclosure can be implemented. As shown in Figure 1, in order to obtain a test text set with rich context and more fluent and natural language like human language, the original test text 110 can be input into the test text generation system 120, so as to obtain the target test text 130 that conforms to the distribution of human natural language features, thereby enabling testers to objectively evaluate the business model.

[0030] In some embodiments, the original test text 110 may be written by the user or generated by the user through a language model. For example, the user may input a scene description into the language model, causing the language model to generate some original test text that matches the scene.

[0031] In some embodiments, the test text generation system 120 may integrate natural language processing technology, language models, etc., to understand and analyze the complex features and distribution patterns of human natural language. In some embodiments, in order to ensure that the generated target test text has the depth expected of human natural language, when the original test text 110 is sent to the test text generation system 120, tags can be determined for the original test text 110. These tags represent the feature distribution of human natural language, such as length, sentence structure, rhetorical devices, language style, communication platform, popular topics, and domain.

[0032] In some embodiments, the values ​​of the tags are further refined classifications of these tags. For example, for rhetorical devices, the values ​​can be categories such as metaphor, personification, and parallelism. For language tags, the values ​​can be purely Chinese, mixed Chinese and English (primarily Chinese with interspersed English words), or purely English. In some embodiments, each tag value has a weight, and its proportion is the weight. For example, in the three values ​​of the rhetorical device tag, the proportion of metaphor can be 40%, the proportion of contrast can be 40%, and the proportion of hyperbole can be 20%. In some embodiments, the distribution of these tag values ​​and proportions can be preset or dynamically set after analyzing the user's generation needs.

[0033] In some embodiments, in order to make the generated target test text 130 more consistent with the application scenario of the original test text 110, the proportion of its label values ​​can be adjusted. For example, in the scenario where primary school students are actively answering the teacher's questions, the proportion of values ​​such as "excitement", "joy", and "pride" under the "emotion" label is higher than the proportion of "fear".

[0034] In some embodiments, in order for the test text generation system 120 employing natural language technology to generate target test text 130 that meets the requirements, a cue word strategy for the target test text can be generated first. For example, multiple tags can be combined to obtain the cue word strategy. If there are only two tags, then one of the cue word strategies 1 can be [tag 1 value 1 (percentage), tag 2 value 2 (percentage)], and cue word strategy 2 can be [tag 1 value 2 (percentage), tag 2 value 2 (percentage)]. And so on, cue word strategy 3 can be [tag 1 value 3 (percentage), tag 2 value 2 (percentage)], and so on.

[0035] In some embodiments, in order to generate target test texts in conjunction with prompt word strategies, the original test text 110 can be repeatedly increased to the number of target test texts that the user needs to generate. For example, if the original test text 110 is [original sentence 1; original sentence 2; original sentence 3], and the user needs to generate 9 target test texts, then the original test text 110 can be repeatedly expanded to the target number of 9, i.e., [original sentence 1; original sentence 1; original sentence 1; original sentence 2; original sentence 2; original sentence 2; original sentence 3; original sentence 3; original sentence 3].

[0036] In some embodiments, to ensure that the number of generated target test texts matches the target number determined by the user, a prompt word strategy for the target number of generated target test texts can be selected from multiple prompt word strategies. For example, if the user determines that the number of generated target test texts is 9, then 9 prompt word strategies can be selected from multiple prompt word strategies as the prompt word strategy for the target test texts.

[0037] In some embodiments, the original test text after repeated expansion and the obtained prompt word strategy corresponding to the target number can be fed into the language model to obtain the generated target test text 130. In some embodiments, the generated target test text 130 can be a target test text that is semantically very close to, completely dissimilar to, or somewhere in between the original test text 110.

[0038] In some embodiments, in order to enable the language model to have better generalization ability, the expected value of the original test text 110 and the generated target test text 130 can be used to train the language model.

[0039] Understandably, the test text generation system 120 can also have a pre-set prompt word strategy table, which consists of labels, values, and the proportion of each value in human natural language. When the original test text 110 is received, the system can select the prompt word strategy with the highest relevance from the pre-set prompt word strategy table based on the application scenario of the original test text 110 and the number of target test texts to be generated, thereby generating the target test text with the help of a language model.

[0040] By utilizing natural language attributes to generate test text, this method can produce test text that conforms to the variations in human language, meeting testers' needs for the realism of text test sets, thereby improving testing effectiveness and user experience.

[0041] The method according to embodiments of the present disclosure will be described in detail below with reference to Figures 2 to 8. For ease of understanding, the specific data mentioned in the following description are exemplary and are not intended to limit the scope of protection of this disclosure. It is understood that the embodiments described below may also include additional actions not shown and / or actions shown may be omitted, and the scope of this disclosure is not limited in this respect.

[0042] Figure 2 shows a flowchart of a method 200 for generating test text according to some embodiments of the present disclosure. Method 200 can be performed by an apparatus for generating test text, which may be, for example, a system configured on a cloud server, or a standalone device or system. The apparatus can be implemented in software and / or hardware. The method 200 will now be illustrated schematically using an apparatus for generating test text as an example. Referring to Figure 2, method 200 may include blocks 202, 204, and 206.

[0043] In box 202, the values ​​of the labels for the original test text are determined, where the labels indicate attributes of natural language. Referring to Figure 1, to make the generated target test text more consistent with human natural language expression, the test text generation system 120 can determine the labels for the original test text 110. These labels represent the distribution of features of human natural language, such as length, sentence structure, rhetorical devices, language style, communication platform, popular topics, language, etc. In some embodiments, the values ​​of these labels are further refined classifications of these labels. For example, for rhetorical devices, the values ​​can be classified as metaphor, personification, parallelism, etc. For language labels, the values ​​can be pure Chinese, mixed Chinese and English (mainly Chinese with interspersed English words), pure English, etc. In some embodiments, the value of each label has a weight, and its proportion is the weight. For example, in the three values ​​of the rhetorical device label, the proportion of metaphor can be 40%, the proportion of contrast can be 40%, and the proportion of hyperbole is 20%.

[0044] In box 204, a cue word strategy is determined based on the values ​​for the original test text. Referring to Figure 1, in some embodiments, in order for the test text generation system 120 to generate a target test text 130 that meets the requirements, a cue word strategy for the target test text can be generated. For example, multiple tags can be combined to obtain a cue word strategy. If there are only two tags, then one of the cue word strategies 1 can be [tag 1 value 1 (percentage), tag 2 value 2 (percentage)]. Similarly, cue word strategy 2 can be [tag 1 value 2 (percentage), tag 2 value 2 (percentage)]. In some embodiments, if the value of tag 1 is [value 1, value 2, value 3, value 4, value 5], the value of tag 2 is [value 1, value 2, value 3, value 4, value 5, value 6, value 7, value 8, value 9], and the value of tag 3 is [value 1, value 2], then 90 different combinations of tags can be obtained, which are the cue word strategies.

[0045] In box 206, target test text is generated based on the original test text and the prompt word strategy. Referring to Figure 1, in some embodiments, the test text generation system 120 may employ natural language processing techniques and may be configured with a language model. In some embodiments, in order to generate target test text by combining it with prompt word strategies one by one, the original test text 110 can be repeatedly increased to the number of target test texts required by the user. Here, the target number is the number of target test texts required by the user. In some embodiments, in order to ensure that the number of generated target test texts is consistent with the target number determined by the user, a prompt word strategy with the target number can be selected from multiple prompt word strategies. In some embodiments, the repeatedly expanded original test text and the obtained prompt word strategies corresponding to the target number can be fed one by one into the language model to obtain the generated target test text 130.

[0046] In the embodiments of this disclosure, the values ​​of the tags for the original test text are first determined, where the attributes of natural language, i.e., the tags, lay the foundation for the subsequent generation of the test text. Then, using these tag values, a prompting word strategy for the original text is optimized and determined. Next, the original test text and the prompting word strategy are used to generate a target test text that conforms to human language characteristics and is natural and fluent.

[0047] By utilizing natural language attributes to generate test text, this method can produce test text that conforms to the variations in human language, meeting testers' practical needs for text test sets, improving testing effectiveness, and thus enhancing the user experience.

[0048] Figure 3 illustrates a schematic diagram of a framework 300 for generating test text according to some embodiments of the present disclosure. Referring to Figure 3, at 310, the original test text is expanded to a target number. In some embodiments, the target number is a user-defined number of target test texts to be generated. The following will describe in detail with reference to Figure 4A, which illustrates a schematic diagram of a process 400A for generating test text according to some embodiments of the present disclosure. Referring to Figure 4A, the original test text set 410A contains 3 original test texts, and the user-defined target number 420A for the target test text set is 9. Therefore, in order to subsequently combine with the prompt word strategy to generate target test texts, the 3 original test texts in the original test text set 410A can be repeatedly expanded to a set of 9 original test texts as shown in region 430A.

[0049] Returning to Figure 3, at 320, the application scenario of the original test text is determined. It is understood that the application scenario here refers to the specific business area or environment in which these test texts are designed, used, or applied, such as a medical scenario or a legal scenario. In some embodiments, the application scenario can be determined based on the original test text input by the user. For example, if the original test text is "Isn't this one of unjust enrichment and mismanagement?", it can be determined as a legal scenario. In some embodiments, the application scenario can also be determined based on the user's description of the target test text. For example, if the user provides a description of the generated target test text, such as "Generate a set of evaluations related to questions asked by teachers in elementary school math classes," it can be determined as a teaching scenario.

[0050] Referring back to Figure 3, at 330, determine the label corresponding to the original test text. In some embodiments, the label here is the distribution of human language features, such as sentence length, sentence structure, rhetorical devices, superposition errors, etc., or the content attributes of the statement such as topic, domain, language, tone, etc.

[0051] Referring again to Figure 3, at 340, the values ​​and their distribution corresponding to the labels are determined. The following will explain what the values ​​and distribution of the labels are with reference to Figure 4B. Figure 4B shows a schematic diagram of labels, values, and their proportions according to certain embodiments of this disclosure at 400B. Referring to Figure 4B, these labels can be labels 1 "emotion" and "rhetoric." The values ​​of label 1 can be "anger" (20%), "excitement" (20%), "sadness" (20%), and "fear" (40%), while the values ​​of label 2 can be "metaphor" (40%), "contrast" (40%), and "exaggeration" (20%). It is understood that the types and number of labels are not limited, nor are the types of their values. In some embodiments, these labels, values, and proportions can be dynamically adjusted according to the application scenario. In some embodiments, each label is arranged and combined.

[0052] Referring to Figure 4A, in region 440A, the labels matching the application scenario are [Label 1, Label 2], each with its own value. For example, the values ​​for Label 1 are [Value 1, Value 2, Value 3, Value 4, Value 5]. Similarly, the values ​​for Label 2 are [Value 1, Value 2, Value 3, Value 4, Value 5, Value 6, Value 7, Value 8, Value 9]. By combining Label 1 and Label 2, 45 different prompt word strategies can be obtained. It is understandable that the prompt word strategy also includes the distribution ratio of each value. It is also understandable that each value here has its own percentage distribution; for example, the sum of the percentages of all values ​​for Label 1 is 1, and the weight of each value can be dynamically determined according to the application scenario.

[0053] Returning to Figure 3, the prompt word strategy is determined at 350. It is understood that in some embodiments, the target test text is generated using a language model. Therefore, in order to generate target test text that meets the requirements, a prompt word strategy for the target test text can be generated first. Referring to Figure 4A, it can be seen in region 450A that the number of target test texts in the first column is 9. Therefore, 9 suitable combinations of tags need to be selected from region 440A as the prompt word strategy.

[0054] Referring again to Figure 3, at 360°, the target test text is generated. Combined with Figure 4A, the target test text 480A can be generated using language model 470A. As shown in region 460A, in some embodiments, the nine original test texts after repeated expansion and the nine prompt word strategies corresponding to the target number can be fed into language model 470A one by one, thus obtaining the target test text 480A with human natural language attributes.

[0055] By utilizing natural language attributes to generate test text, this method can produce test text that conforms to the variations in human language, meeting testers' needs for the realism of text test sets and thus improving the user experience.

[0056] In some embodiments, the language model 370A can also be trained using the expected value of the original test text and the generated target test text 480A, thereby enabling the language model in the test text generation system to have stronger generalization ability. It is understood that the language model 470A here may be the same as or different from the aforementioned language model used to generate the original test text.

[0057] Figure 5 illustrates a schematic diagram of an interactive page 500 for generating test text according to some embodiments of the present disclosure. Referring to Figure 5, display interface 510 is a schematic diagram of an interface used by a user to generate a target test text set. In display interface 510, the user can input the original test text through the input box in area 520. In some embodiments, the user can also click area 522 to download an evaluation set template, and the user can modify the input, i.e., input the original test text, on the downloaded evaluation set template. It is understood that the original test text must exist here. In some embodiments, after the user fills in the relevant information of the evaluation set template, the user can upload the file to the test text generation system by clicking attachment option 524.

[0058] The following description will be provided with reference to Figure 6, which illustrates a schematic diagram of the effect display 600 for generating test text according to certain embodiments of the present disclosure. Referring to Figure 6, the original test text 610, namely "Barbecue in City A is so popular lately, let's search for authentic restaurants in City B," can be entered into the input box in area 520. Alternatively, it can be filled into the evaluation set template and then uploaded to the test text generation system 620 by clicking the nearby option 524.

[0059] Referring back to Figure 5, in area 530, the user can enter the desired number of target test texts to be generated. Referring to Figure 6, the target number is 6. In area 540, the user can select the type of target test text generation task via a drop-down menu, such as debug mode. It is understood that in debug mode, the generated target test texts are ineffective; only a few sample generated target test texts are displayed.

[0060] Referring back to Figure 5, in area 550, users can click on area 552 to download the evaluation set distribution ratio template. Users can then fill in the distribution ratio of the label values ​​on the downloaded template. It's understood that this evaluation set distribution ratio template already contains pre-filled labels, values, and their ratios. In some embodiments, after filling in the relevant information for the evaluation set distribution ratio template, users can click on area 554 to upload the file to the test text generation system 620. It's understood that the test text generation system 620 uses natural language processing technology to perform text recognition, text processing, and other operations on the uploaded file.

[0061] Referring to Figure 6, for the original test text "Barbecue is so popular in City A lately, let's search for authentic restaurants in City B," possible tags could include language style, emotional tone, trending topics, language, and rich text. See Table 1 below:

[0062] It is understandable that leaving the percentage blank indicates that the label is not selected. In some embodiments, the percentage of the evaluation set distribution template can be predefined in the test text generation system. In some embodiments, the label distribution percentage is not necessarily filled in by the user; it can also be determined by the test text generation system based on the original evaluation set entered by the user in area 520. It is understandable that the labels and their values ​​here are attributes related to human natural language, such as tone, rhetoric, and language.

[0063] Referring back to Figure 5, in area 560, users can further configure the target test text to be generated. For example, by clicking area 562, users can select the semantic proximity of the generated target test text to the original test text in the original evaluation set. "Medium" is the default configuration, meaning that the semantics of the original sentence should be kept as close as possible while satisfying the prompt word strategy. "Close" means satisfying as many rules as possible without changing the semantics of the original sentence, i.e., satisfying the prompt word strategy composed of multiple tags. "Far" means that while satisfying the rule of multiple tag combinations, the divergent function of the language model in the test text generation system is utilized to generate more divergent target test texts. After the user fills in the required information on the display interface 510, they can generate the target test text by clicking the "OK" button. Referring to Figure 6, area 630 displays the six newly generated target test texts.

[0064] This method of generating test text with a single click by utilizing natural language attributes is not only simple to operate, but also generates test text that conforms to the variations of human language. It meets the practical needs of testers for text test sets, improves testing effectiveness, and thus enhances the user experience.

[0065] Figure 7 shows a block diagram of an apparatus 700 for generating test text according to certain embodiments of the present disclosure. As shown in Figure 7, the apparatus 700 may include a value determination module 702 configured to determine the values ​​of tags for the original test text, wherein the tags indicate attributes of natural language. The apparatus 700 may also include a prompt word policy determination module 704 configured to determine a prompt word policy for the original test text based on the values. Furthermore, the apparatus 700 may also include a target test text generation module 706 configured to generate target test text based on the original test text and the prompt word policy.

[0066] In some embodiments, the apparatus 700 further includes: a target quantity acquisition module configured to acquire a target quantity of target test text input by a user; and a first acquisition module configured to acquire the repeated original test text corresponding to the target quantity by repeatedly adding the original test text to the target quantity.

[0067] In some embodiments, the apparatus 700 further includes an application scenario determination module, configured to determine the application scenario of the original test text based on at least one of the original test text or a user's textual description of the target test text.

[0068] In some embodiments, the value determination module 702 includes: a first determination module configured to determine a label for the original test text based on an application scenario; and a second determination module configured to determine the value corresponding to the label and the percentage of the value based on the application scenario and the label, wherein the percentage indicates the weight of the value.

[0069] In some embodiments, the prompt word strategy determination module 704 includes: a third determination module configured to determine a combination consisting of a first label and a second label, wherein the combination includes at least the proportion and value corresponding to the first label and the proportion and value corresponding to the second label.

[0070] In some embodiments, the prompt word strategy determination module 704 further includes: a fourth determination module configured to determine a plurality of prompt word strategies for the original test text based on combinations; and a fifth determination module configured to determine a target number of prompt word strategies from the plurality of prompt word strategies based on a target number.

[0071] In some embodiments, the target test text generation module 706 includes: a generation module configured to generate target test text corresponding to the target number based on the original test text repeated for the target number and a prompt word strategy corresponding to the target number by a language model.

[0072] In some embodiments, the target test text generation module 706 further includes: an expected value acquisition module configured to acquire the expected value of the model for the original test text; and a training module configured to train the language model using the target test text and the expected value for the original test text.

[0073] Figure 8 shows a block diagram of an electronic device 800 according to certain embodiments of the present disclosure. Device 800 may be the device or apparatus described in the embodiments of the present disclosure. As shown in Figure 8, device 800 includes a central processing unit (CPU) and / or a graphics processing unit (GPU) 802, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 804 or loaded from storage unit 816 into random access memory (RAM) 806. Various programs and data required for the operation of device 800 may also be stored in RAM 806. CPU / GPU 802, ROM 804, and RAM 806 are interconnected via bus 808. Input / output (I / O) interface 810 is also connected to bus 808. Although not shown in Figure 8, device 800 may also include a coprocessor.

[0074] Multiple components in device 800 are connected to I / O interface 810, including: input unit 812, such as keyboard, mouse, etc.; output unit 814, such as various types of monitors, speakers, etc.; storage unit 816, such as disk, optical disk, etc.; and communication unit 818, such as network card, modem, wireless transceiver, etc. Communication unit 818 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0075] The various methods or processes described above can be executed by CPU / GPU 802. For example, in some embodiments, the methods may be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 816. In some embodiments, part or all of the computer program may be loaded and / or installed on device 800 via ROM 804 and / or communication unit 818. When the computer program is loaded into RAM 806 and executed by CPU / GPU 802, one or more steps or actions in the methods or processes described above may be performed.

[0076] In some embodiments, the methods and processes described above can be implemented as a computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of this disclosure.

[0077] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0078] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, a local area network (LAN), a wide area network (WAN), and / or a wireless network, to an external computer or external storage device. The network may include copper cables, fiber optic cables, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0079] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​and conventional procedural programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions. This electronic circuitry can execute the computer-readable program instructions to implement various aspects of this disclosure.

[0080] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0081] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0082] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0083] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for generating test text, comprising: Determine the values ​​of labels for the original test text, where the labels indicate attributes of natural language; Based on the values, a prompting word strategy is determined for the original test text; as well as Based on the original test text and the prompt word strategy, a target test text is generated.

2. The method according to claim 1, further comprising: Obtain the target number of test texts input by the user; as well as The original test text is repeated up to the target number of times to obtain the repeated original test text corresponding to the target number.

3. The method according to claim 2, further comprising: The application scenario of the original test text is determined based on at least one of the original test text or the user's textual description of the target test text.

4. The method according to claim 3, wherein determining the value of the tag for the original test text includes: Based on the application scenario, determine the tags for the original test text; and Based on the application scenario and the tag, determine the value corresponding to the tag and the proportion of the value, where the proportion indicates the weight of the value.

5. The method according to claim 4, wherein determining the prompt word strategy for the original test text based on the value includes: A combination consisting of a first label and a second label is determined, wherein the combination includes at least the proportion and value corresponding to the first label and the proportion and value corresponding to the second label.

6. The method according to claim 5, further comprising: Based on the combination, multiple prompt word strategies are determined for the original test text; as well as Based on the target number, the prompt word strategy for the target number is determined from the plurality of prompt word strategies.

7. The method according to claim 6, wherein generating the target test text based on the original test text and the prompt word strategy comprises: The language model generates target test text corresponding to the target number based on the original test text repeated for the target number and the prompt word strategy corresponding to the target number.

8. The method according to claim 7, further comprising: Obtain the expected value of the model for the original test text; as well as The language model is trained using the target test text and the expected value.

9. The method according to claim 1, further comprising: The original test text is generated by the language model based on the user's text input.

10. An apparatus for generating test text, comprising: The value determination module is configured to determine the value of a tag for the original test text, the tag indicating an attribute of natural language; The prompt word strategy determination module is configured to determine the prompt word strategy for the original test text based on the value. as well as The target test text generation module is configured to generate target test text based on the original test text and the prompt word strategy.

11. An electronic device, comprising: processor; as well as A memory coupled to the processor, the memory having instructions stored therein, which, when executed by the processor, cause the electronic device to perform the method according to any one of claims 1 to 9.

12. A computer-readable storage medium having stored thereon computer-executable instructions, wherein the computer-executable instructions are executed by a processor to implement the method according to any one of claims 1 to 9.

13. A computer program product tangibly stored on a non-volatile computer-readable medium and comprising computer-executable instructions that, when executed, cause a computer to perform the steps of the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Model pre-training method and device, equipment, storage medium and program product

    CN113962315A

  • Content generation method and device, computer equipment and storage medium

    CN117171369A

  • Method for generating feature tags and cue words required by computer painting

    CN117312659A

  • Knowledge entry generation method and device, equipment and storage medium

    CN117349425A

  • Method for pre-training model, device, and storage medium

    US20230040095A1