Prompt word determination method, device and equipment applied to large language model and medium
By automatically generating prompts, combined with interface description statements and structured parameters, the problem of misunderstandings in large language models when understanding user input is solved, improving the efficiency of prompt generation and user experience, and ensuring the accuracy of event responses.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2023-07-11
- Publication Date
- 2026-05-15
AI Technical Summary
Existing large language models misunderstand user input commands, leading to incorrect responses and impacting user experience. Furthermore, the generation and determination of prompts are inefficient and require significant human resources.
By obtaining the interface description statement, prompt word template, and structured parameters of the schedule event, the system automatically generates the first and second parts of the prompt word information. Combining the interface description statement and structured parameters, it generates prompt words for different business systems, reducing manual operations and improving generation efficiency.
It enables automatic generation of prompts, reducing manpower and time costs, improving the efficiency of using large language models and user experience, and ensuring the accuracy and efficiency of event response.
Smart Images

Figure CN116955557B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of intelligent interaction in the field of artificial intelligence, and in particular to a method, apparatus, device and medium for determining prompt words applied to large language models. Background Technology
[0002] Artificial intelligence has entered the era of large-scale models, whose functions extend far beyond dialogue and chat. Leveraging the understanding capabilities of large-scale models, the needs of diverse usage scenarios can be supported. However, if the large-scale model misunderstands the user's input, it will issue incorrect responses, impacting the user experience.
[0003] Large models can understand user input through preset prompts; therefore, the generation and determination of prompts are crucial for the use of large models. Summary of the Invention
[0004] This disclosure provides a method, apparatus, device, and medium for determining prompt words in a large language model.
[0005] According to a first aspect of this disclosure, a method for determining prompt words applied to a large language model is provided, comprising:
[0006] Obtain preset interface description statements, prompt word templates, and structured parameters of schedule events; wherein, the interface description statement represents the parameter information of the schedule event required when calling the application programming interface to be called; the prompt word template is a template corresponding to a portion of the prompt word to be generated; and the structured parameters are the parameters of the schedule event;
[0007] Based on the interface description statement and the prompt word template, generate the first part of the information of the prompt word to be generated;
[0008] Based on the structured parameters, the second part of the prompt word to be generated is generated;
[0009] Based on the first part of the information and the second part of the information, a prompt word corresponding to the scheduled event is generated; wherein, the prompt word is used to call the application programming interface to be invoked for event response processing after determining the event triggered by the user based on the large language model.
[0010] According to a second aspect of this disclosure, an apparatus for determining prompt words applied to a large language model is provided, comprising:
[0011] The acquisition unit is used to acquire preset interface description statements, prompt word templates, and structured parameters of schedule events; wherein, the interface description statement represents the parameter information of the schedule event required when calling the application programming interface to be called; the prompt word template is a template corresponding to a portion of the prompt word to be generated; and the structured parameters are the parameters of the schedule event.
[0012] The first generation unit is used to generate the first part of the information of the prompt word to be generated based on the interface description statement and the prompt word template.
[0013] The second generation unit is used to generate the second part of the prompt word to be generated based on the structured parameters;
[0014] The prompt word generation unit is used to generate prompt words corresponding to the scheduled event based on the first part of information and the second part of information; wherein, the prompt words are used to call the application programming interface to be invoked for event response processing after determining the event triggered by the user based on the large language model.
[0015] According to a third aspect of this disclosure, an electronic device is provided, comprising:
[0016] At least one processor; and
[0017] A memory that is communicatively connected to the at least one processor;
[0018] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect of this disclosure.
[0019] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing the computer to perform the method described in the first aspect of this disclosure.
[0020] According to a fifth aspect of this disclosure, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the method described in the first aspect of this disclosure.
[0021] The technology disclosed herein improves the efficiency of prompt determination when applied to large language models.
[0022] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0023] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0024] Figure 1 This is a flowchart illustrating a method for determining prompt words applied to a large language model according to an embodiment of this disclosure;
[0025] Figure 2 This is a flowchart illustrating a method for determining prompt words applied to a large language model according to an embodiment of this disclosure;
[0026] Figure 3 This is a flowchart illustrating a method for determining prompt words applied to a large language model according to an embodiment of this disclosure;
[0027] Figure 4 This is a structural block diagram of a device for determining prompt words in a large language model, according to an embodiment of the present disclosure;
[0028] Figure 5 This is a structural block diagram of a device for determining prompt words in a large language model, according to an embodiment of the present disclosure;
[0029] Figure 6 This is a structural block diagram of an electronic device used to implement the method for determining prompt words applied to a large language model according to the embodiments of this disclosure;
[0030] Figure 7 This is a structural block diagram of an electronic device used to implement the method for determining prompt words applied to a large language model according to embodiments of the present disclosure. Detailed Implementation
[0031] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0032] AI (Artificial Intelligence) has entered the era of large models, which can refer to large language models. By leveraging the understanding gained from these large models, applications can be built, empowering various scenarios and industries.
[0033] To support the needs of different use cases, the requirements for large-scale models go beyond just dialogue and chat; the aim is to leverage their understanding capabilities to enhance the user experience of business systems. For example, a user inputs a voice message into the large-scale model, and the model's understanding of the voice creates a schedule within the application. For instance, the user's voice input could be "Meeting tomorrow afternoon at 3 PM," which would then create a schedule for a meeting tomorrow afternoon at 3 PM. In this scenario, many issues arise, such as accuracy. Addressing accuracy often requires the assistance of prompts, and the human resource investment in prompt generation is considerable, leading to a large number of prompt engineers. Improving the efficiency of prompt generation is a pressing issue that needs to be addressed.
[0034] This disclosure provides a method, apparatus, device, and medium for determining prompt words in large language models, applicable to the field of intelligent interaction in artificial intelligence, thereby improving the efficiency of prompt determination.
[0035] It should be noted that the model and parameters in this embodiment are not specific to any particular user and do not reflect the personal information of any particular user. It should also be noted that the data in this embodiment comes from a publicly available dataset.
[0036] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0037] To help readers gain a deeper understanding of the implementation principles of this disclosure, the following will be discussed in conjunction with... Figures 1-7 The illustrated embodiments are further refined.
[0038] Figure 1 This is a flowchart illustrating a method for determining prompt words based on a large language model according to an embodiment of this disclosure. This method can be executed by a device for determining prompt words based on a large language model. Figure 1 As shown, the method includes the following steps:
[0039] S101. Obtain the preset interface description statement, prompt word template, and structured parameters of the schedule event; wherein, the interface description statement represents the parameter information of the schedule event required when calling the application programming interface to be called; the prompt word template is the template corresponding to part of the prompt word to be generated; and the structured parameters are the parameters of the schedule event.
[0040] For example, the large language model can be applied to different business systems, each providing users with different business functions. For instance, a business system might offer features like creating to-do schedules. Creating a to-do schedule means setting an event as a schedule within the business system, reminding the user to handle the event within a preset timeframe. Different business systems correspond to different APIs (Application Programming Interfaces); that is, when using a business system, the corresponding API interface needs to be called.
[0041] Pre-configure interface description statements for different APIs. These statements describe the APIs themselves. The interface description statement can represent the parameter information of the scheduled events required when calling the API. Scheduled events refer to to-do events that users need to create on the business system. For example, a scheduled event like "Xiaohong and Xiaoming will have a meeting tomorrow afternoon at 3 PM" can be created on the business system. Parameter information can include parameters related to the scheduled event and explanations of those parameters. For example, parameters can include the executor's name, time, location, to-do event description, and event topic. The explanations can describe the format and meaning of the parameters. For example, for the parameter "to-do event description," the explanation could be "supports plain text or rich text, maximum 500 characters"; for the parameter "deadline," the explanation could be "millisecond timestamp"; for the parameter "event priority," the explanation could be "0 indicates no priority; 1 indicates low priority; 2 indicates medium priority; 3 indicates high priority." Pre-defined statement formats can be used to pre-configure the interface description statements, allowing different business systems to use different interface description statements.
[0042] Pre-set prompt templates are provided and can be used to generate prompts. A prompt template corresponds to a portion of the information in the prompt to be generated. A prompt can include multiple parts; based on the prompt template, a portion of the prompt can be generated. For example, the prompt template could be: "I hope you can play the role of XXX function. You need to analyze user input, determine the required parameters, and output the parameters in JSON format. The parameter is XXX; the parameter description is XXX." When generating the prompt, the missing parts of the prompt template can be filled in to obtain a portion of the prompt.
[0043] This section provides a specific example of a scheduled event and sets its structured parameters. Structured parameters refer to the parameters representing the scheduled event using a predefined data structure. For example, if a scheduled event is predefined as "Xiao Li and Xiao Ming write reading notes today," the structured parameters for this event can be represented as follows:
[0044]
[0045]
[0046] Multiple example schedule events can be provided in advance, each with a corresponding structured parameter. Examples can be based on the actual functions of the business system; in this embodiment, the content of the example schedule events is not specifically limited. The structured parameters of the preset schedule events include the parameters contained in the interface description statement. For example, if the interface description statement indicates that the parameters required to call the API include time, location, people, and a description of the to-do item, then the preset structured parameters must contain the time, location, people, and to-do item description of the schedule event.
[0047] S102. Based on the interface description statement and the prompt word template, generate the first part of the prompt word information to be generated.
[0048] For example, a prompt may include a first part of information and a second part of information, and the prompt word template may be a template for the first part of information. When generating a prompt, the first part of information can be generated based on the interface description statement and the prompt word template. The prompt word template contains the position to be supplemented. For example, the prompt word template is "I hope you can play the role of XXX function," where the position of "XXX" is the position to be supplemented. Based on the interface description statement, the position to be supplemented can be supplemented, replacing "XXX" with specific content, resulting in a supplemented prompt word template, which serves as the first part of the prompt information.
[0049] When generating the first part of the prompt based on the interface description and prompt template, specific information can be obtained from the interface description and filled into the prompt template. For example, parameter names can be found in the interface description and filled into the prompt template where parameter names are required. The first part of the prompt information allows the large language model to determine which parameters need to be extracted from the user-instructed event when it receives a user's instruction to create a to-do event. For example, if a user instructs to create a to-do event, the large language model needs to determine the executor, time, location, priority, and description of the to-do item.
[0050] In this embodiment, the first part of the information for the prompt to be generated is generated based on the interface description statement and the prompt word template. This includes: obtaining the parameter information of the schedule event required when calling the application programming interface to be called from the interface description statement; adding the parameter information of the schedule event required when calling the application programming interface to be called to a preset position in the prompt word template to obtain the first part of the information for the prompt to be generated.
[0051] Specifically, the interface description statement can represent the parameter information of the schedule event required when calling the API to be called. The API to be called is the API corresponding to the business system providing the function. The parameter information can include the name of the parameter required to call the API and an explanation of the parameter. For example, the required parameters include the name of the task, the description of the task, and the time. The explanation of the parameter can be an explanation of the format and meaning of the parameter. For example, if the parameter is the description of the task, the explanation can be "Description of task, supports plain text or rich text, maximum 500 characters".
[0052] From the interface description statement, obtain the parameter information of the schedule events required to call the API, that is, determine the parameters required to call the API and an explanation of the parameters. Different APIs may yield different parameter information.
[0053] Obtain a pre-defined prompt template with pre-defined positions for information to be added. At these pre-defined positions, specific information needs to be added to obtain the complete first part of the prompt. Based on the parameter information in the interface description statement, determine the information at the pre-defined positions in the prompt template and fill in the determined information at the pre-defined positions in the prompt template to obtain the first part of the prompt to be generated. For example, determine the name of the parameter required to call the API from the parameter information, determine the pre-defined position in the prompt template where the parameter name needs to be filled, and add the determined parameter name to the pre-defined position to include the parameter name in the prompt template. The parameter information can also include the functions provided by the business system, which are designated as the roles of the business system. For example, if the business system provides the function of creating to-do items, then the business system needs to be designated as the role of creating to-do items. Fill in the determined role name at the pre-defined position in the prompt template. For example, if the prompt template is "I hope you can be the role of XXX function", the first part of the completed prompt will be "I hope you can be the role of creating to-do items".
[0054] The advantage of this setup is that by combining the interface description statement and the prompt template, the complete first part of the information can be automatically generated, reducing user operations, ensuring that the generated prompt corresponds to the business system, and improving the efficiency of prompt generation.
[0055] S103. Based on the structured parameters, generate the second part of the prompt word information to be generated.
[0056] For example, a schedule event is selected in advance to obtain its structured parameters. Preset structured parameters are then obtained, and based on these parameters, the second part of the prompt word to be generated is derived. For instance, the second part of the information may include the structured parameters; that is, the preset structured parameters can be used as the second part of the information.
[0057] Scheduled events can be described using natural language, for example, a preset scheduled event might be "Xiao Li and Xiao Ming write reading notes today." Structured parameters represent the specific content of the parameters for a scheduled event; that is, through structured parameters, a preset data structure can be used to represent the person, time, priority, and tasks to be performed for the scheduled event. Based on the structured parameters, the specific content of each parameter of the scheduled event can be determined. This determined parameter content, along with the structured parameters, forms the second part of the prompt information. In other words, the second part of the prompt information can include the specific content of the scheduled event parameters and the structured parameters of the preset data structure. This second part of the prompt information, as a concrete example, helps the large language model understand the user's input when receiving user instructions, extract the correct parameters, and accurately create tasks.
[0058] S104. Based on the information in the first part and the information in the second part, generate prompt words corresponding to the schedule events; wherein, the prompt words are used to call the application programming interface to be invoked for event response processing after determining the event triggered by the user based on the large language model.
[0059] For example, after obtaining the first and second parts of the prompt information, a complete prompt can be obtained based on the first and second parts, that is, a prompt word corresponding to the preset schedule event. For instance, the first and second parts of the information can be combined to obtain the prompt to be generated. If the specific example of the preset schedule event is changed, the generated prompt will also change.
[0060] After generating the prompt, it can be applied to the large language model. Based on the large language model, the user-triggered event can be determined, and the corresponding API interface can be invoked for event response processing. The user-triggered event could be a user-initiated schedule creation command, which includes a to-do event to be created. Response processing can involve creating a schedule for the to-do event; that is, in the application of the business system, a schedule for the to-do event is created to remind the user to perform the event within a preset time.
[0061] In this embodiment, generating prompt words corresponding to the schedule event based on the first part of information and the second part of information includes: assembling the first part of information and the second part of information to obtain prompt words corresponding to the schedule event.
[0062] Specifically, the prompt includes a first part and a second part. A preset assembly rule is established for the first and second parts of the prompt. Based on this rule, the first and second parts are assembled to obtain the complete prompt. For example, the first part can be placed on top of the second part, and the prompt can be obtained by combining the first and second parts vertically.
[0063] For example, a complete prompt can be represented as:
[0064] I'd like you to be in charge of creating the to-do list feature. You'll need to analyze user input, determine the required parameters, and output them in JSON format. The parameters are: Name-Time-Priority-Item to be done.
[0065] When I input "Xiao Li and Xiao Ming wrote reading notes with high marks today", you need to help me extract the following structured parameters.
[0066]
[0067] The first part of the information is: "I hope you can act as the creator of the to-do function. You need to analyze user input, determine the required parameters, and output the parameters in JSON format. The parameters are name-time-priority-to-do item." The content following the first part is the second part of the information.
[0068] The advantage of this setup is that by combining the information from the first part and the second part, the prompt can be generated automatically, reducing manual operations and improving the efficiency of prompt determination.
[0069] This disclosure provides a method for determining prompt words applied to a large language model. Based on a preset interface description statement and a prompt template, the first part of the prompt information can be obtained. Different first parts of information can be generated for different business systems, enabling targeted prompt determination for different business systems. Based on preset structured parameters of exemplary schedule events, a second part of the prompt information can be generated. Combining the two parts of information yields the complete prompt. This method enables automatic prompt generation, reducing manpower and time investment, lowering the cost of prompt determination, improving the efficiency of prompt determination, and thus accelerating the integration of business users and the use of the large language model.
[0070] Figure 2 This is a flowchart illustrating a method for determining prompt words applied to a large language model, which is an optional embodiment based on the above embodiments.
[0071] In this embodiment, the second part of the information for generating the prompt word to be generated based on the structured parameters can be further refined as follows: generating a natural language description of the schedule event based on the structured parameters of the schedule event; wherein, the natural language description of the schedule event is used to describe the schedule event in natural language; and determining the second part of the information for generating the prompt word based on the structured parameters and the natural language description of the schedule event.
[0072] like Figure 2 As shown, the method includes the following steps:
[0073] S201. Obtain the preset interface description statement, prompt word template, and structured parameters of the schedule event; wherein, the interface description statement represents the parameter information of the schedule event required when calling the application programming interface to be called; the prompt word template is the template corresponding to part of the prompt word to be generated; and the structured parameters are the parameters of the schedule event.
[0074] For example, this step can refer to step S101 above, and will not be repeated here.
[0075] S202. Based on the interface description statement and the prompt word template, generate the first part of the prompt word information to be generated.
[0076] For example, this step can refer to step S102 above, and will not be repeated here.
[0077] S203. Generate a natural language description of the schedule event based on the structured parameters of the schedule event; wherein, the natural language description of the schedule event is used to describe the schedule event in natural language.
[0078] For example, the structured parameters represent schedule events using a preset data structure. A preset structured parameter corresponds to a specific schedule event. A schedule event can be described using natural language, and this natural language description includes the event's parameters. The preset structured parameters also include the event's parameters. Based on the schedule event's structured parameters, a corresponding natural language description can be generated; that is, the structured parameters can be converted into a natural language description.
[0079] In this embodiment, generating a natural language description of a schedule event based on its structured parameters includes: obtaining parameters of the schedule event from its structured parameters; and generating a natural language description of the schedule event based on its parameters.
[0080] Specifically, the structured parameters contain the various parameters of the schedule event, and these parameters can be retrieved from the structured parameters. For example, one can retrieve the executor, time, location, and priority of the schedule event.
[0081] Based on the parameters of the obtained schedule event, the schedule event can be described in natural language, i.e., a natural language description of the schedule event is obtained. The natural language description of the schedule event includes the obtained parameters. The obtained parameters can be concatenated into a complete natural language sentence, which serves as the natural language description of the schedule event. For example, if the obtained parameters are: Executor - Xiaoming; Time - Today; Priority - High; To-do Description - Write reading notes, the corresponding natural language description is: "Xiaoming writes reading notes today (high priority)."
[0082] The advantage of this setup is that it automatically generates natural language descriptions based on structured parameters and ensures that no parameters are omitted from the natural language descriptions. It eliminates the need for manual writing of natural language descriptions and improves the efficiency of prompt generation.
[0083] In this embodiment, generating a natural language description of a schedule event based on its parameters includes: caching the parameters of the schedule event in a preset parameter list; wherein, a row in the parameter list represents a schedule event and a column represents a parameter; and assembling the parameters of the schedule events in the parameter list according to a preset natural language format to obtain a natural language description of the schedule event.
[0084] Specifically, a parameter list is pre-defined, which can be a schema list. After retrieving the parameters of the schedule events from the structured parameters, these parameters can be stored in the schema list. Parameters can be stored in key-value or key-type-value format. The key refers to the parameter name, the value to the parameter content, and the type to the parameter data type. The schema list contains multiple rows and columns, and can store parameters for multiple schedule events. For example, a row represents one schedule event, meaning all parameters for that event are stored in that row. A column represents a type of parameter, with the same type of parameter for different schedule events stored in the same column. If structured parameters for different schedule events are pre-defined, the parameters for different schedule events can be retrieved, and the parameters for each schedule event can be stored in different rows.
[0085] When generating a natural language description, the parameters corresponding to a schedule event are retrieved from a preset parameter list. A natural language format is pre-defined, and the parameters of the schedule event are assembled according to this format to obtain the natural language description of the event. For example, the natural language format could be that the parameters are concatenated in a preset order to form a natural language sentence without punctuation.
[0086] The advantage of this setup is that event parameters can be placed in a parameter list, and the parameters in the parameter list can be formatted to obtain natural language descriptions, thereby achieving automatic generation of natural language descriptions and ensuring that the natural language descriptions correspond to the structured parameters, thus improving the efficiency of prompt generation.
[0087] In this embodiment, the parameters of the schedule events in the parameter list are assembled according to a preset natural language format to obtain a natural language description of the schedule events. This includes: assembling the parameters of the schedule events in the parameter list according to a preset natural language format to obtain an initial language description; wherein the initial language description is used to represent natural language containing the parameters of the schedule events; and rewriting and expanding the initial language description according to a preset language generation model to obtain a natural language description of the schedule events; wherein the language generation model is used to change the expression method of the initial language description.
[0088] Specifically, a pre-defined natural language format is used, which represents the assembly rules of parameters. For example, the natural language format can represent the order in which parameters are assembled. Based on the natural language format, the parameters of the schedule events in the parameter list are concatenated and assembled to obtain the initial language description. The initial language description can contain only the parameters of the schedule events. For example, the natural language format specifies the assembly order of parameters as "executor, time, priority, task description". Using structured parameters, if the schedule event parameters are: executor is Xiaoming, deadline is 24:00 today, priority is high, and task description is writing reading notes, then the initial language description is "Xiaoming writes reading notes at 24:00 today (high priority)".
[0089] The initial language description is rather simple and simplistic, potentially leading to awkward phrasing and not conforming to users' everyday speaking habits. The initial description can be rewritten and expanded to obtain a more reasonable expression, serving as a natural language description for schedule events.
[0090] A pre-defined language generation model can be used to rewrite and expand natural language. For example, the language generation model can be a neural network model. Through the language generation model, different expressions of the initial language description can be generated. For instance, for the time parameter included in the interface, various expressions of time can be introduced for rewriting and expansion. For example, the initial language description is "Xiaoming writes reading notes at 24:00 today," and the rewritten natural language description could be "Xiaoming writes reading notes at 12:00 tonight." The structured parameters and the different expressions of natural language description can together serve as the second part of the prompt, improving the large language model's ability to understand user-triggered events through the prompt.
[0091] The advantage of this setup is that by rewriting and expanding the initial language description, different expressions can be obtained. Each of these different natural language descriptions can correspond to preset structured parameters, making it easier to determine the parameters of the event described by the user when using the prompt later, thus improving the user experience.
[0092] In this embodiment, obtaining the parameters of a schedule event from the structured parameters of the schedule event includes: obtaining parameters of a preset parameter type from the structured parameters of the schedule event, which are the parameters of the schedule event.
[0093] Specifically, structured parameters can contain multiple parameters for a schedule event. When retrieving parameters from these parameters, the parameters can be filtered to retrieve only the necessary ones. The necessity of a parameter can be determined in advance by the staff, considering the interface usage. That is, one or more parameter types can be pre-defined as the necessary parameter types. Parameters corresponding to the pre-defined parameter types are retrieved from the structured parameters and used as the schedule event parameters. Parameters that are not pre-defined can be omitted to avoid data redundancy.
[0094] The advantage of this setup is that it extracts necessary parameter fields from pre-set structured parameters, reduces the amount of parameter data, improves the generation efficiency and accuracy of natural language descriptions, and thus improves the generation efficiency and accuracy of prompts.
[0095] S204. Based on the structured parameters and natural language descriptions of the schedule events, determine the second part of the information for the prompt words to be generated.
[0096] For example, after obtaining the natural language description of a schedule event, the second part of the prompt can be generated based on the structured parameters and natural language description of the schedule event. For instance, the structured parameters and natural language description can be directly used as part of the second part of the prompt. By determining the corresponding natural language description through structured parameters, the second part of the prompt can be obtained, achieving automatic generation of the second part of the prompt, reducing manual operations, and effectively improving the efficiency of prompt generation.
[0097] In this embodiment, the second part of the prompt word to be generated is determined based on the structured parameters and natural language description of the schedule event, including: assembling the structured parameters and natural language description of the schedule event to obtain the second part of the prompt word to be generated.
[0098] Specifically, the structured parameters and natural language descriptions of the schedule event can be directly concatenated to obtain the second part of the prompt. The format of this second part can be preset; for example, the assembly order of the structured parameters and natural language descriptions can be preset, placing the structured parameters below the natural language descriptions. The second part of the information can be represented as:
[0099] When I input "Xiao Li and Xiao Ming wrote reading notes with high marks today", you need to help me extract the following structured parameters.
[0100]
[0101] The advantage of this setup is that by assembling structured parameters and natural language descriptions, the second part of the information can be obtained quickly, thus improving the efficiency of determining the second part of the information.
[0102] In this embodiment, there are at least two preset structured parameters, with each structured parameter corresponding to a schedule event. The structured parameters of the schedule event and the natural language description are assembled to obtain the second part of the prompt word to be generated, including: determining the natural language description corresponding to each schedule event; assembling the natural language description corresponding to the schedule event with the structured parameters corresponding to the schedule event according to the preset first assembly rule information to obtain the assembly result of the schedule event; and assembling the assembly result of each schedule event according to the preset second assembly rule information to obtain the second part of the prompt word to be generated.
[0103] Specifically, multiple structured parameters can be preset, each corresponding to a schedule event; that is, examples of different schedule events can be pre-defined. For each structured parameter, a corresponding natural language description can be generated. Determining the natural language description corresponding to each schedule event is equivalent to determining the natural language description corresponding to each structured parameter. The second part of the information can include multiple structured parameters and multiple natural language descriptions. A first assembly rule is pre-defined, which is used to assemble the structured parameters of the schedule event with the corresponding natural language description. For example, the structured parameters can be placed below the corresponding natural language description to obtain the assembly result for each schedule event.
[0104] A second assembly rule is pre-set. This rule is used to assemble the assembly results of different schedule events to obtain a complete second part of the information. For example, the assembly results can be concatenated vertically. For instance, there are two structured parameters: a first structured parameter and a second structured parameter. The natural language description corresponding to the first structured parameter is a first description, and the natural language description corresponding to the second structured parameter is a second description. The final generated second part of the information, from top to bottom, consists of a first description, a first structured parameter, a second description, and a second structured parameter. Specifically, the second part of the information can be represented as:
[0105] When I type "Xiao Li wrote notes for Gao You today", you need to help me extract the following structured parameters.
[0106]
[0107] When I input "Xiaohong watches movies at 3 PM tomorrow", you need to help me extract the following structured parameters.
[0108]
[0109] The advantage of this setup is that the second part of the information can include multiple examples, which makes it easier for the large language model to accurately understand the events triggered by the user through the prompt, thereby improving the understanding accuracy of the large language model and enhancing the user experience.
[0110] In this embodiment, one structured parameter can correspond to multiple natural language descriptions. If one structured parameter corresponds to multiple natural language descriptions, the second part of the prompt information can be generated based on the structured parameter and the multiple natural language descriptions. For example, the structured parameter can be assembled with multiple natural language descriptions. In this embodiment, the assembly method of the structured parameter and natural language descriptions is not specifically limited. By assembling the structured parameter with multiple natural language descriptions, the large language model can understand the user's different expression methods, improving the user experience.
[0111] S205. Based on the information in the first part and the information in the second part, generate prompt words corresponding to the schedule events; wherein, the prompt words are used to call the application programming interface to be called for event response processing after determining the event triggered by the user based on the large language model.
[0112] For example, this step can refer to step S104 above, and will not be repeated here.
[0113] This disclosure provides a method for determining prompt words applied to a large language model. Based on a preset interface description statement and a prompt template, the first part of the prompt information can be obtained. Different first parts of information can be generated for different business systems, enabling targeted prompt determination for different business systems. Based on preset structured parameters of exemplary schedule events, a second part of the prompt information can be generated. Combining the two parts of information yields the complete prompt. This method enables automatic prompt generation, reducing manpower and time investment, lowering the cost of prompt determination, improving the efficiency of prompt determination, and thus accelerating the integration of business users and the use of the large language model.
[0114] Figure 3 This is a flowchart illustrating a method for determining prompt words applied to a large language model, which is an optional embodiment based on the above embodiments.
[0115] In this embodiment, the method further includes: determining the response result of the large language model to the preset event based on the prompt words corresponding to the schedule event; wherein, the large language model is used to respond to the event triggered by the user and output the response result to the event triggered by the user; if it is determined that the response result output by the large language model meets the preset response requirements, then it is determined to apply the prompt words corresponding to the schedule event to the large language model.
[0116] like Figure 3 As shown, the method includes the following steps:
[0117] S301. Obtain the preset interface description statement, prompt word template, and structured parameters of the schedule event; wherein, the interface description statement represents the parameter information of the schedule event required when calling the application programming interface to be called; the prompt word template is the template corresponding to part of the prompt word to be generated; and the structured parameters are the parameters of the schedule event.
[0118] For example, this step can refer to step S101 above, and will not be repeated here.
[0119] S302. Based on the interface description statement and the prompt word template, generate the first part of the prompt word information to be generated.
[0120] For example, this step can refer to step S102 above, and will not be repeated here.
[0121] S303. Based on the structured parameters, generate the second part of the prompt word information to be generated.
[0122] For example, this step can refer to step S103 above, and will not be repeated here.
[0123] S304. Based on the information in the first part and the information in the second part, generate prompt words corresponding to the schedule events; wherein, the prompt words are used to call the application programming interface to be invoked for event response processing after determining the event triggered by the user based on the large language model.
[0124] For example, this step can refer to step S104 above, and will not be repeated here.
[0125] S305. Based on the prompt words corresponding to the scheduled events, determine the response result of the large language model to the preset events; wherein, the large language model is used to respond to the events triggered by the user and output the response result to the events triggered by the user.
[0126] For example, after obtaining the prompt, the large language model can be trained using the prompt to determine whether the large language model can work for the user using the prompt, that is, to determine whether the generated prompt can be applied to the large language model.
[0127] A preset event is set as the event to be verified, and this event is represented by a natural language description. This natural language description is then input into the large language model, meaning the user triggers the event. The large language model can respond to the user-triggered event and output a response result. The response result can be the event parameters extracted by the large language model after understanding the user's input natural language description, and these parameters can be represented using a preset data structure.
[0128] After receiving a natural language description of a preset event, the large language model can translate the natural language description into a structured parameter output of the API. To ensure the accuracy of the structured parameter, the large language model applies a prompt for the API interface to assist in understanding and recognition, thereby obtaining the response result of the preset event. In this embodiment, the model structure of the large language model is not specifically limited.
[0129] In this embodiment, the response result of the large language model to the preset event is determined based on the prompt words corresponding to the schedule event, including: responding to the schedule creation instruction triggered by the user based on the large language model; wherein the schedule creation instruction includes a natural language description of the preset event; and determining the parameters in the natural language description of the preset event based on the prompt words corresponding to the schedule event, which is the response result of the large language model to the preset event.
[0130] Specifically, users can issue a schedule creation command, which instructs the business system to create a schedule for a pre-defined event. The schedule creation command can include a natural language description of the pre-defined event. A large language model receives this natural language description from the schedule creation command. The large language model responds to the user-triggered pre-defined event by determining the parameters of the pre-defined event from the natural language description based on a pre-generated prompt, serving as the large language model's response to the pre-defined event. The data structure for the parameters can be pre-defined; that is, the response result can be structured parameters of a pre-defined data structure.
[0131] The advantage of this setting is that the parameters of the preset natural language description can be determined through the generated prompt, which makes it easier to determine whether the generated prompt is effective and improves the accuracy of the prompt determination.
[0132] S306. If it is determined that the response result output by the large language model meets the preset response requirements, then it is determined that the prompt words corresponding to the schedule event will be applied to the large language model.
[0133] For example, for a preset event, response requirements can be pre-set. For instance, correct structured parameters can be preset, and the preset response requirement could be that the response result matches the correct structured parameters. After obtaining the response result output by the large language model, it can be determined whether the response result meets the preset response requirements. If yes, it is determined that the prompt corresponding to the generated schedule event will be applied to the large language model; otherwise, it is determined that the prompt corresponding to the generated schedule event has an error and cannot be applied to the large language model. This achieves the verification of the prompt and the training of the large language model, improving the accuracy of prompt determination and the effectiveness of the large language model.
[0134] In this embodiment, determining that the response result output by the large language model meets the preset response requirements includes: determining the similarity between the response result output by the large language model and the preset response result; if the similarity is greater than the preset similarity threshold, then the response result output by the large language model is determined to meet the preset response requirements.
[0135] Specifically, for a preset event, the correct response result, i.e., the correct structured parameters, is pre-set. A similarity threshold can be preset in the response requirements. After obtaining the response result output by the large language model, the similarity between the output response result and the preset correct response result is determined. If the calculated similarity is greater than the preset similarity threshold, the response result output by the large language model is determined to meet the preset response requirements, and the prompt can be applied to the large language model; if the calculated similarity is not greater than the preset similarity threshold, the response result output by the large language model is determined to not meet the preset response requirements, and the prompt cannot be applied to the large language model.
[0136] The advantage of this setting is that it compares the response output of the large language model with the preset response to determine whether the large language model can accurately understand the event triggered by the user, avoids applying incorrect prompts to the large language model, improves the accuracy of prompt determination, and thus improves the effectiveness of the large language model.
[0137] When using a large language model through a business system, the user's input can be a natural language description of the event to be created, such as a voice or text description. The large language model can determine the structured form of the event parameters from the natural language description using a prompt, thus obtaining the structured parameters of the event, which facilitates calling the API interface to create the event schedule.
[0138] This disclosure provides a method for determining prompt words applied to a large language model. Based on a preset interface description statement and a prompt template, the first part of the prompt information can be obtained. Different first parts of information can be generated for different business systems, enabling targeted prompt determination for different business systems. Based on preset structured parameters of exemplary schedule events, a second part of the prompt information can be generated. Combining the two parts of information yields the complete prompt. This method enables automatic prompt generation, reducing manpower and time investment, lowering the cost of prompt determination, improving the efficiency of prompt determination, and thus accelerating the integration of business users and the use of the large language model.
[0139] Figure 4 This is a structural block diagram of a device for determining prompt words in a large language model, provided as an embodiment of the present disclosure. For ease of explanation, only the parts relevant to the embodiments of the present disclosure are shown. (Refer to...) Figure 4 The device 400 for determining prompt words applied to a large language model includes: an acquisition unit 401, a first generation unit 402, a second generation unit 403, and a prompt word generation unit 404.
[0140] The acquisition unit 401 is used to acquire preset interface description statements, prompt word templates, and structured parameters of schedule events; wherein, the interface description statement represents the parameter information of the schedule event required when calling the application programming interface to be called; the prompt word template is a template corresponding to part of the prompt word to be generated; and the structured parameters are the parameters of the schedule event;
[0141] The first generation unit 402 is used to generate the first part of the information of the prompt word to be generated according to the interface description statement and the prompt word template;
[0142] The second generation unit 403 is used to generate the second part of the prompt word to be generated based on the structured parameters;
[0143] The prompt word generation unit 404 is used to generate prompt words corresponding to the schedule event based on the first part of information and the second part of information; wherein, the prompt words are used to call the application programming interface to be called for event response processing after determining the event triggered by the user based on the large language model.
[0144] Figure 5 This is a structural block diagram of a device for determining prompt words in a large language model, provided as an embodiment of this disclosure. Figure 5 As shown, the device 500 for determining prompt words applied to a large language model includes an acquisition unit 501, a first generation unit 502, a second generation unit 503, and a prompt word generation unit 503. The second generation unit 503 includes a language generation module 5031 and an information determination module 5032.
[0145] The language generation module 5031 is used to generate a natural language description of the schedule event based on the structured parameters of the schedule event; wherein, the natural language description of the schedule event is used to describe the schedule event in natural language;
[0146] The information determination module 5032 is used to determine the second part of the information of the prompt word to be generated based on the structured parameters of the schedule event and the natural language description.
[0147] In one example, language generation module 5031 includes:
[0148] The parameter acquisition submodule is used to acquire the parameters of the schedule event from the structured parameters of the schedule event;
[0149] The language generation submodule is used to generate a natural language description of the schedule event based on the parameters of the schedule event.
[0150] In one example, the language generation submodule includes:
[0151] The parameter caching module is used to cache the parameters of the schedule event in a preset parameter list; wherein, a row in the parameter list represents a schedule event and a column represents a parameter.
[0152] The parameter assembly submodule is used to assemble the parameters of the schedule events in the parameter list according to a preset natural language format to obtain a natural language description of the schedule events.
[0153] In one example, the parameters assemble the submodule, specifically for:
[0154] According to a preset natural language format, the parameters of the schedule events in the parameter list are assembled to obtain an initial language description; wherein, the initial language description is used to represent natural language containing the parameters of the schedule events; according to a preset language generation model, the initial language description is rewritten and expanded to obtain a natural language description of the schedule events; wherein, the language generation model is used to change the expression method of the initial language description.
[0155] In one example, the parameter retrieval submodule is specifically used for:
[0156] From the structured parameters of the schedule event, parameters of a preset parameter type are obtained as the parameters of the schedule event.
[0157] In one example, the information determination module 5032 includes:
[0158] The information assembly submodule is used to assemble the structured parameters of the schedule event and the natural language description to obtain the second part of the prompt word to be generated.
[0159] In one example, there are at least two preset structured parameters, and one structured parameter corresponds to one schedule event;
[0160] The information assembly submodule is specifically used for:
[0161] Determine the natural language description corresponding to each schedule event; according to the preset first assembly rule information, assemble the natural language description corresponding to the schedule event with the structured parameters corresponding to the schedule event to obtain the assembly result of the schedule event; according to the preset second assembly rule information, assemble the assembly results of each schedule event to obtain the second part of the prompt word to be generated.
[0162] In one example, the first generating unit 502 includes:
[0163] The parameter information acquisition module is used to acquire the parameter information of the schedule event required when calling the application programming interface to be called from the interface description statement;
[0164] The parameter information adding module is used to add the parameter information of the schedule event required when calling the application programming interface to be called to the preset position in the prompt word template, so as to obtain the first part of the prompt word to be generated.
[0165] In one example, the prompt word generation unit 504 is specifically used for:
[0166] By assembling the first part of the information and the second part of the information, the prompt words corresponding to the schedule event are obtained.
[0167] In one example, the device also includes:
[0168] The result output unit is used to determine the response result of the large language model to the preset event based on the prompt words corresponding to the scheduled event; wherein, the large language model is used to respond to the event triggered by the user and output the response result to the event triggered by the user.
[0169] The result comparison unit is used to determine, if it is determined that the response result output by the large language model meets the preset response requirements, to apply the prompt word corresponding to the schedule event to the large language model.
[0170] In one example, the result comparison unit includes:
[0171] A similarity determination module is used to determine the similarity between the response result output by the large language model and a preset response result;
[0172] The similarity comparison module is used to determine that the response result output by the large language model meets the preset response requirements if the similarity is greater than a preset similarity threshold.
[0173] In one example, the result output unit includes:
[0174] The instruction response module is used to respond to user-triggered schedule creation instructions based on the large language model; wherein the schedule creation instruction includes a natural language description of the preset event;
[0175] The result determination module is used to determine the parameters in the natural language description of the preset event based on the prompt words corresponding to the scheduled event, which is the response result of the large language model to the preset event.
[0176] Figure 6 A structural block diagram of an electronic device provided in this disclosure embodiment, such as... Figure 6As shown, the electronic device 600 includes: at least one processor 602; and a memory 601 communicatively connected to the at least one processor 602; wherein the memory stores instructions executable by the at least one processor 602, the instructions being executed by the at least one processor 602 to enable the at least one processor 602 to execute the method for determining prompt words applied to a large language model disclosed herein.
[0177] The electronic device 600 also includes a receiver 603 and a transmitter 604. The receiver 603 is used to receive instructions and data sent by other devices, and the transmitter 604 is used to send instructions and data to external devices.
[0178] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0179] According to embodiments of this disclosure, this disclosure also provides a computer program product comprising: a computer program stored in a readable storage medium, at least one processor of an electronic device being able to read the computer program from the readable storage medium, and the at least one processor executing the computer program causing the electronic device to perform the scheme provided in any of the above embodiments.
[0180] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments 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 may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0181] like Figure 7 As shown, device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 702 or a computer program loaded from storage unit 708 into random access memory (RAM) 703. RAM 703 may also store various programs and data required for the operation of device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. Input / output (I / O) interface 705 is also connected to bus 704.
[0182] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0183] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as the method for determining prompt words applied to a large language model. For example, in some embodiments, the method for determining prompt words applied to a large language model can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the method for determining prompt words applied to a large language model described above can be performed. Alternatively, in other embodiments, the computing unit 701 may be configured by any other suitable means (e.g., by means of firmware) to perform a method for determining prompt words applied to a large language model.
[0184] Various embodiments 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-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0185] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0186] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0187] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, 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 sound input, voice input, or tactile input).
[0188] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0189] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.
[0190] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0191] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for determining prompt words applied to large language models, comprising: Obtain preset interface description statements, prompt word templates, and structured parameters of schedule events; wherein, the interface description statement represents the parameter information of the schedule event required when calling the application programming interface to be called; the prompt word template is a template corresponding to a portion of the prompt word to be generated; and the structured parameters are the parameters of the schedule event; Obtain the parameter information of the schedule event required when calling the application programming interface to be called from the interface description statement; The parameter information of the schedule event required when calling the application programming interface to be called is added to the preset position in the prompt word template to obtain the first part of the prompt word to be generated; A natural language description of the schedule event is generated based on the structured parameters of the schedule event; wherein, the natural language description of the schedule event is used to describe the schedule event in natural language; Based on the structured parameters of the schedule event and the natural language description, determine the second part of the information of the prompt word to be generated; Based on the first part of the information and the second part of the information, a prompt word corresponding to the scheduled event is generated; wherein, the prompt word is used to call the application programming interface to be invoked for event response processing after determining the event triggered by the user based on the large language model.
2. The method according to claim 1, wherein, The step of generating a natural language description of the schedule event based on the structured parameters of the schedule event includes: Obtain the parameters of the schedule event from the structured parameters of the schedule event; Generate a natural language description of the schedule event based on its parameters.
3. The method according to claim 2, wherein, The step of generating a natural language description of the schedule event based on its parameters includes: The parameters of the scheduled events are cached in a preset parameter list; wherein, a row in the parameter list represents a scheduled event and a column represents a parameter. According to a preset natural language format, the parameters of the schedule events in the parameter list are assembled to obtain a natural language description of the schedule events.
4. The method according to claim 3, wherein, The step of assembling the parameters of the schedule events in the parameter list according to a preset natural language format to obtain a natural language description of the schedule events includes: According to a preset natural language format, the parameters of the schedule events in the parameter list are assembled to obtain an initial language description; wherein, the initial language description is used to represent natural language containing the parameters of the schedule events; Based on a preset language generation model, the initial language description is rewritten and expanded to obtain a natural language description of the schedule event; wherein, the language generation model is used to change the expression of the initial language description.
5. The method according to claim 2, wherein, The step of obtaining the parameters of the schedule event from the structured parameters of the schedule event includes: From the structured parameters of the schedule event, parameters of a preset parameter type are obtained as the parameters of the schedule event.
6. The method according to any one of claims 1-5, wherein, The step of determining the second part of the prompt word to be generated based on the structured parameters of the schedule event and the natural language description includes: The structured parameters of the schedule event and the natural language description are assembled to obtain the second part of the prompt word to be generated.
7. The method according to claim 6, wherein, There are at least two preset structured parameters, and each structured parameter corresponds to a schedule event; The assembly of the structured parameters of the schedule event and the natural language description to obtain the second part of the prompt word to be generated includes: Determine the natural language descriptions for each scheduled event; According to the preset first assembly rule information, the natural language description corresponding to the schedule event and the structured parameters corresponding to the schedule event are assembled to obtain the assembly result of the schedule event. According to the preset second assembly rule information, the assembly results of each schedule event are assembled to obtain the second part of the prompt word to be generated.
8. The method according to any one of claims 1-5 and 7, wherein, The step of generating prompt words corresponding to the schedule event based on the first part of information and the second part of information includes: By assembling the first part of the information and the second part of the information, the prompt words corresponding to the schedule event are obtained.
9. The method according to any one of claims 1-5 and 7, further comprising: Based on the prompt words corresponding to the scheduled events, the response result of the large language model to the preset events is determined; wherein, the large language model is used to respond to the events triggered by the user and output the response result to the events triggered by the user. If it is determined that the response result output by the large language model meets the preset response requirements, then it is determined that the prompt word corresponding to the schedule event will be applied to the large language model.
10. The method according to claim 9, wherein, The step of determining that the response result output by the large language model meets the preset response requirements includes: Determine the similarity between the response output of the large language model and the preset response; If the similarity is greater than a preset similarity threshold, then the response result output by the large language model is determined to meet the preset response requirements.
11. The method according to claim 9, wherein, The step of determining the response result of the large language model to the preset event based on the prompt words corresponding to the scheduled event includes: Based on the large language model, it responds to user-triggered schedule creation instructions; wherein, the schedule creation instructions include a natural language description of the preset event; Based on the prompt words corresponding to the scheduled events, the parameters in the natural language description of the preset events are determined, which are the response results of the large language model to the preset events.
12. A device for determining prompt words in a large language model, comprising: The acquisition unit is used to acquire preset interface description statements, prompt word templates, and structured parameters of schedule events; wherein, the interface description statement represents the parameter information of the schedule event required when calling the application programming interface to be called; the prompt word template is a template corresponding to a portion of the prompt word to be generated; and the structured parameters are the parameters of the schedule event. The first generation unit is used to generate the first part of the information of the prompt word to be generated based on the interface description statement and the prompt word template. The second generation unit is used to generate the second part of the prompt word to be generated based on the structured parameters; The prompt word generation unit is used to generate prompt words corresponding to the scheduled event based on the first part of information and the second part of information; wherein, the prompt words are used to call the application programming interface to be invoked for event response processing after determining the event triggered by the user based on the large language model; The first generation unit includes: The parameter information acquisition module is used to acquire the parameter information of the schedule event required when calling the application programming interface to be called from the interface description statement; The parameter information adding module is used to add the parameter information of the schedule event required when calling the application programming interface to be called to the preset position in the prompt word template to obtain the first part of the prompt word to be generated; The second generation unit includes: A language generation module is used to generate a natural language description of the schedule event based on the structured parameters of the schedule event; wherein, the natural language description of the schedule event is used to describe the schedule event in natural language; The information determination module is used to determine the second part of the information of the prompt word to be generated based on the structured parameters of the schedule event and the natural language description.
13. The apparatus according to claim 12, wherein, The language generation module includes: The parameter acquisition submodule is used to acquire the parameters of the schedule event from the structured parameters of the schedule event; The language generation submodule is used to generate a natural language description of the schedule event based on the parameters of the schedule event.
14. The apparatus according to claim 13, wherein, The language generation submodule includes: The parameter caching module is used to cache the parameters of the schedule event in a preset parameter list; wherein, a row in the parameter list represents a schedule event and a column represents a parameter. The parameter assembly submodule is used to assemble the parameters of the schedule events in the parameter list according to a preset natural language format to obtain a natural language description of the schedule events.
15. The apparatus according to claim 14, wherein, The parameter assembly sub-module is specifically used for: According to a preset natural language format, the parameters of the schedule events in the parameter list are assembled to obtain an initial language description; wherein, the initial language description is used to represent natural language containing the parameters of the schedule events; according to a preset language generation model, the initial language description is rewritten and expanded to obtain a natural language description of the schedule events; wherein, the language generation model is used to change the expression method of the initial language description.
16. The apparatus according to claim 13, wherein, The parameter acquisition submodule is specifically used for: From the structured parameters of the schedule event, parameters of a preset parameter type are obtained as the parameters of the schedule event.
17. The apparatus according to any one of claims 12-16, wherein, The information determination module includes: The information assembly submodule is used to assemble the structured parameters of the schedule event and the natural language description to obtain the second part of the prompt word to be generated.
18. The apparatus according to claim 17, wherein, There are at least two preset structured parameters, and each structured parameter corresponds to a schedule event; The information assembly submodule is specifically used for: Determine the natural language description corresponding to each schedule event; according to the preset first assembly rule information, assemble the natural language description corresponding to the schedule event with the structured parameters corresponding to the schedule event to obtain the assembly result of the schedule event; According to the preset second assembly rule information, the assembly results of each schedule event are assembled to obtain the second part of the prompt word to be generated.
19. The apparatus according to any one of claims 12-16, 18, wherein, The prompt word generation unit is specifically used for: By assembling the first part of the information and the second part of the information, the prompt words corresponding to the schedule event are obtained.
20. The apparatus according to any one of claims 12-16, 18, further comprising: The result output unit is used to determine the response result of the large language model to the preset event based on the prompt words corresponding to the scheduled event; wherein, the large language model is used to respond to the event triggered by the user and output the response result to the event triggered by the user. The result comparison unit is used to determine, if it is determined that the response result output by the large language model meets the preset response requirements, to apply the prompt word corresponding to the schedule event to the large language model.
21. The apparatus according to claim 20, wherein, The result comparison unit includes: A similarity determination module is used to determine the similarity between the response result output by the large language model and a preset response result; The similarity comparison module is used to determine that the response result output by the large language model meets the preset response requirements if the similarity is greater than a preset similarity threshold.
22. The apparatus according to claim 20, wherein, The result output unit includes: The instruction response module is used to respond to user-triggered schedule creation instructions based on the large language model; wherein the schedule creation instruction includes a natural language description of the preset event; The result determination module is used to determine the parameters in the natural language description of the preset event based on the prompt words corresponding to the scheduled event, which is the response result of the large language model to the preset event.
23. An electronic device, comprising: 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 to enable the at least one processor to perform the method of any one of claims 1-11.
24. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-11.
25. A computer program product comprising a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-11.