Prompt word processing method, device, electronic device and storage medium
By loading and displaying prompt words and their test results in natural language processing technology, the problem of difficult tracking of prompt word effects is solved, the generation efficiency and quality are improved, and the accuracy of the model output and the satisfaction of user needs are ensured.
Patent Information
- Application Number
- CN202311340790.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-16
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2043-10-16
AI Technical Summary
In natural language processing technology based on large models, existing technology is difficult to accurately track and optimize the effect of prompt words, resulting in low generation efficiency and poor rationality, which affects the effectiveness of the model.
A prompt word processing method is provided. By loading the target prompt word and displaying the prompt word text and test results in the debugging interface, the test results are used to determine whether the prompt word meets the target requirements, so as to achieve rapid optimization and improvement of the prompt word.
It improves the quality and efficiency of prompt word generation, simplifies the optimization process, and ensures the accuracy of model output and the satisfaction of user needs.
Smart Images

Figure CN117666812B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of natural language processing technology in the field of artificial intelligence, and in particular to a prompt word processing method, device, electronic device and storage medium. Background Art
[0002] Currently, natural language processing technology based on large models is widely used in many application scenarios such as semantic search and intelligent assistants, realizing more convenient and efficient human-computer interaction and information processing functions.
[0003] By inputting prompts into the model, the effect of guiding the model output can be achieved, but how to efficiently generate reasonable prompts is a problem that needs to be solved urgently. Summary of the invention
[0004] The present invention provides a prompt word processing method, device, electronic device and storage medium.
[0005] According to a first aspect of the present disclosure, a prompt word processing method is provided, comprising:
[0006] In response to the first instruction, a target prompt word is loaded, wherein the target prompt word is used to guide the target model to generate output information that meets the target requirements; in the first debugging interface, a prompt word text and a corresponding test result of the target prompt word are displayed, wherein the content of the prompt word text includes a natural language description of the target requirements, and the test result is used to characterize whether the output information generated by the target model based on the prompt word text meets the target requirements.
[0007] According to a second aspect of the present disclosure, a prompt word processing device is provided, comprising:
[0008] A first response unit is used to load a target prompt word in response to a first instruction, wherein the target prompt word is used to guide the target model to generate output information that meets the target requirements; a first processing unit is used to display a prompt word text and a corresponding test result of the target prompt word in a first debugging interface, wherein the content of the prompt word text includes a natural language description of the target requirements, and the test result is used to characterize whether the output information generated by the target model based on the prompt word text meets the target requirements.
[0009] According to the third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the first aspect of the present disclosure.
[0010] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect of the present disclosure.
[0011] According to a fifth aspect of the present disclosure, a computer program product is provided, the computer program product comprising: a computer program, which implements the method described in the first aspect of the present disclosure when executed by a processor.
[0012] According to the technology disclosed in the present invention, the generation quality and generation efficiency of prompt words are improved.
[0013] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0015] Figure 1 A flowchart of a prompt word processing method provided according to an embodiment of the present disclosure;
[0016] Figure 2 A schematic diagram of a prompt word adding page provided in an embodiment of the present disclosure;
[0017] Figure 3 A schematic diagram of a process for generating test results provided by an embodiment of the present disclosure;
[0018] Figure 4 A schematic diagram of a first debugging interface provided by an embodiment of the present disclosure;
[0019] Figure 5 A schematic diagram of another process for generating test results provided by an embodiment of the present disclosure;
[0020] Figure 6 A schematic diagram of another first debugging interface provided by an embodiment of the present disclosure;
[0021] Figure 7 A schematic diagram of another first debugging interface provided by an embodiment of the present disclosure;
[0022] Figure 8 A flowchart of a prompt word processing method provided according to an embodiment of the present disclosure;
[0023] Fig. 9 is a flowchart of a specific implementation method of step S806;
[0024] Fig.10 A flow chart of processing a target prompt word provided by an embodiment of the present disclosure;
[0025] Fig.11 A structural block diagram of a prompt word processing device provided in an embodiment of the present disclosure;
[0026] Fig.12 It is a block diagram of an electronic device used to implement the prompt word processing method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0028] Currently, in natural language processing technology based on large models, by inputting prompt words into the model, the model output can be guided, so that the content of the model output is more accurate and more in line with user needs. However, based on the implementation principle of the large model, the internal process of processing prompt words is opaque. Therefore, the effect of the prompt words can usually only be evaluated by the actual output content of the model after the prompt words are input into the model. Since it is difficult to accurately track the effect of prompt words in the existing technology, prompt words are difficult to optimize and even negative optimization occurs, which leads to low generation efficiency of prompt words and poor rationality of prompt words, affecting the use effect of the model.
[0029] The present invention provides a prompt word processing method, device, electronic device and storage medium, which are applied to the field of natural language processing technology in the field of artificial intelligence to achieve the effect of improving the efficiency and quality of prompt word generation.
[0030] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0031] In order to enable readers to more deeply understand the implementation principle of the present disclosure, the following Figure 1-Figure 12 The embodiments are further introduced and refined.
[0032] Figure 11 is a flow chart of a prompt word processing method provided according to an embodiment of the present disclosure, and the method can be executed by a prompt word processing device. More specifically, for example, the method can be executed by a terminal device or a server provided with the prompt word processing device, such as Figure 1 As shown, illustratively, the method comprises the following steps:
[0033] S101. In response to a first instruction, a target prompt word is loaded, where the target prompt word is used to guide a target model to generate output information that meets a target requirement.
[0034] Exemplarily, a terminal device is used as the execution subject of the method of the embodiment of the present disclosure. The terminal device displays an interactive interface by running a target application for managing the prompt word project, wherein the target application can be a client or a browser based on the software implementation architecture. Afterwards, in response to the first instruction input by the user for the interactive interface, the target prompt word is loaded, wherein the prompt word is a prompt information of an input model to describe the demand, thereby achieving the purpose of guiding the model to output specific content, which can be a question, a text description, or even a text description with a bunch of parameters. In short, it is used to "tell the model what to do and how to do it", thereby improving the model performance and performance. In the steps of this embodiment, the target prompt word is a prompt word determined based on the first instruction, which is used to guide the corresponding target model to generate output information that meets the target requirements, for example, the target prompt word P1, which is used to guide the model to summarize the user attribute At_1 according to the user input. Among them, the (target) prompt word is a collection of multiple information, which is stored in the form of "project, task", for example. In addition to the specific prompt word text, the target prompt word also includes the target model to which it is applicable, and the prompt word identification and other information. Therefore, the loading of the target prompt word in the steps of this embodiment can also be understood as loading the target prompt word item, so as to obtain the identifier corresponding to the target prompt word, the prompt word text and the applicable target model.
[0035] Furthermore, the specific implementation method of loading the target prompt word at least includes creating a new prompt word or selecting an existing prompt word. In one possible implementation method, in the interactive interface of the target application, the user clicks the "New Prompt Word" control to make the terminal device display a prompt word adding page for creating a new prompt word, and then in response to the first instruction input by the user, obtains the prompt word identifier, the prompt word text content, and the target model applicable to the prompt word, thereby generating the target prompt word. In another possible implementation method, at least one created prompt word is displayed in the interactive interface of the target application, and then, in response to the first instruction input by the user, one of them is selected and loaded as the target prompt word.
[0036] Figure 2A schematic diagram of a prompt word adding page provided in an embodiment of the present disclosure, such as Figure 2 As shown, there are 4 controls for inputting information in the prompt word adding page, which are respectively shown as control #1, control #2, control #3, control #4, and a "new prompt word" control for triggering the action of creating a new prompt word. Among them, control #1 is used to input the prompt word title; control #2 is used to input the system prompt; control #3 is used to input the user prompt; control #4 is used to input the target model; among them, the system prompt corresponds to the first text segment in the prompt word text, and the user prompt corresponds to the second text segment in the prompt word text. The first text segment is used to represent the data format of the output information; the second text segment is used to represent the logic for processing the input information to meet the target requirements. After the terminal device responds to the first instruction and configures the above controls #1 to #4, the "new prompt word" control is triggered, thereby completing the process of creating a new prompt word, that is, the implementation process of obtaining the target prompt word.
[0037] S102. Displaying the prompt word text of the target prompt word and the corresponding test result in the first debugging interface, wherein the content of the prompt word text includes a natural language description of the target requirement, and the test result is used to characterize whether the output information generated by the target model based on the prompt word text meets the target requirement.
[0038] Exemplarily, after responding to the first instruction to load the target prompt word, the test result corresponding to the prompt word text of the target prompt word is displayed in the first debugging interface of the target application, wherein, on the one hand, the prompt word text, that is, the main content of the target prompt word, includes a natural language description of the target requirements, thereby guiding the model to output output information that meets the above target requirements. In a possible implementation, the prompt word text includes static text, such as "get the current date", which will not be described in detail.
[0039] In another possible implementation, the prompt word text includes at least one input parameter, and the input parameter is used to characterize the input information for the target model, and the target requirement is achieved by processing the input information. For example, the prompt word text includes the following content: "Summarize the main idea of the paragraph {user input}". Among them, "user input" is the input parameter, such as the information input by the user when using functions such as "smart assistant" and "semantic search". After the target model processes the "user input" based on the prompt word text, the content output is the output information that meets the target requirement, that is, the descriptive text of the main idea of the "user input". Among them, the prompt word text is based on natural language, which is convenient for developers to design and modify the prompt word text.
[0040] Further, in a possible implementation, the prompt word text includes at least a first text segment and / or a second text segment, wherein the first text segment is used to characterize the data format of the output information; the second text segment is used to characterize the logic for processing the input information to meet the target requirements; the prompt word text is displayed in plain text or markup language format. Specifically, for example, the content of the first text segment is "output in Json format file"; the content of the second text segment is "#Your role is a robot for intention recognition and information extraction. You can extract user needs from the sentence {user input}, and user needs include..." etc. Among them, the markup language is, for example, markdown, which is a lightweight markup language that characterizes the text format through specified identifiers, thereby realizing text formatting. The representation method of the above prompt word text can be controlled by a preset control, so that the prompt word text is represented based on plain text or markup language, and the specific implementation method will not be repeated. At the same time, it can be understood that the content of the above first text segment and the second text segment is only exemplary, and the specific content is not limited.
[0041] On the other hand, the test result is the result of the effect test performed by the terminal device on the prompt word text, that is, whether the output information generated by the target model based on the prompt word text meets the above-mentioned target requirements. Among them, in one possible implementation method, the test result is obtained after the terminal device calls the target model based on the prompt word text for testing. Based on the location where the target model is deployed, the test process is executed on the terminal device side, and can also be executed on other servers outside the terminal device. In a possible implementation method, before displaying the test result corresponding to the target prompt word, it also includes a step of automatically testing the target prompt word to generate a test result. For example, Figure 3 A flow chart of generating test results provided by an embodiment of the present disclosure is as follows: Figure 3 As shown, including:
[0042] Step S1011: Obtain the target test case corresponding to the target prompt word.
[0043] Step S1012: Obtain test results based on the target model and the target test case.
[0044] Exemplarily, after determining the target prompt word, the corresponding target test case is obtained based on the prompt word name of the target prompt word, or the prompt word identification number. Wherein, the test case is a pre-generated script program for testing the prompt word, and the test case contains preset input information and corresponding expected output. After obtaining the corresponding target test case based on the identification information of the target prompt word, based on the input information in the target test case, combined with the target prompt word, it is input as input data into the target model, and the output information of the target model is obtained (for example, obtained by intercepting the Json file output by the target model). Afterwards, the test result is obtained by comparing the expected output in the output information and the target test case. Wherein, the implementation and triggering process of the test case are prior art known to those skilled in the art, and its specific implementation method is not repeated here.
[0045] Figure 4 A schematic diagram of a first debugging interface provided by an embodiment of the present disclosure is shown as follows: Figure 4 As shown, exemplarily, the first debugging interface 400 includes a first area 401 and a second area 402, wherein the first area 401 is used to display the prompt word text of the target prompt word, and the second area 402 is used to display the test result. As shown in the reference figure, when the target prompt word prompt#1 is loaded, the prompt word text of the prompt#1 is displayed in the first area of the first debugging interface, which, for example, at least includes the following content:
[0046] “Summarize the main idea of {user input}.”
[0047] At the same time or afterwards, the test result is displayed in the second area of the first debugging interface, such as "success: true" as shown in the figure.
[0048] The test result indicates that the output information generated by the target model based on the prompt word text meets the target requirements. On the contrary, if the test result is "success: false", it indicates that the output information generated by the target model based on the prompt word text does not meet the target requirements. The above test results are obtained after the terminal device performs automated testing based on the target test case corresponding to the target prompt word. The test process can be executed locally on the terminal device or on an external server. For details, see Figure 3 Introduced in the illustrated embodiment.
[0049] In another possible implementation, the input parameters in the prompt text can be obtained by manually triggering the developer user. Figure 5 Another flow chart of generating test results provided by the embodiment of the present disclosure is as follows: Figure 5 As shown, including:
[0050] Step S1013: In response to the second instruction, obtain target input information corresponding to the input parameter.
[0051] Step S1014: Get the test result based on the target input information and the prompt word text.
[0052] For example, in one possible implementation, the second instruction is used to indicate a target test case corresponding to the target prompt word, that is, through the second instruction input by the user, the target test case corresponding to the target prompt word is obtained, and the target input information is obtained based on the target test case. Figure 4 The embodiment shown has been described in detail and will not be described here. In another possible implementation, the second instruction is used to input a target character string, i.e., a manually configured input parameter. Afterwards, the target prompt word is automatically tested to generate a test result.
[0053] Figure 6 A schematic diagram of another first debugging interface provided by an embodiment of the present disclosure, such as Figure 6 As shown, the first debugging interface 600 includes a first area 601 and a second area 602. In the second area 602, a control for inputting target input information corresponding to the target parameter is provided, which is shown as an editable text box 603 in the figure. The developer user can operate the control to input the target input information, which is shown as "XXXXXXXXXX" in the figure. Afterwards, the terminal device obtains the target input information, and based on the target input information, inserts the target parameter of the prompt word text to generate a model input, wherein the target parameter is, for example, "user input" in the prompt word text, and correspondingly, the model input is the text "summarize the central idea of the paragraph XXXXXXXXXX". Furthermore, by clicking the "test" control in the second area for triggering the test function for the target prompt word, the terminal device obtains the test result based on the target model and the prompt word text of the inserted input information.
[0054] Furthermore, based on the input parameters manually configured by the developer and the generated output information, the test case corresponding to the target prompt word can be saved. The above process can be executed by a user trigger operation, specifically, in response to the third instruction, a test case corresponding to the target prompt word is generated according to the target input information and the output information corresponding to the target input information. This enables rapid generation of test cases and improves the reuse rate of test cases.
[0055] Afterwards, based on the test results displayed in the first debugging interface, the developer user can use this to determine whether the currently loaded target prompt word is reasonable, and then modify and optimize it if it is unreasonable (does not meet the target requirements); or, if it is reasonable (meets the target requirements), save it as an adaptation prompt word for the target model so that the target model can complete the function guided by the target prompt word.
[0056] Furthermore, in order to more clearly demonstrate the effect of the target prompt word, the first output information generated by the target model based on the prompt word text can be displayed in the first debugging interface while displaying the final test result. The first output information is used to compare with the expected output in the target test case to obtain the above test result. Among them, the target requirement includes at least one sub-requirement; the first output information includes at least one output parameter, and the output parameter represents the result of processing the input parameter in the prompt word text based on the sub-requirement.
[0057] Figure 7 A schematic diagram of another first debugging interface provided by an embodiment of the present disclosure is shown as follows: Figure 7 As shown, the first debugging interface 700 includes a first area 701 and a second area 702, and the target requirement includes sub-requirement #1, sub-requirement #2, and sub-requirement #3. The above sub-requirements are respectively described in the prompt word text of the target prompt word prompt#1 displayed in the first area 701, with text segments p1, p2, and p3. Specifically, for example, as shown in the figure, the prompt word text includes a text segment p0 for limiting the "task role", and its content is "You are a senior information delivery optimizer who can extract [attribute At_1] directional information from {user input}". Among them, the content in the text box 703 is the target input information corresponding to the input parameter, "I want to deliver to people above N1".
[0058] Furthermore, the content of text segment p1 is: "[attribute At_1] is a range, including the start attribute Begin and the end attribute End." The content of text segment p2 is: "The start attribute Begin and the end attribute End are obtained from {user input}." The content of text segment p3 is: "If {user input} includes "below", the start attribute Begin is 18; if {user input} includes "above", the start and end attributes End are 99."
[0059] Correspondingly, based on the above prompt text, the first output information is displayed in the second area 702 of the first debugging interface 700, and the first output information includes output parameter para_1: "Begin=N1" and output parameter para_2: "End=99".
[0060] In the steps of this embodiment, the purpose of displaying the execution status of the sub-requirements corresponding to the prompt word text is achieved by further displaying the first output information including at least one output parameter in the first debugging interface, thereby further improving the test effect of the target prompt word and providing a basis for subsequent optimization of the target prompt word.
[0061] In the disclosed embodiment, by responding to the first instruction, the target prompt word is loaded, and the target prompt word is used to guide the target model to generate output information that meets the target requirements; in the first debugging interface, the prompt word text and the corresponding test results of the target prompt word are displayed, wherein the content of the prompt word text includes a natural language description of the target requirements, and the test results are used to characterize whether the output information generated by the target model based on the prompt word text meets the target requirements. Since the test results corresponding to the target prompt word can be displayed while the target prompt word is loaded, the developer user can quickly judge the quality of the target prompt word, and then directly save or modify it, simplifying the process steps of the prompt word optimization process, improving the efficiency of prompt word generation and optimization, and improving the quality of the prompt word.
[0062] Figure 8 FIG. 1 is a flow chart of a prompt word processing method provided according to an embodiment of the present disclosure. This embodiment is an optional embodiment based on the above embodiment. Figure 8 As shown, the method comprises the following steps:
[0063] S801. In response to a first instruction, a target prompt word is loaded, where the target prompt word is used to guide a target model to generate output information that meets target requirements.
[0064] S802: Display a test case set for the target prompt word, where the test case set includes at least two candidate test cases, wherein the candidate test cases are used to verify whether a target output parameter in the first output information generated based on the prompt word text has an expected parameter value.
[0065] S803: In response to the fourth instruction, determine a target test case from at least two candidate test cases.
[0066] Exemplarily, after loading the target prompt word, the terminal device can automatically or based on user triggering display the test case set for the target prompt word, wherein the test case set includes multiple alternative test cases, similar to the introduction of the test case in the previous embodiment, the alternative test case includes input information and corresponding expected output, for example, the alternative test case is test case Case_1, and the test case Case_1 contains input information #1, whose content is "I want to deliver to people above N1", and correspondingly, the expected output in the test case Case_1 is "Begin = N1" and "End = 99". Among them, "Begin" and "End" are the target output parameters in the first output information generated by the prompt word text, and "N1" and "99" are the expected parameter values corresponding to the target output parameters. When the test case Case_1 responds to the fourth instruction and is selected as the target test case, it will be tested based on the input information "I want to deliver it to people above N1" in the test case Case_1 and the prompt word text as the model input, and obtain the corresponding first output information, and then verify whether the parameter value of the target output parameter in the first output information is consistent with the expected parameter value of the expected output in the test case Case_1, so as to achieve the purpose of performing automated testing on the target prompt word.
[0067] Optionally, before step S802, the method further includes:
[0068] Step S800: Obtain a first auxiliary prompt word, and automatically generate a target test case based on the first auxiliary model and the first auxiliary prompt word, wherein the first auxiliary prompt word is used to characterize a rule for generating a test case matching the target prompt word based on the first auxiliary model.
[0069] Exemplarily, in one possible implementation, the above-mentioned alternative test cases can be those extracted and written by the developer user and predicted on the terminal device or server, and the terminal device can directly obtain them based on the identification of the target prompt word. In another possible implementation, the above-mentioned alternative test cases are automatically generated based on the first auxiliary model. Among them, exemplarily, the first auxiliary model is a pre-trained model for generating test cases, which is guided by the first auxiliary prompt word so that the first auxiliary model can generate test cases that match the target prompt word. Furthermore, the first auxiliary prompt word is used to characterize the rules for generating test cases that match the target prompt word based on the first auxiliary model. Among them, the specific implementation method of the first auxiliary model is not limited here.
[0070] In the steps of this embodiment, by obtaining the first auxiliary prompt word, and dynamically generating a test case matching the target prompt word based on the first auxiliary model and the first auxiliary prompt word, accurate testing of the target prompt word is achieved. In the scenario applied by this embodiment, since the target prompt word can be dynamically modified based on user operations, the pre-generated test case may have the problem of inaccurate test results due to the modification of the target prompt word, and the steps of this embodiment further improve the test accuracy of the target prompt word by dynamically generating a test case matching the target prompt word.
[0071] S804: Obtain first output information based on the target model and the target test case.
[0072] S805: Obtain a test result according to the expected output information and the first output information corresponding to the target test case.
[0073] Exemplarily, after obtaining the target test case, the target prompt word is tested based on the target test case and the corresponding target model to obtain the first output information output by the target model. The specific implementation method of the first output information has been introduced in the previous embodiment and will not be repeated here.
[0074] Afterwards, the terminal device compares the expected output information and the first output information contained in the target test case to obtain the test result. Among them, in one possible implementation, when the contents of the expected output information and the first output information are expressed in the form of parameter values, the test result can be obtained by comparing the consistency of the parameter values of the two. For example, the output parameter para_1 in the expected output information is N, and the output parameter para_1 in the first output information is M. If N is equal to M, it means that the two are consistent, and the test result is that the output information generated by the target model based on the prompt word text meets the requirements, that is, the test passes; conversely, if N is not equal to M, the test fails. In another possible implementation, when the contents of the expected output information and the first output information are expressed in the form of text, they can be further compared semantically. Specifically, for this case, the specific implementation process of step S805 includes:
[0075] S8051. Obtain a first language model, where the first language model is used to determine the consistency of at least two input texts based on semantics.
[0076] S8052: Based on the first language model, process the expected output information and the first output information corresponding to the target test case to obtain the test result.
[0077] Exemplarily, the first language model is a model with a semantic extraction function, or a model with a functional unit that can realize the semantic extraction function. The semantics of the expected output information and the first output information are respectively extracted through the first language model, and compared from the semantic dimension to obtain the test result, thereby avoiding the misjudgment problem caused by the same semantics but different description methods, and improving the accuracy of the test result when the content of the expected output information and the first output information are expressed in text form.
[0078] Of course, it can be understood that the above two methods of obtaining test results can be executed independently or simultaneously, that is, the first output information expressed in text form is processed by the first language model, and the first output information expressed in parameter value form is processed by numerical consistency comparison. The specific implementation method is set according to specific needs and is not limited here.
[0079] S806: Display the prompt word text of the target prompt word and the corresponding test result in the first debugging interface.
[0080] The specific implementation method of displaying the prompt word text and the corresponding test results in the first debugging interface is as follows: Figure 1 This has been introduced in the illustrated embodiment and will not be described again in detail here.
[0081] In a possible implementation, the target test case includes at least two sub-test cases. The specific implementation of step S804 includes: based on the at least two sub-test cases, obtaining the first output result corresponding to each sub-test case. Correspondingly, the specific implementation of step S805 includes: according to the first output result corresponding to each sub-test case, obtaining the test pass rate corresponding to the target prompt word; according to the test pass rate, obtaining the test result.
[0082] Specifically, when the target test case includes multiple sub-test cases, in order to further improve the test accuracy, the target prompt words can be tested in turn through multiple test cases to obtain corresponding multiple first output results. The specific implementation method is the same as the process of generating the first output result in the previous step, and will not be repeated. Afterwards, by comparing each first output result with the corresponding expected output information in the sub-test case, the sub-test result corresponding to each sub-test case is obtained. The sub-test result, for example, includes first information representing "pass" and second information representing "fail". Afterwards, based on the ratio of the first information and the second information, the test pass rate is obtained, and the test result is obtained based on the test pass rate. For example, if the test pass rate is greater than or equal to the pass rate threshold, the test result is "passed"; otherwise, it is "failed".
[0083] Optionally, after step S806, the following step further includes:
[0084] S807: Displaying the optimized text corresponding to the prompt word text, wherein the content of the optimized text includes optimization suggestions for the prompt word text and / or the result of sentence optimization for the prompt word text.
[0085] Exemplarily, after generating and displaying the test result corresponding to the target prompt word, when the test result represents "failed" in the form of a Boolean value, or the test result represents the rationality of the target prompt word in percentage form when it is lower than a threshold, the terminal device can further display the optimization text corresponding to the prompt word text, thereby providing modification suggestions to the developer user, or directly modifying the unreasonable content in the prompt word text. Specifically, in a possible implementation, the optimization text includes modification suggestions for the target prompt word, for example, in the first debugging interface, the following optimization text is displayed:
[0086] "Suggestion 1: There is ambiguity. What should be done if the user input contains both "above" and "below"? This needs to be clearly stated in the prompt text."
[0087] “Suggestion 2: There is a lack of consideration of boundary cases. If the user input does not contain "above" or "below", what should be done? Additional examples are needed.”
[0088] In another possible implementation, the optimized text includes the modification result for the target prompt word, which may include the modified content for the target prompt word and the corresponding modification mark, etc. No more examples are given. Of course, the optimized text may also include the above two implementations at the same time, that is, including modification suggestions for part of the content in the prompt word text and the modification result of part of the content.
[0089] Furthermore, step 807 is used to automatically optimize the target prompt word according to the specific situation of the test result after the test result is generated. Fig. 9 As shown, the specific implementation of step S807 includes:
[0090] S8071. Obtain a second auxiliary prompt word, where the second auxiliary prompt word is used to represent a rule for generating an optimized text for the prompt word text based on a second auxiliary model.
[0091] S8072: Generate an optimized text corresponding to the prompt word text based on the second auxiliary model and the second auxiliary prompt word.
[0092] S8073. Display optimized text.
[0093] Exemplarily, the modification process for the prompt word text can be generated by a pre-trained second auxiliary model, wherein the second auxiliary model is used to generate a corresponding optimized text based on the second auxiliary prompt word according to the input prompt word text, and the second auxiliary prompt word is used to characterize the rules for generating the optimized text for the prompt word text based on the second auxiliary model. Similar to the first auxiliary model, the second auxiliary model is a pre-trained model for optimizing the prompt word text, which is guided by the second auxiliary prompt word so that the second auxiliary model can identify the ambiguous, conflicting, and unclear text parts in the prompt word text, and modify or generate suggestions for the text parts, and then output the optimized text corresponding to the prompt word text.
[0094] In the steps of this embodiment, an optimized text is generated by using the second auxiliary model and the second auxiliary prompt word, and the prompt word text is modified and optimized based on the optimized text, thereby further improving the quality of the target prompt word and improving the iterative optimization efficiency of the prompt word.
[0095] Optionally, after step S807, the method further includes:
[0096] S808: In response to the fifth instruction, modify the first text segment and / or the second text segment in the prompt word text to generate an optimized prompt word text.
[0097] S809: In the second debugging interface, display the prompt word text and the optimized prompt word text based on paragraph comparison.
[0098] Exemplarily, based on specific user needs, the terminal device can modify the prompt word text according to the fifth quality input by the corresponding user, for example, modify the first text segment and / or the second text segment in the prompt word text to generate an optimized prompt word text, thereby generating an optimized prompt word text. Steps (S807-S808) of this embodiment can be performed after step S806, that is, based on the optimized text generated and displayed in the above steps, the prompt word text corresponding to the target prompt word is optimized in combination with the automatically generated modification suggestions to generate an optimized prompt word text. Of course, in another possible implementation, steps (S807-S808) of this embodiment can also be performed at any time after loading the target prompt word (step S801), which is not specifically limited here.
[0099] Specifically, in response to the fifth instruction, after the first text segment and / or the second text segment in the prompt word text is modified, the prompt word text and the optimized prompt word text can be displayed in the second calling interface based on paragraph comparison, that is, the prompt word text and the optimized prompt word text are aligned line by line, and the difference in content between the two is displayed in the same line. Exemplarily, the difference in content between the two is displayed in a highlighted manner.
[0100] Fig.10 A flowchart of processing a target prompt word provided in an embodiment of the present disclosure is shown below in combination with Fig.10 For a more detailed description of the above embodiments, refer to Fig.10 As shown, first, in response to the first instruction, the target prompt word is loaded in the first calling interface. Afterwards, based on, the first auxiliary prompt word is obtained, and the first auxiliary prompt word is used to guide the first auxiliary model to generate a test case set containing multiple alternative test cases; afterward, in response to the fourth instruction, the target test case is determined; afterward, in response to the second instruction, the target input information is obtained. Afterwards, based on the target model and the target test case, the first output information is obtained, and the first output information and the expected output information are compared according to the first language model to obtain and display the test results; afterward, based on the second auxiliary prompt word and the second auxiliary prompt word, the optimized text corresponding to the prompt word text is generated, and afterward, in response to the fifth instruction, the prompt word text is modified to generate the optimized prompt word text, and the prompt word text and the optimized prompt word text are displayed based on the paragraph comparison in the second debugging interface.
[0101] In this embodiment, the target prompt words are loaded, tested, and optimized in a process-based manner through an interactive interface based on the terminal device, thereby realizing multiple functional links of rapid creation, real-time testing, and automatic optimization of the target prompt words, so that the creation and optimization of model prompt words can be completed independently based on a single terminal device, and the efficiency of model prompt word creation and iterative optimization is improved, the quality of model prompt words is improved, and thus the model performance is improved.
[0102] Of course, it is understandable that the method provided in the above embodiments of the present disclosure can also be executed by other electronic devices such as servers. For example, the data processing steps in the above embodiments are executed by the server, and the information generated in each step is sent to the terminal device for display, so as to implement each step in the above embodiments. The implementation process and principle are similar to those when the terminal device is the execution subject, and will not be repeated.
[0103] Corresponding to the prompt word processing method of the above embodiment, Fig.11 This is a structural block diagram of a prompt word processing device provided by an embodiment of the present disclosure. For the sake of convenience, only the part related to the embodiment of the present disclosure is shown. Fig.11 , the prompt word processing device 1100 includes:
[0104] The first response unit 1101 is used to load a target prompt word in response to a first instruction, where the target prompt word is used to guide the target model to generate output information that meets the target requirement;
[0105] The first processing unit 1102 is used to display the prompt word text of the target prompt word and the corresponding test result in the first debugging interface, wherein the content of the prompt word text includes a natural language description of the target requirements, and the test result is used to characterize whether the output information generated by the target model based on the prompt word text meets the target requirements.
[0106] In some embodiments, the prompt word text includes at least one input parameter, and the input parameter is used to characterize input information for the target model, and the target requirement is achieved by processing the input information.
[0107] In some embodiments, the prompt word processing device 1100 also includes: a second response unit, used to obtain target input information corresponding to the input parameter in response to a second instruction; and obtain a test result based on the target input information and the prompt word text; wherein the second instruction is used to indicate a target test case corresponding to the target prompt word, or to input a target character string.
[0108] In some embodiments, the prompt word processing device 1100 further includes: a third response unit, configured to generate a test case corresponding to the target prompt word according to the target input information and the output information corresponding to the target input information in response to a third instruction.
[0109] In some embodiments, the prompt word processing device 1100 also includes: a second processing unit 1102, which is used to display the first output information generated by the target model based on the prompt word text in the first debugging interface; wherein the target requirement includes at least one sub-requirement; the first output information includes at least one output parameter, and the output parameter represents the result of processing the input parameter in the prompt word text based on the sub-requirement.
[0110] In some embodiments, the first processing unit 1101 further includes: a first processing module for acquiring a target test case corresponding to the target prompt word; and a second processing module for obtaining a test result based on the target model and the target test case.
[0111] In some embodiments, the second processing module includes: a first sub-processing module, used to obtain first output information based on the target model and the target test case; a second sub-processing module, used to obtain the test result according to the expected output information and the first output information corresponding to the target test case.
[0112] In some embodiments, the second sub-processing module is specifically used to: obtain a first language model, the first language model is used to determine the consistency of at least two input texts based on semantics; based on the first language model, process the expected output information and the first output information corresponding to the target test case to obtain the test result.
[0113] In some embodiments, the first processing module includes: a third sub-processing module, used to display a test case set for a target prompt word, the test case set including at least two alternative test cases, wherein the alternative test cases are used to verify whether the target output parameter in the first output information generated based on the prompt word text has an expected parameter value; in response to a fourth instruction, determining the target test case from the at least two alternative test cases.
[0114] In some embodiments, the first processing module includes: a fourth sub-processing module, used to obtain a first auxiliary prompt word, the first auxiliary prompt word is used to characterize the rules for generating a test case matching the target prompt word based on the first auxiliary model; based on the first auxiliary model and the first auxiliary prompt word, automatically generate alternative test cases.
[0115] In some embodiments, the target test case includes at least two sub-test cases; the second processing module includes: a fifth sub-processing module, used to obtain the first output result corresponding to each sub-test case based on at least two sub-test cases; a sixth sub-processing module, used to obtain the test pass rate corresponding to the target prompt word according to the first output result corresponding to each sub-test case; and a seventh sub-processing module, used to obtain the test result according to the test pass rate.
[0116] In some embodiments, at least one of the following items is included: the prompt word text includes at least a first text segment and / or a second text segment, wherein the first text segment is used to represent the data format of the output information; the second text segment is used to represent the logic for processing the input information to meet the target requirements; the prompt word text is displayed in plain text or markup language format.
[0117] In some embodiments, the prompt word processing device 1100 also includes: a fourth response unit, which is used to modify the first text segment and / or the second text segment in the prompt word text in response to the fifth instruction to generate an optimized prompt word text; in the second debugging interface, the prompt word text and the optimized prompt word text are displayed based on paragraph comparison.
[0118] In some embodiments, the prompt word processing device 1100 further includes: a third processing unit, which is used to display an optimized text corresponding to the prompt word text, wherein the content of the optimized text includes optimization suggestions for the prompt word text and / or the result of sentence optimization of the prompt word text.
[0119] In some embodiments, the third processing unit includes: a third processing module, used to obtain a second auxiliary prompt word, the second auxiliary prompt word is used to characterize the rule of generating an optimized text for the prompt word text based on the second auxiliary model; a fourth processing module, used to generate an optimized text corresponding to the prompt word text based on the second auxiliary model and the second auxiliary prompt word.
[0120] Fig.11 The provided prompt word processing device can execute the steps involved in the above-mentioned corresponding method embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0121] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0122] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the solution provided by any of the above embodiments.
[0123] According to an embodiment of the present disclosure, the present disclosure further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute a solution provided by any of the above embodiments.
[0124] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.
[0125] Fig.12 A schematic block diagram of an example electronic device 1200 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0126] like Fig.12As shown, the device 1200 includes a computing unit 1201, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1202 or a computer program loaded from a storage unit 12012 into a random access memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the device 1200 can also be stored. The computing unit 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0127] A number of components in the device 1200 are connected to the I / O interface 1205, including: an input unit 1206, such as a keyboard, a mouse, etc.; an output unit 1207, such as various types of displays, speakers, etc.; a storage unit 12012, such as a disk, an optical disk, etc.; and a communication unit 1209, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1209 allows the device 1200 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0128] The computing unit 1201 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1201 performs the various methods and processes described above, such as the prompt word processing method. For example, in some embodiments, the prompt word processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 12012. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1200 via the ROM 1202 and / or the communication unit 1209. When the computer program is loaded into the RAM 1203 and executed by the computing unit 1201, one or more steps of the prompt word processing method described above may be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured to execute the prompt word processing method in any other appropriate manner (eg, by means of firmware).
[0129] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0130] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0131] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0132] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0133] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0134] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0135] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0136] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A prompt word processing method, include: In response to the first instruction, a target prompt word is loaded, wherein the target prompt word is used to guide the target model to generate output information that meets the target requirement; In the first debugging interface, a prompt word text of the target prompt word and a corresponding test result are displayed, wherein the content of the prompt word text includes a natural language description of the target requirement, and the test result is used to indicate whether the output information generated by the target model based on the prompt word text meets the target requirement; The method further comprises: In the first debugging interface, displaying first output information generated by the target model based on the prompt word text; Wherein, the target requirement includes at least one sub-requirement; The first output information includes at least one output parameter, and the output parameter represents a result of processing the input parameter in the prompt word text based on the sub-requirement.
2. According to the method of claim 1, the prompt word text includes at least one input parameter, and the input parameter is used to characterize the input information for the target model, and the target requirement is achieved by processing the input information.
3. The method according to claim 2, before displaying the prompt word text of the target prompt word and the corresponding test result, the method further include: In response to the second instruction, obtaining target input information corresponding to the input parameter; Based on the target input information and the prompt word text, obtaining the test result; The second instruction is used to indicate a target test case corresponding to the target prompt word, or to input a target character string.
4. The method according to claim 3, further comprising: include: In response to the third instruction, a test case corresponding to the target prompt word is generated according to the target input information and the output information corresponding to the target input information.
5. The method according to claim 1, further comprising: include: Obtaining a target test case corresponding to the target prompt word; Based on the target model and the target test case, the test result is obtained.
6. The method according to claim 5, wherein the test result is obtained based on the target model and the target test case. include: Based on the target model and the target test case, obtaining first output information; The test result is obtained according to the expected output information corresponding to the target test case and the first output information.
7. The method according to claim 6, wherein the test result is obtained according to the expected output information corresponding to the target test case and the first output information, include: Acquire a first language model, where the first language model is used to determine the consistency of at least two input texts based on semantics; Based on the first language model, the expected output information corresponding to the target test case and the first output information are processed to obtain a test result.
8. The method according to claim 5, further comprising: include: Displaying a test case set for the target prompt word, wherein the test case set includes at least two alternative test cases, wherein the alternative test cases are used to verify whether a target output parameter in the first output information generated based on the prompt word text has an expected parameter value; The step of obtaining a target test case corresponding to the target prompt word includes: In response to a fourth instruction, the target test case is determined from the at least two candidate test cases.
9. The method according to claim 5, before obtaining the target test case corresponding to the target prompt word, include: Acquire a first auxiliary prompt word, where the first auxiliary prompt word is used to represent a rule for generating a test case matching the target prompt word based on a first auxiliary model; The target test case is automatically generated based on the first auxiliary model and the first auxiliary prompt word.
10. The method according to claim 5, wherein the target test case comprises at least two sub-test cases; and the test result is obtained based on the target model and the target test case. include: Based on the at least two sub-test cases, obtaining a first output result corresponding to each of the sub-test cases; Obtaining a test pass rate corresponding to the target prompt word according to the first output result corresponding to each of the sub-test cases; The test result is obtained according to the test pass rate.
11. The method according to claim 1, comprising at least one of the following: The prompt word text includes at least a first text segment and / or a second text segment. in, The first text segment is used to represent the data format of the output information; the second text segment is used to represent the logic for processing the input information to meet the target requirement; The prompt word text is displayed in plain text or markup language format.
12. The method according to claim 11, further comprising: include: In response to the fifth instruction, modify the first text segment and / or the second text segment in the prompt word text to generate an optimized prompt word text; The method further comprises: In the second debugging interface, the prompt word text and the optimized prompt word text are displayed based on paragraph comparison.
13. The method according to claim 1, further comprising: include: The optimized text corresponding to the prompt word text is displayed, wherein the content of the optimized text includes optimization suggestions for the prompt word text and / or the result of sentence optimization for the prompt word text.
14. The method according to claim 13, wherein the displaying the optimized text corresponding to the prompt word text, include: Acquire a second auxiliary prompt word, where the second auxiliary prompt word is used to represent a rule for generating an optimized text for the prompt word text based on a second auxiliary model; Based on the second auxiliary model and the second auxiliary prompt word, an optimized text corresponding to the prompt word text is generated.
15. A prompt word processing device, include: A first response unit, configured to load a target prompt word in response to a first instruction, wherein the target prompt word is used to guide the target model to generate output information that meets the target requirement; a first processing unit, configured to display, in a first debugging interface, a prompt word text of the target prompt word and a corresponding test result, wherein the content of the prompt word text includes a natural language description of the target requirement, and the test result is used to indicate whether the output information generated by the target model based on the prompt word text meets the target requirement; The device also includes: The second processing unit is used to display, in the first debugging interface, the first output information generated by the target model based on the prompt word text; wherein the target requirement includes at least one sub-requirement; the first output information includes at least one output parameter, and the output parameter represents the result of processing the input parameter in the prompt word text based on the sub-requirement.
16. The device according to claim 15, wherein the prompt word text includes at least one input parameter, and the input parameter is used to characterize input information for the target model, and the target requirement is achieved by processing the input information.
17. The device according to claim 16, further comprising: include: A second response unit, configured to obtain target input information corresponding to the input parameter in response to a second instruction; The test result is obtained based on the target input information and the prompt word text; wherein the second instruction is used to indicate a target test case corresponding to the target prompt word, or to input a target character string.
18. The device according to claim 17, further comprising: include: The third response unit is used to respond to a third instruction and generate a test case corresponding to the target prompt word according to the target input information and the output information corresponding to the target input information.
19. The device according to claim 15, wherein the first processing unit further comprises: include: A first processing module is used to obtain a target test case corresponding to the target prompt word; The second processing module is used to obtain the test result based on the target model and the target test case.
20. The device according to claim 19, wherein the second processing module include: A first sub-processing module, configured to obtain first output information based on the target model and the target test case; The second sub-processing module is used to obtain the test result according to the expected output information corresponding to the target test case and the first output information.
21. The device according to claim 20, wherein the second sub-processing module is specifically configured to: Acquire a first language model, where the first language model is used to determine the consistency of at least two input texts based on semantics; Based on the first language model, the expected output information corresponding to the target test case and the first output information are processed to obtain a test result.
22. The apparatus according to claim 19, wherein the first processing module include: A third sub-processing module is used to display a test case set for the target prompt word, wherein the test case set includes at least two alternative test cases, wherein the alternative test cases are used to verify whether the target output parameter in the first output information generated based on the prompt word text has an expected parameter value; in response to a fourth instruction, the target test case is determined from the at least two alternative test cases.
23. The apparatus according to claim 19, wherein the first processing module include: A fourth sub-processing module is used to obtain a first auxiliary prompt word, where the first auxiliary prompt word is used to represent a rule for generating a test case matching the target prompt word based on the first auxiliary model; The target test case is automatically generated based on the first auxiliary model and the first auxiliary prompt word.
24. The apparatus according to claim 19, wherein the target test case comprises at least two sub-test cases; and the second processing module, include: A fifth sub-processing module, configured to obtain, based on the at least two sub-test cases, a first output result corresponding to each of the sub-test cases; A sixth sub-processing module, configured to obtain a test pass rate corresponding to the target prompt word according to the first output result corresponding to each of the sub-test cases; The seventh sub-processing module is used to obtain the test result according to the test pass rate.
25. The apparatus of claim 15, comprising at least one of the following: The prompt word text includes at least a first text segment and / or a second text segment. in, The first text segment is used to represent the data format of the output information; the second text segment is used to represent the logic for processing the input information to meet the target requirement; The prompt word text is displayed in plain text or markup language format.
26. The device according to claim 25, further comprising: include: The fourth response unit is used to modify the first text segment and / or the second text segment in the prompt word text in response to the fifth instruction to generate an optimized prompt word text; in the second debugging interface, display the prompt word text and the optimized prompt word text based on paragraph comparison.
27. The device according to claim 15, further comprising: include: The third processing unit is used to display the optimized text corresponding to the prompt word text, wherein the content of the optimized text includes optimization suggestions for the prompt word text and / or the result of sentence optimization for the prompt word text.
28. The device according to claim 27, wherein the third processing unit include: A third processing module is used to obtain a second auxiliary prompt word, where the second auxiliary prompt word is used to represent a rule for generating an optimized text for the prompt word text based on a second auxiliary model; The fourth processing module is used to generate an optimized text corresponding to the prompt word text based on the second auxiliary model and the second auxiliary prompt word.
29. An electronic device, include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 14.
30. A non-transitory computer-readable storage medium storing computer instructions, in, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-14.
31. A computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 14.
