Methods, devices, equipment, storage media, and vehicles for generating prompt words

By identifying the business category of the input statement and generating prompt words that match the features, the problem of low prompt word matching in existing technologies is solved, and the accuracy of large model response is improved.

CN123117101APending Publication Date: 2026-11-17BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510638494.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-16
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

The prompts generated by existing technologies have a low degree of matching with the actual business semantics, which affects the accuracy of the large model's response.

Method used

By identifying the business category of the input statement, prompt words that match the characteristics are generated based on the business category, including determining the business configuration and editing the input statement to generate accurate prompt words.

Benefits of technology

It improved the matching degree between prompt words and actual tasks, and enhanced the accuracy of the large model's response to user input.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123117101A_ABST
    Figure CN123117101A_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, device, storage medium, and vehicle for generating prompt words. The method includes: acquiring an input statement; determining the business category of the input statement; and generating prompt words corresponding to the input statement based on the business category. According to embodiments of this application, more accurate prompt words can be generated, thereby improving the accuracy of large-scale models' responses to user input statements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of large model technology, and particularly relates to a method, apparatus, device, storage medium and vehicle for generating prompt words. Background Technology

[0002] In related business processes, after receiving user input, the input is typically filled into a pre-defined, fixed prompt word template to generate complete prompt words for input into a large model. This method of prompt word generation makes it difficult to guarantee a high degree of matching between the prompt words and the actual business semantics; therefore, prompt words generated in this way affect the accuracy of the large model's response. Summary of the Invention

[0003] This application provides a method, apparatus, device, storage medium, and vehicle for generating prompt words, which can solve the problem that the generated prompt words in related services affect the accuracy of large model responses.

[0004] In a first aspect, embodiments of this application provide a method for generating prompt words, the method comprising:

[0005] Get the input statement;

[0006] Determine the business category of the input statement;

[0007] Based on the business category, generate prompt words corresponding to the input statement.

[0008] In some embodiments, generating prompt words corresponding to the input statement based on the business category includes:

[0009] Determine the service configuration corresponding to the service category;

[0010] The input statement is edited based on the features of the service configuration to obtain prompt words.

[0011] In some embodiments, determining the service configuration corresponding to the service category includes:

[0012] If the input statement is entered via voice, obtain the user identifier corresponding to the input statement;

[0013] Convert the input statement in voice form into text information;

[0014] Obtain historical interaction information between the user corresponding to the user identifier and the electronic device;

[0015] The service configuration is determined based on the service category of the text information and the historical interaction information.

[0016] In some embodiments, determining the service configuration corresponding to the service category includes:

[0017] Acquire the status information of the interactive device, the status information including sensor information collected by sensors in the interactive device and the working mode of the interactive device;

[0018] The service configuration is determined based on the service category of the input statement and the status information.

[0019] In some embodiments, determining the service configuration corresponding to the service category includes:

[0020] Display at least two business controls, where each business control corresponds to a business configuration;

[0021] Receive user input for selecting the first business control among the at least two business controls;

[0022] In response to the selection input, the business configuration corresponding to the first business control is determined to be the business configuration corresponding to the business category of the input statement.

[0023] In some embodiments, editing the input statement according to the features of the service configuration to obtain prompt words includes:

[0024] Based on the characteristics of the service configuration, at least one instruction and instruction framework corresponding to the input statement are determined;

[0025] The input statement and the at least one instruction are combined according to the instruction framework to obtain the prompt word.

[0026] In some embodiments, determining at least one instruction and instruction framework corresponding to the input statement based on the features of the service configuration includes:

[0027] The matching strategy for the input statement is determined based on the characteristics of the service configuration;

[0028] According to the matching strategy, at least one instruction corresponding to the business category of the input statement is determined from the dynamic instruction library and the static instruction library;

[0029] According to the matching strategy, the instruction frame corresponding to the business category of the input statement is determined from the instruction frame library.

[0030] In some embodiments, the at least one instruction includes a target instruction, and before determining the at least one instruction and instruction framework corresponding to the input statement based on the features of the service configuration, the method further includes:

[0031] Obtain the initial input command;

[0032] The initial instruction is optimized using the large language model until the first instruction obtained after the i-th iteration of optimization meets the optimization stopping condition. Then, the first instruction is determined as the target instruction, where i is 0 or a positive integer. When i is 0, the first instruction is the initial instruction.

[0033] Secondly, embodiments of this application provide a prompt word generation apparatus, the apparatus comprising:

[0034] The acquisition module is used to acquire input statements;

[0035] The determination module is used to determine the business category of the input statement;

[0036] The generation module is used to generate prompt words corresponding to the input statement based on the business category.

[0037] Thirdly, embodiments of this application provide a prompt word generation device, the device including: a processor and a memory storing computer program instructions;

[0038] The processor implements the above method for generating prompts when executing computer program instructions.

[0039] Fourthly, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement the above-mentioned method for generating prompt words.

[0040] Fifthly, embodiments of this application provide a vehicle, which includes at least one of the aforementioned devices, equipment, and storage media.

[0041] In this embodiment, the accurate generation of prompt words is achieved by identifying the business category of the input statement and determining the corresponding prompt words based on the business category. Compared with the existing technology that relies on fixed templates to generate prompt words, this solution can dynamically identify the business category based on the semantics of the input statement and generate prompt words that conform to the characteristics of the business category, significantly improving the matching degree between prompt words and actual tasks. Therefore, it effectively solves the problem of large model response deviation caused by inaccurate prompt words and improves the accuracy of large models' responses to user input statements. Attached Figure Description

[0042] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 This is a flowchart illustrating a method for generating prompt words according to an embodiment of this application;

[0044] Figure 2 This is a schematic diagram of the structure of a prompt word generation device provided in an embodiment of this application;

[0045] Figure 3 This is a schematic diagram of the hardware structure of a prompt word generation device provided in an embodiment of this application. Detailed Implementation

[0046] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples of this application.

[0047] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0048] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The embodiments will now be described in detail with reference to the accompanying drawings.

[0049] Specifically, in order to solve the problems of the prior art, embodiments of this application provide a method, apparatus, device, storage medium, and vehicle for generating prompt words. The method for generating prompt words provided in this application embodiment will be described first below.

[0050] Figure 1A flowchart illustrating a method for generating prompt words according to an embodiment of this application is shown. This method can be used in vehicles, smartphones, or other smart devices with interactive functions. The method includes the following steps:

[0051] S110, Obtain the input statement.

[0052] In this embodiment, the input statement is used to interact with the smart device, which can be configured to connect to devices such as vehicles and mobile phones via wireless networks.

[0053] The input statement can be a question or request entered by the user. For example, the user can input the statement via text or voice. With text input, the user can directly input text into the device using a keyboard, touchpad, screen, etc. With voice input, the user can input voice through a microphone or other voice input device, and the device can convert the input voice into text format. For example, if the smart device is installed in a vehicle, the user can speak the input statement: "Navigate me to the nearest gas station."

[0054] Input statements can also be system-triggered. That is, without direct user input, the system can automatically generate input statements based on certain events, states, or strategies for further scheduling of large models. For example, a user can set up a weather forecast to be broadcast every morning at 7 AM on a smart device. Then, every morning at 7 AM, the system will trigger the input statement: "Please broadcast today's weather for the current location to the user."

[0055] S120, determine the business category of the input statement.

[0056] In this embodiment, after the device receives the user's input statement, it can identify the service category to which the input statement belongs. If the smart device is installed in a vehicle, the service category may include travel services, vehicle control, general Q&A, and scene linkage, etc.

[0057] For example, when a user says "navigate to the nearest charging station", the smart device can identify that the input belongs to the "travel services" business category.

[0058] S130, Generate prompt words corresponding to the input statement based on the business category.

[0059] In this embodiment, after identifying the business category of the input statement, the system can call the corresponding instruction template according to the business category, and generate structured prompt words based on the content of the input statement and the instruction template. For example, if the input statement is "navigate to the nearest charging station", the business category of the input statement can be determined to be "travel services". Then the system can generate the prompt words "please recommend the nearest charging station based on the current location and provide navigation route" according to the instruction template of "travel services".

[0060] In this embodiment, the accurate generation of prompt words is achieved by identifying the business category of the input statement and determining the corresponding prompt words based on the business category. Compared with the existing technology that relies on fixed templates to generate prompt words, this solution can dynamically identify the business category based on the semantics of the input statement and generate prompt words that conform to the characteristics of the business category, significantly improving the matching degree between prompt words and actual tasks. Therefore, it effectively solves the problem of large model response deviation caused by inaccurate prompt words and improves the accuracy of large models' responses to user input statements.

[0061] Specifically, in some embodiments, generating prompt words corresponding to the input statement based on the business category includes:

[0062] Determine the service configuration corresponding to the service category;

[0063] The input statement is edited based on the features of the service configuration to obtain prompt words.

[0064] In this embodiment, business configuration refers to a pre-defined set of rules, parameters, and resources for a specific business scenario, used to guide the model in understanding and processing input statements. It typically includes business classification, matching strategies, instruction frameworks for prompt words, static instructions, and dynamic instructions. It determines how the device should respond to or process user input in a specific business scenario. Specifically, the matching strategy can select the appropriate instruction framework and instructions for the input statement based on factors such as the input statement, user state, and device state.

[0065] For example, a smart device can contain a database that may include multiple service configurations. Each service configuration is mapped to one or more service categories. Therefore, whenever the service category of an input statement is determined, the database can be queried to find the corresponding service configuration based on that service category. After determining the service category of the input statement, the user can also manually select the service configuration corresponding to that service category.

[0066] After determining the business configuration that has a mapping relationship with the business category, the matching strategy in the business configuration can be obtained. The instructions and instruction framework are determined according to the matching strategy. Then, the input statement is edited based on the instructions and instruction framework determined by the matching strategy to obtain the prompt words.

[0067] For example, based on the matching strategy in the business configuration, the system will automatically select the instructions and instruction frames that best match the characteristics of the input statement, such as keywords, context, or semantic category. For instance, if the business category of the input statement is "car recommendation," the matching strategy may guide the system to select instructions and instruction frames related to car recommendation, and then combine the input statement and instructions according to the framework structure of the instruction frame to obtain prompt words.

[0068] This enhances the system's ability to handle diverse tasks, its response accuracy, and its overall flexibility and stability. Simultaneously, the system can more efficiently adapt to different business scenarios, providing users with consistent and personalized services.

[0069] Specifically, in some embodiments, determining the service configuration corresponding to the service category includes:

[0070] If the input statement is entered via voice, obtain the user identifier corresponding to the input statement;

[0071] Convert the input statement in voice form into text information;

[0072] Obtain historical interaction information between the user corresponding to the user identifier and the electronic device;

[0073] The service configuration is determined based on the service category of the text information and the historical interaction information.

[0074] In this embodiment, when the input statement is a voice input statement, the device can extract the user identifier of the voice. The user identifier contains unique characteristics of the user's voice, such as pitch, frequency, and speech rate, which can be used to identify the speaker's identity.

[0075] Specifically, the device may include a user identifier library containing multiple pre-stored user identifiers and user identity information mapped to each pre-stored user identifier. Therefore, after determining the user identifier corresponding to the input statement, the user identifier corresponding to the input statement can be matched with the pre-stored user identifiers in the user identifier library. The matching result then determines the identity of the user who output the input statement and obtains the user's historical interaction information with the device. This historical interaction information includes the user's previous interaction records with the device, command habits, preference settings, etc.

[0076] Subsequently, electronic devices can utilize speech recognition technology to convert the user's voice input into text information, identify the business category of the text information, and determine instructions and instruction frames based on the business category and historical interaction information. For example, a large language model can be used to analyze the input statement, business category, and historical interaction information to dynamically select the most appropriate instructions and instruction frames.

[0077] For example, the input statement is "Please play a song by artist A." The business category of the text information is "music playback." Based on the statement, the electronic device can confirm the user's identity as user B and retrieve user B's historical interaction information from the device. This historical interaction information includes user B's frequently selected music genres, volume, and other information. Therefore, based on the business category and historical interaction information, the instruction framework under the "music playback" business category can be determined to include "search for songs, play songs, and set volume." Furthermore, based on the business category and historical interaction information of the text information, the instructions can be determined as "search for songs by artist A," "play rock songs by artist A," and "adjust the music playback volume to medium."

[0078] In the above embodiments, by identifying user identity through user identifiers and utilizing their historical interaction data, the system can not only better understand the semantics of the current input, but also generate and execute more accurate instructions based on the user's habits and preferences, thereby improving user experience and operational efficiency.

[0079] Specifically, in some embodiments, determining the service configuration corresponding to the service category includes:

[0080] Acquire the status information of the interactive device, the status information including sensor information collected by sensors in the interactive device and the working mode of the interactive device;

[0081] The service configuration is determined based on the service category of the input statement and the status information.

[0082] In this embodiment, the most suitable service configuration can be determined and selected by obtaining the status information of the interactive device and combining it with the service category of the input statement. The status information of the interactive device may include sensor data of the sensors in the interactive device and the working mode of the interactive device.

[0083] Specifically, taking a vehicle as an example of an interactive device, the business categories of input statements can include question-and-answer, translation, lifestyle, work, navigation, and entertainment, etc. Each business category can correspond to at least one instruction and one instruction framework.

[0084] After receiving user input, the vehicle can acquire real-time status information, such as speed, acceleration, angular velocity, and sensor data from various sensors, including GPS location data and in-vehicle temperature data. Furthermore, it can determine the service category of the input statement. Then, since the service configuration includes instructions and instruction frames, the vehicle can combine the vehicle's status information and the service category of the user's input statement to determine at least one instruction and instruction frame.

[0085] For example, a user's input statement might be "Navigate to the nearest gas station," in which case the business category of the input statement is navigation. The corresponding instruction framework for navigation could be "obtain vehicle status information, generate navigation instructions based on the status information, and perform safety checks." Vehicle status information includes the current vehicle speed of 60 km / h, a strong GPS (Global Positioning System) signal, and good road conditions detected by sensors. Therefore, instructions determined based on the business category of the input statement and the vehicle status information could include "Plan the optimal route to the nearest gas station," "Modify the navigation route if sensors detect an obstacle or road construction ahead," and "Modify the navigation route if the vehicle speed becomes abnormal."

[0086] In the above embodiments, based on the vehicle's status information and the business category of the input statement, the system can determine more precise business configurations such as instructions and instruction frameworks, thereby generating more accurate prompts.

[0087] Specifically, in some embodiments, determining the service configuration corresponding to the service category includes:

[0088] Display at least two business controls, where each business control corresponds to a business configuration;

[0089] Receive user input for selecting the first business control among the at least two business controls;

[0090] In response to the selection input, the business configuration corresponding to the first business control is determined to be the business configuration corresponding to the business category of the input statement.

[0091] In this embodiment, after acquiring the input statement and determining its business category, at least two business controls can be displayed on the interactive device, each corresponding to a business configuration. For example, when the interactive device is in a vehicle, at least two business controls can be displayed on the vehicle's infotainment system or on the vehicle's head-up display.

[0092] After seeing these business controls, the user can select a first business control from at least two to input information. This selection input indicates whether the business configuration corresponding to the first business control is the business configuration corresponding to the business category of the input statement. In response to this selection input, the system can then determine the business configuration corresponding to the first business control as the business configuration corresponding to the business category of the input statement.

[0093] For example, after receiving the input statement, the interactive device's display interface will show multiple business controls. The business configurations corresponding to these controls can include: car Q&A, travel inspiration, general encyclopedia, personality Q&A, translation assistant, life assistant, work assistant, navigation request, and entertainment / leisure, among other business configurations. If the input statement is "Navigate to the nearest gas station," the user can select the first business control for input. The business configuration corresponding to this first business control can be a navigation request. The system will then determine the navigation request as the business configuration corresponding to the business category of the input statement.

[0094] The above solution can display multiple business controls that users can actively select, significantly improving the accuracy and flexibility of business configuration, avoiding response deviations caused by system misjudgments, and thus enhancing the accuracy of prompts.

[0095] Specifically, in some embodiments, editing the input statement according to the features of the service configuration to obtain prompt words includes:

[0096] Based on the characteristics of the service configuration, at least one instruction and instruction framework corresponding to the input statement are determined;

[0097] The input statement and the at least one instruction are combined according to the instruction framework to obtain the prompt word.

[0098] In this embodiment, after the interactive device receives the input statement from the user, it can identify the service category to which the input statement belongs, and then determine the service configuration corresponding to the service category, and determine at least one instruction and instruction framework corresponding to the input statement based on the characteristics of the service configuration.

[0099] Here, "instruction" refers to a predefined command within the device. "Instruction framework" refers to a template that guides how to combine input statements with instructions to form a complete prompt.

[0100] In addition, instructions can also include dynamic instructions and static instructions. Static instructions are predefined, fixed, and unchanging. These instructions are determined during system design and do not change based on input statements or environment when retrieved. They are used to guide large models to complete specific understanding or generation tasks. Static instructions can include system-related, business-related, dialogue-related, knowledge-related, CoT (Chain of Thought), skill-related, style-related, tag-related, and combined instructions. For example, a system-related static instruction could be: "Your name is Model One, please answer as Model One," or a dialogue-related static instruction could be: "Please write an appropriate response based on the user's input statement, avoiding political and vulgar content."

[0101] Dynamic instructions are instructions generated based on real-time input, environmental, or contextual information. Dynamic instructions include those related to time, location, environment, user interests, in-vehicle interaction, semantic enhancement, and function calls. For example, a dynamic instruction could be a time-related instruction such as "Today's date is: August 21, 2023" or a weather-related instruction such as "Today's weather is sunny."

[0102] After determining at least one instruction and instruction framework corresponding to the input statement, the input statement and the at least one instruction can be combined according to the instruction framework to obtain the prompt word;

[0103] The prompt words are used to input into the language model to obtain the response statement corresponding to the input statement output by the language model.

[0104] In this embodiment, after determining at least one instruction and instruction framework corresponding to the business category of the input statement, the input statement and at least one instruction are combined according to the instruction framework to obtain a complete prompt word.

[0105] For example, if the input statement is "I want to go to the nearest gas station", the corresponding instruction framework can be determined as a "navigation instruction framework" based on the characteristics of its business configuration. At least one instruction can be included, such as "get current location", "search for the nearest gas station", and "generate navigation path". The system can then combine the input statement with these instructions according to the framework structure to generate the complete prompt: "Please get the current location and navigate the user to the nearest gas station". Similarly, if the input statement is "play a song by artist A", the corresponding instruction framework can be determined as a "music playback instruction framework" based on the characteristics of its business configuration. At least one instruction can be included, such as "search for songs by artist A" and "set volume". Therefore, at least one instruction can be combined with the input statement according to the framework structure to generate the prompt: "Please search for songs by artist A and start playing at the default volume".

[0106] After generating the prompt words, they can be input into a pre-trained language model. The language model will then generate a response based on the prompt words that is relevant to the user's input. The language model is a natural language processing model used to understand and generate natural language.

[0107] In this embodiment, the user's input statement is acquired; at least one instruction and instruction framework corresponding to the business category of the input statement are determined; the input statement and at least one instruction are combined according to the instruction framework to obtain prompt words; the prompt words are input into a language model to obtain the response statement corresponding to the input statement output by the language model. In this way, based on the business category of the input statement, suitable instructions and instruction frameworks can be automatically selected, and instructions can be combined according to the instruction framework to quickly generate accurate prompt words. This greatly simplifies the prompt word generation process, eliminates the need for manual intervention, and shortens operation time.

[0108] Specifically, in some embodiments, determining at least one instruction and instruction framework corresponding to the input statement based on the features of the service configuration includes:

[0109] The matching strategy for the input statement is determined based on the characteristics of the service configuration;

[0110] According to the matching strategy, at least one instruction corresponding to the business category of the input statement is determined from the dynamic instruction library and the static instruction library;

[0111] According to the matching strategy, the instruction frame corresponding to the business category of the input statement is determined from the instruction frame library.

[0112] In this embodiment, the electronic device includes a dynamic instruction library, a static instruction library, and an instruction framework library. The dynamic instruction library includes multiple pre-stored dynamic instructions, the static instruction library includes multiple pre-stored static instructions, and the instruction framework library includes multiple pre-stored instruction frameworks.

[0113] Matching strategy refers to a set of rules preset in business configuration to guide the selection of instructions and instruction frames. It can determine at least one instruction and instruction frame that best matches the input statement based on information such as semantic features, keywords, context, user profile or device status.

[0114] For example, during the matching process of instruction frames, if the business configuration corresponding to the input statement is determined to be "music playback", a music playback class frame that has a mapping relationship with the business configuration can be determined in the instruction frame library according to the matching strategy. The frame structure can include "search → play → settings". As another example, during the matching process of at least one instruction, the keywords or semantic tags of the input statement can be obtained, and at least one instruction that has a mapping relationship with the keyword or semantic tag can be determined from the instruction library.

[0115] In the above solution, the matching strategy can be dynamically determined based on business configuration features, and instructions and instruction frames can be accurately selected accordingly. Then, prompt words can be generated based on the instruction frames and instructions, which significantly improves the accuracy of prompt words and the accuracy of large model responses.

[0116] Furthermore, in some embodiments, the at least one instruction includes a target instruction, and before determining the at least one instruction and instruction framework corresponding to the input statement based on the characteristics of the service configuration, the method further includes:

[0117] Obtain the initial input command;

[0118] The initial instruction is optimized using the large language model until the first instruction obtained after the i-th iteration of optimization meets the optimization stopping condition. Then, the first instruction is determined as the target instruction, where i is 0 or a positive integer. When i is 0, the first instruction is the initial instruction.

[0119] In this embodiment, the target instruction in the prompt needs to be iteratively optimized based on the initial instruction until the optimized initial instruction can meet the optimization stopping condition before the optimized instruction can be determined as the target instruction.

[0120] Specifically, a task objective can be defined simultaneously with the user's initial input. If the first instruction optimized in the Nth iteration is input into the language model and the resulting reference response satisfies the task objective, then the first instruction obtained after the i-th iteration can be considered to satisfy the optimization stopping condition, and thus the first instruction can be identified as the target instruction. Here, the task objective refers to the effect that the user hopes the target instruction ultimately output by the language model will achieve.

[0121] By training the target instructions in advance, it can be ensured that the response obtained from each instruction meets the user's needs, thereby helping the user quickly generate an effective prompt word.

[0122] As an optional embodiment, before optimizing the initial instruction using the large language model until the first instruction obtained after the i-th iteration of optimization satisfies the training stopping condition, and before determining the first instruction as the target instruction, the method further includes:

[0123] Obtain the expected response from the user's input;

[0124] Input the first instruction after the i-th iteration optimization into the language model to obtain the reference response output by the language model;

[0125] If the text gradient information of the reference response and the expected response satisfies the convergence condition, it is determined that the first instruction after the i-th iteration of optimization satisfies the optimization stopping condition.

[0126] In this embodiment, a desired response can be provided simultaneously with the user's initial input. This desired response characterizes the response to the command that the user expects the language model to output.

[0127] The process of optimizing the instruction for the i-th time is as follows: First, the first instruction after i iterations of optimization of the initial instruction can be obtained. If i is 0, then the first instruction is the initial instruction. Then, the first instruction is input into the language big model to obtain the i-th reference response output by the language big model.

[0128] The text gradient information between the i-th reference response and the expected response can be calculated. Text gradient information refers to the information obtained by the system measuring the difference or similarity between the reference response and the expected response. This difference can be measured using techniques such as text similarity, word matching, and semantic similarity.

[0129] If the text gradient information of the i-th reference response and the expected response satisfies the convergence condition, then the difference between the i-th reference response and the expected response is small enough or the similarity is high enough. Therefore, the first instruction after i iterations of optimization can be considered to meet the user-defined target, and the first instruction after i iterations of optimization can be directly determined as the target instruction.

[0130] If the text gradient information of the i-th reference response and the expected response does not meet the convergence condition, it can be considered that the difference between the i-th reference response and the expected response is not small enough or the similarity is not high enough. Then it can be considered that the first instruction after i iterations of optimization still does not meet the user-set target. In this case, the first instruction after i iterations of optimization is directly input into the iterative optimization model to continue iterative optimization until the optimization stopping condition is met.

[0131] In the above embodiments, the instructions can be continuously adjusted and improved through multiple optimizations, so that the generated reference response is as close as possible to the user's expected response, thereby improving the response quality of instructions and prompts and user satisfaction.

[0132] Furthermore, after generating the prompt words, they can be input into a pre-trained language model. The language model will then generate a response statement related to the input statement based on the prompt words. The language model is a natural language processing model used to understand and generate natural language.

[0133] In this embodiment, the business category of the input statement is identified, and the corresponding prompt word is determined based on the business category, thus achieving accurate prompt word generation. Compared to the existing method of generating prompt words based on fixed templates, this solution can dynamically identify the business category based on the semantics of the input statement and generate prompt words that conform to the characteristics of that business category, significantly improving the matching degree between the prompt words and the actual task. Therefore, it effectively solves the problem of large model response deviation caused by inaccurate prompt words, and improves the accuracy of large models' responses to user input statements.

[0134] Based on the prompt word generation method provided in the above embodiments, this application also provides specific implementations of the prompt word generation apparatus. Please refer to the following embodiments.

[0135] First see Figure 2 The prompt word generation device 200 provided in this application embodiment includes the following modules:

[0136] Module 201 is used to acquire input statements;

[0137] The determining module 202 is used to determine the business category of the input statement;

[0138] The generation module 203 is used to generate prompt words corresponding to the input statement based on the business category.

[0139] In this embodiment, the accurate generation of prompt words is achieved by identifying the business category of the input statement and determining the corresponding prompt words based on the business category. Compared with the existing technology that relies on fixed templates to generate prompt words, this solution can dynamically identify the business category based on the semantics of the input statement and generate prompt words that conform to the characteristics of the business category, significantly improving the matching degree between prompt words and actual tasks. Therefore, it effectively solves the problem of large model response deviation caused by inaccurate prompt words and improves the accuracy of large models' responses to user input statements.

[0140] As one implementation of this application, the above-mentioned generation module 203 may further include:

[0141] The first determining unit is used to determine the service configuration corresponding to the service category;

[0142] The editing unit is used to edit the input statement according to the features of the service configuration to obtain prompt words.

[0143] As one implementation of this application, the determining module 202 may further include:

[0144] The first acquisition unit is used to acquire the user identifier corresponding to the input statement when the input statement is input in the form of voice.

[0145] A conversion unit is used to convert the input statement in speech form into text information;

[0146] The second acquisition unit is used to acquire historical interaction information between the user corresponding to the user identifier and the electronic device.

[0147] The first determining unit is used to determine the service configuration based on the service category of the text information and the historical interaction information.

[0148] As one implementation of this application, the determining module 202 may further include:

[0149] The third acquisition unit is used to acquire the status information of the interactive device, the status information including sensor information collected by the sensors in the interactive device and the working mode of the interactive device;

[0150] The second determining unit is used to determine the service configuration based on the service category of the input statement and the status information.

[0151] As one implementation of this application, the determining module 202 may further include:

[0152] The display unit is used to display at least two business controls, where each business control corresponds to a business configuration;

[0153] The receiving unit is used to receive the user's selection input for the first business control among the at least two business controls;

[0154] The third determining unit is used to determine the business configuration corresponding to the first business control as the business configuration corresponding to the business category of the input statement in response to the selection input.

[0155] As one implementation of this application, the above-mentioned editing unit can also be used for:

[0156] Based on the characteristics of the service configuration, at least one instruction and instruction framework corresponding to the input statement are determined;

[0157] The input statement and the at least one instruction are combined according to the instruction framework to obtain the prompt word.

[0158] As one implementation of this application, the above-mentioned editing unit can also be used for:

[0159] The matching strategy for the input statement is determined based on the characteristics of the service configuration;

[0160] According to the matching strategy, at least one instruction corresponding to the business category of the input statement is determined from the dynamic instruction library and the static instruction library;

[0161] According to the matching strategy, the instruction frame corresponding to the business category of the input statement is determined from the instruction frame library.

[0162] As one implementation of this application, the above-mentioned prompt word generation device 200 may further include:

[0163] The input module is used to obtain the initial input instructions;

[0164] The training module is used to optimize the initial instruction using the large language model until the first instruction obtained after the i-th iteration of optimization meets the optimization stopping condition, and then the first instruction is determined as the target instruction, where i is 0 or a positive integer. When i is 0, the first instruction is the initial instruction.

[0165] The prompt word generation device provided in this embodiment of the invention can implement the steps in the above method embodiments, and will not be repeated here to avoid repetition.

[0166] Figure 3 A schematic diagram of the hardware structure of the prompt word generation device provided in an embodiment of this application is shown.

[0167] The device for generating prompts may include a processor 1001 and a memory 1002 storing computer program instructions.

[0168] Specifically, the processor 1001 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0169] Memory 1002 may include mass storage for data or instructions. For example, and not limitingly, memory 1002 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 1002 may include removable or non-removable (or fixed) media. Where appropriate, memory 1002 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 1002 is non-volatile solid-state memory.

[0170] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to one aspect of this disclosure.

[0171] The processor 1001 reads and executes computer program instructions stored in the memory 1002 to implement any of the prompt word generation methods in the above embodiments.

[0172] In one example, the device for generating prompt words may further include a communication interface 1003 and a bus 1010. Wherein, such as Figure 3 As shown, the processor 1001, memory 1002, and communication interface 1003 are connected through bus 1010 and complete communication with each other.

[0173] The communication interface 1003 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0174] Bus 1010 includes hardware, software, or both, that couples components of the prompt generation device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 1010 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.

[0175] The device for generating the prompt word can be based on the above embodiments, thereby realizing the method and apparatus for generating the prompt word as described above.

[0176] Furthermore, in conjunction with the prompt word generation method in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the prompt word generation methods in the above embodiments and achieve the same technical effect. To avoid repetition, further details are omitted here. The aforementioned computer-readable storage medium may include non-transitory computer-readable storage media, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, etc., and is not limited thereto.

[0177] In addition, this application also provides a vehicle including computer program instructions, which, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.

[0178] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0179] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0180] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0181] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and vehicles according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to create a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowchart illustrations, and combinations of blocks in the block diagrams and / or flowchart illustrations, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0182] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method for generating prompt words, characterized in that, The method includes: Get the input statement; Determine the business category of the input statement; Based on the business category, generate prompt words corresponding to the input statement.

2. The method for generating prompt words according to claim 1, characterized in that, The step of generating prompt words corresponding to the input statement based on the business category includes: Determine the service configuration corresponding to the service category; The input statement is edited based on the features of the service configuration to obtain prompt words.

3. The method for generating prompt words according to claim 2, characterized in that, Determining the service configuration corresponding to the service category includes: If the input statement is entered via voice, obtain the user identifier corresponding to the input statement; Convert the input statement in voice form into text information; Obtain historical interaction information between the user corresponding to the user identifier and the electronic device; The service configuration is determined based on the service category of the text information and the historical interaction information.

4. The method for generating prompt words according to claim 2 or 3, characterized in that, Determining the service configuration corresponding to the service category includes: Acquire the status information of the interactive device, the status information including sensor information collected by sensors in the interactive device and the working mode of the interactive device; The service configuration is determined based on the service category of the input statement and the status information.

5. The method for generating prompt words according to any one of claims 2-4, characterized in that, Determining the service configuration corresponding to the service category includes: Display at least two business controls, where each business control corresponds to a business configuration; Receive user input for selecting the first business control among the at least two business controls; In response to the selection input, the business configuration corresponding to the first business control is determined to be the business configuration corresponding to the business category of the input statement.

6. The method for generating prompt words according to any one of claims 2-5, characterized in that, The step of editing the input statement according to the features of the service configuration to obtain prompt words includes: Based on the characteristics of the service configuration, at least one instruction and instruction framework corresponding to the input statement are determined; The input statement and the at least one instruction are combined according to the instruction framework to obtain the prompt word.

7. The method for generating prompt words according to claim 6, characterized in that, Determining at least one instruction and instruction framework corresponding to the input statement based on the features of the service configuration includes: The matching strategy for the input statement is determined based on the characteristics of the service configuration; According to the matching strategy, at least one instruction corresponding to the business category of the input statement is determined from the dynamic instruction library and the static instruction library; According to the matching strategy, the instruction frame corresponding to the business category of the input statement is determined from the instruction frame library.

8. The method for generating prompt words according to claim 6 or 7, characterized in that, The at least one instruction includes a target instruction. Before determining the at least one instruction and instruction framework corresponding to the input statement based on the features of the service configuration, the method further includes: Obtain the initial input command; The initial instruction is optimized using the large language model until the first instruction obtained after the i-th iteration of optimization meets the optimization stopping condition. Then, the first instruction is determined as the target instruction, where i is 0 or a positive integer. When i is 0, the first instruction is the initial instruction.

9. A device for generating prompt words, characterized in that, The device includes: The acquisition module is used to acquire input statements; The determination module is used to determine the business category of the input statement; The generation module is used to generate prompt words corresponding to the input statement based on the business category.

10. A device for generating prompt words, characterized in that, The device for generating the prompt word includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the prompt word generation method as described in any one of claims 1-8.

11. A computer storage medium, characterized in that, The computer storage medium stores computer program instructions, which, when executed by a processor, implement the prompt word generation method as described in any one of claims 1-8.

12. A vehicle, characterized in that, The vehicle includes at least one of the apparatus of claim 9, the device of claim 10, and the storage medium of claim 11.