Non-transitory computer readable storage medium and prompt message generation method

TWI940895BActive Publication Date: 2026-10-01DELTA ELECTRONICS INC(CN)
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
TW113121797
Authority / Receiving Office
TW · TW
Patent Type
Patents
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2026-10-01
Estimated Expiration
2044-06-12

AI Technical Summary

Technical Problem

Large language models require manual customization of prompts, which is inefficient and requires re-testing when the model is updated, leading to suboptimal performance and prolonged development times.

Method used

A method and non-transitory computer-readable storage medium that automatically generates prompt messages by analyzing input content and predefined rules to create task prompts and examples, synthesizing them into a prompt message, reducing the need for manual intervention and application-based fine-tuning.

Benefits of technology

Accelerates the development of text-related applications by eliminating manual prompt creation, enhancing user experience with engaging and interactive interactions in applications like intelligent question answering and chatbots.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure TWG2TB001913526_001
    Figure TWG2TB001913526_001
  • Figure TWG2TB001913526_002
    Figure TWG2TB001913526_002
  • Figure TWG2TB001913526_003
    Figure TWG2TB001913526_003
Patent Text Reader

Abstract

A non-transitory computer-readable storage medium is disclosed. This non-transitory computer-readable storage medium is used to perform a prompt message generation method. The prompt message generation method includes the following steps: obtaining at least one key piece of information based on input content information and predefined rules, and generating at least one task prompt based on the at least one key piece of information; obtaining format requirement information based on predefined rules, and parsing the input content information to obtain semantic requirement information; obtaining at least one example data from a text example database based on the semantic requirement information, and processing the at least one example data based on the format requirement information to generate at least one task example; and synthesizing the input content information, at least one task prompt, and at least one task example to generate a prompt message.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This invention relates to a non-transitory computer-readable storage medium and a method for generating prompt messages. Specifically, this invention relates to a non-transitory computer-readable storage medium for automatically generating prompt messages and a method for generating prompt messages. [Previous Technology]

[0002] When the number of parameters in a language model reaches billions, it can be called a large language model (LLM). Compared with traditional pre-trained models (e.g., BERT), large language models output more diverse content, and often require the addition of "prompts" to guide the model to produce output results that better meet the requirements.

[0003] In the context of integrating large language models (LLMs) into actual applications, appropriate prompts need to be customized to meet the specific application requirements. Traditionally, prompts are mostly designed manually; however, it is difficult to find the best prompts manually. In addition, once the prompts are built, they are often not changed. When the core large language model of the application is updated, the performance of all prompts needs to be re-tested, and if the performance is not good, it needs to be fine-tuned manually.

[0004] Therefore, how to provide a technology that can automatically generate prompt messages is a goal that the industry urgently needs to strive for. [Summary of the Invention]

[0005] One objective of this invention is to provide a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores one or more computer programs, and the one or more computer programs can be executed by one or more processors to perform a prompt message generation method, wherein the prompt message generation method includes: obtaining at least one key information based on input content information and predefined rules, and generating at least one task prompt based on the at least one key information; obtaining format requirement information based on predefined rules, and parsing the input content information to obtain semantic requirement information; obtaining at least one example data from a text example database based on the semantic requirement information, and processing the at least one example data based on the format requirement information to generate at least one task example; and synthesizing the input content information, at least one task prompt, and at least one task example to generate a prompt message.

[0006] Another objective of the present invention is to provide a method for generating prompt messages, comprising: obtaining at least one key piece of information based on input content information and predefined rules, and generating at least one task prompt based on the at least one key piece of information; obtaining format requirement information based on predefined rules, and parsing the input content information to obtain semantic requirement information; obtaining at least one example data from a text example database based on the semantic requirement information, and processing the at least one example data based on the format requirement information to generate at least one task example; and synthesizing the input content information, at least one task prompt, and at least one task example to generate a prompt message.

[0007] The prompt message generation technology provided by this invention (including at least a non-transitory computer-readable storage medium and method) automatically generates prompt messages for large language models based on input content information and predefined rules. This eliminates the need for manual intervention in constructing prompt messages or selecting example prompts, reducing the frequency of application-based fine-tuning of prompt messages and thus accelerating the development of text-related applications. Furthermore, the implementation of this invention can be applied to any text-related application project with a large language model as its core engine, accelerating application development timelines. For advanced text-based applications, such as intelligent question answering and chatbots, the automatically generated prompt messages allow users to experience a more engaging and interactive chat experience, rather than following rigid, rule-based robots, and enhance the user experience.

[0008] The following detailed description of the technology and implementation of the present invention is illustrated in conjunction with the drawings, so that those skilled in the art can understand the technical features of the claimed invention.

Implementation Method

[0010] The following will explain the method and apparatus for generating prompt messages and the non-transitory computer-readable storage medium provided by the present invention through embodiments. However, these embodiments are not intended to limit the implementation of the present invention to any environment, application, or manner described in these embodiments. Therefore, the description of the embodiments is for illustrative purposes only and is not intended to limit the scope of the present invention. It should be understood that in the following embodiments and drawings, elements not directly related to the present invention have been omitted and are not shown, and the dimensions of each element and the dimensional ratio between elements are only illustrative and are not intended to limit the scope of the present invention.

[0011] Please refer to Figure 1. Figure 1 is a schematic diagram illustrating a notification message generation device 100 according to some embodiments of the present invention. The detailed structure of the notification message generation device 100 will be described with reference to Figure 7.

[0012] The prompt message generation device 100 can be used to execute the task prompt generation module 132, the task example generation module 134, and the output synthesis module 136. The output of the task prompt generation module 132 serves as part of the input of the output synthesis module 136, and the output of the task example generation module 134 serves as part of the input of the output synthesis module 136. Here, "module" refers to one or more computer programs stored in a computer-readable storage medium, loadable into random access memory, and executed by a processor.

[0013] The task prompt generation module 132 includes a text analysis module 132a and a prompt generation module 132b. The output of the text analysis module 132a serves as the input of the prompt generation module 132b.

[0014] The task example generation module 134 includes a semantic and format analysis module 134a, a semantic requirement processing module 134b, and a format requirement conversion module 134c. The output of the semantic and format analysis module 134a serves as the input of the semantic requirement processing module 134b, and the output of the semantic requirement processing module 134b serves as the input of the format requirement conversion module 134c.

[0015] The output synthesis module 136 includes a check module 136a and a synthesis module 136b. The output of the check module 136a serves as the input of the synthesis module 136b.

[0016] It should be noted that the embodiments shown in Figure 1 are used as examples only, and the implementation methods disclosed herein are not limited thereto.

[0017] As illustrated in Figure 1, in some embodiments, the prompt message generation device 100 is connected to the user device UI, the cloud server CS, and the database DB via a network INT. In some embodiments, the database DB stores predefined rules PR and text example data ED. In some embodiments, the cloud server CS may contain a large language model.

[0018] Please refer to Figure 2. To better understand the present invention, the detailed steps of the prompt message generation device 100 will be discussed in conjunction with the embodiment shown in Figure 2. Figure 2 is a flowchart illustrating a prompt message generation method 200 according to some embodiments of the present invention. It should be noted that the prompt message generation method 200 can be applied to electronic devices with the same or similar structure as the prompt message generation device 100 shown in Figure 1. To simplify the following description, the prompt message generation method 200 of some embodiments of the present disclosure will be described using the embodiment shown in Figure 1 as an example. However, the present disclosure is not limited to the embodiment shown in Figure 1. As shown in Figure 2, the prompt message generation method 200 includes steps S210 to S240.

[0019] In step S210, key information is obtained based on the input content information and predefined rules, and task prompts are generated based on the key information.

[0020] In some embodiments, step S210 is performed by the task prompt generation module 132 in Figure 1. In some embodiments, the prompt message generation device 100 in Figure 1 receives input content messages transmitted by the user device UI. The text analysis module 132a of the task prompt generation module 132 analyzes the input content messages and obtains key information based on the input content messages and predefined rules. Then, the prompt generation module 132b generates at least one task prompt based on the key information.

[0021] Please also refer to Figure 3. Figure 3 illustrates an embodiment of step S210 in Figure 2 according to some embodiments of the present invention. As shown in Figure 3, after the task prompt generation module 132 receives the input content message IM, the task prompt generation module 132 performs step S31 (analyze the input content) to analyze the input content message IM, and then obtains key information K based on the input content message IM and predefined rules PR. Next, the task prompt generation module 132 performs step S32 (generate task prompt) to generate a task prompt TP based on the key information K.

[0022] In some embodiments, the predefined rule PR includes, but is not limited to, basic principles, application task types, application characteristics, and data formatting.

[0023] For example, when the usage scenario of the prompt message generation device 100 is "the user uses an academic English translation system with a large language model as its core engine", the predefined rule PR may include: 1. Basic principle: including "source language" and "target language", with the target language being English. 2. Application task type: machine translation. 3. Application characteristics: academic English. 4. Data formatting: none.

[0024] The predefined rule PR described above is only for illustrative purposes, and the implementation method of this case is not limited to the above.

[0025] In some embodiments, when analyzing the input content message IM, the text analysis module 132a performs at least one of a plurality of semantic analysis tasks to obtain key information K. In some embodiments, the semantic analysis tasks include, but are not limited to, emotion recognition, keyword extraction, intent detection, named entity recognition, and language detection.

[0026] For example, in one embodiment, based on the input content message IM "Please help me with the following academic translation: Utilize Fourier Transform", the key information K generated by the text analysis module 132a includes: 1. Emotion recognition: No emotion. 2. Keyword extraction: Fourier Transform. 3. Intent detection: Translation. 4. Named entity recognition: None. 5. Language detection: English.

[0027] In some embodiments, the text analysis module 132a is further used to analyze the input content message IM according to predefined rules PR to obtain key information K. For example, in one embodiment, when the scenario is a listener chatbot, the predefined rules PR include emotion recognition and role recognition. Suppose the input content message IM contains "I'm so bored, my boss scolded me". The text analysis module 132a can obtain the following key information K based on the predefined rules PR analysis of the input content message IM: emotion recognition [negative], role [boss]. Based on the above key information K, the task prompt TP generated by the prompt generation module 132b can be: Please answer in Chinese and show empathy.

[0028] As another example, in another embodiment, when the scenario is an English translation system, the predefined rule PR includes language recognition. Suppose the input content message IM contains "I'm so bored, my boss scolded me". The text analysis module 132a analyzes the input content message IM based on the predefined rule PR and obtains the following key information K: language recognition [Traditional Chinese]. Based on the above key information K, the task prompt TP generated by the prompt generation module 132b can be: translate from Traditional Chinese to English.

[0029] In some embodiments, the text analysis module 132a of the task prompt generation module 132 analyzes the input content message IM to obtain key information K, and then the prompt generation module 132b generates at least one task prompt TP based on the key information K and predefined rules PR. Two different scenarios will be described below.

[0030] In one embodiment, assuming the scenario is an academic English translation system, and the input content message IM includes "The weather is nice today". Based on the predefined rule PR, the text analysis module 132a can obtain key information K including: the application is academic English translation, and the target language is English. The text analysis module 132a obtains key information K based on the input content message IM, including that the user input language is Traditional Chinese. Based on the above key information K, the task prompt TP generated by the prompt generation module 132b includes "Translate from Traditional Chinese to English" and "The English terminology is academic terminology".

[0031] In another embodiment, assuming the scenario is a listening chatbot, and the input content message IM contains "Ugh, I'm so annoyed, I have to work overtime again." Based on predefined rules PR, the text analysis module 132a can obtain key information K, including: the application is a multi-turn dialogue and it has empathy. The text analysis module 132a obtains key information K based on the input content message IM, including the emotion as irritability and the event as working overtime. Based on the above key information K, the task prompt TP generated by the prompt generation module 132b includes "the task is a multi-turn dialogue," "the reply is empathetic," "comfort the user's irritability," "ask why you have to work overtime," and "the output cannot contain discriminatory words."

[0032] In some embodiments, when the prompt generation module 132b generates a task prompt TP based on key information K and predefined rules PR, the prompt generation module 132b is further used to generate a confidence score corresponding to the task prompt TP. For example, in one embodiment, the prompt generation module 132b generates a first task prompt and a second task prompt based on key information K and predefined rules PR, and generates a first confidence score for the first task prompt and a second confidence score for the second task prompt.

[0033] In some embodiments, the text analysis module 132a can be parsed using a large language model, implemented using analysis methods commonly found in the field of natural language processing (such as keyword extraction, named entity recognition), or any text processing method. In some embodiments, the prompt generation module 132b can be implemented using any text generation method (such as: large language model, slot filling, rule generation).

[0034] Please refer back to Figure 2. In step S220, format requirement information is obtained according to predefined rules, and the input content information is parsed to obtain semantic requirement information.

[0035] In some embodiments, step S220 is performed by the semantic and format analysis module 134a of the task example generation module 134 in Figure 1. In some embodiments, the semantic and format analysis module 134a can be parsed using a large language model, or implemented using analysis methods commonly found in the field of traditional natural language processing (such as keyword extraction, named entity recognition), or any text processing method.

[0036] Please also refer to Figure 4. Figure 4 illustrates an embodiment of steps S220 and S230 in Figure 2 according to some embodiments of the present invention. As shown in Figure 4, the semantic and format analysis module 134a obtains format requirement information according to predefined rules PR and parses the input content message IM to obtain semantic requirement information.

[0037] For example, in one embodiment, the input content message IM includes "Please translate into business English", and the semantic and format analysis module 134a obtains the semantic requirement information as "translation action and conforms to business English standards" based on the input content message IM.

[0038] In another embodiment, the input content message IM includes "Please explain the butterfly effect in bullet points and answer in Traditional Chinese". The semantic and format analysis module 134a obtains the semantic requirement information based on the input content message IM as "question and answer action, answer conforms to bullet points, answer conforms to Traditional Chinese".

[0039] In another embodiment, the predefined rule PR includes "data formatting", and the semantic and format analysis module 134a obtains the format requirement information as "json format" based on the predefined rule PR.

[0040] In step S230, example data is obtained from the text example database according to the semantic requirement information, and the example data is processed according to the format requirement information to generate the task example.

[0041] In some embodiments, step S230 is performed by the semantic and format analysis module 134a of the task example generation module 134 in Figure 1. Please also refer to Figure 4. As illustrated in Figure 4, the semantic requirement processing module 134b obtains at least one example data from the text example database ED based on the semantic requirement information, and then the format requirement conversion module 134c processes the at least one example data based on the format requirement information to generate at least one task example TE.

[0042] In some embodiments, the semantic requirement processing module 134b is further used to obtain at least one example data through similarity calculation.

[0043] In some embodiments, based on the input content information, the semantic requirement processing module 134b obtains the application task type corresponding to the input content information IM through application classification. When the application task type corresponding to the input content information IM matches or is the same as the application task type in the predefined rule PR, the semantic requirement processing module 134b obtains example data belonging to the application task type corresponding to the input content information IM from the text example database ED.

[0044] In some embodiments, the semantic requirement processing module 134b further filters the example data. For example, the semantic requirement processing module 134b calculates the similarity between the example data and the input content message IM, filters out and retains those with higher similarity (e.g., similarity higher than a preset similarity threshold), and filters out those with lower similarity.

[0045] In some embodiments, the text example database ED includes: 1. Open-source materials publicly available on the internet. 2. Materials built based on proprietary corpora. 3. Authorized or purchased text materials. 4. Organized and verified historical data.

[0046] In some embodiments, the text example database ED will mark the application type and features (format, purpose, etc.) corresponding to the example. The application type includes, but is not limited to, question and answer, dialogue, translation, and analysis. For example, for an example, its corresponding tags include application (dialogue), format (sentence), language (Chinese), purpose (care), and purpose (chat).

[0047] In some embodiments, for the example data obtained by the semantic requirement processing module 134b, the format requirement conversion module 134c performs format conversion processing based on the format requirements obtained by the semantic and format analysis module 134a to generate the task example TE.

[0048] For example, the format requirement in the predefined rule PR is "The application output format is JSON". The task example TE obtained by the semantic requirement processing module 134b is: "Q: Please explain photosynthesis A: Plants use light energy to convert carbon dioxide and water into oxygen. Photosynthesis is the most important chemical reaction in the biological world, and the three most important elements are light energy, water, and carbon dioxide." Based on the format requirement, the format requirement conversion module 134c needs to convert the output format into a specified format, such as converting it from a pure sentence format to a JSON format. After conversion by the format requirement conversion module 134c, the resulting task example TE is: "Q: Please explain photosynthesis A: {"text":"Plants use light energy to convert carbon dioxide and water into oxygen. Photosynthesis is the most important chemical reaction in the biological world, and the three most important elements are light energy, water, and carbon dioxide."}"".

[0049] Please refer back to Figure 2. In step S240, the input content message, task prompt, and task example are synthesized to generate a prompt message. In some embodiments, step S240 is performed by the output synthesis module 136 in Figure 1.

[0050] Please also refer to Figure 5. Figure 5 illustrates an embodiment of step S240 in Figure 2 according to some embodiments of the present invention. As illustrated in Figure 5, after checking the task prompt TP generated by the task prompt generation module 132 in Figure 1 and the task example TE generated by the task example generation module 134 in Figure 1, the checking module 136a transmits the checked task prompt TP and task example TE to the synthesis module 136b in Figure 1. The synthesis module 136b then synthesizes the input content message IM, the task prompt TP, and the task example TE to generate a prompt message TM.

[0051] In some embodiments, the checking module 136a checks whether there are conflicting or contradictory task prompts in the task prompt TP generated by the task prompt generation module 132.

[0052] In some embodiments, when there are conflicts among multiple task prompts (TPs), the checking module 136a retains the task prompts that originate from or conform to predefined rules (PRs). If the multiple conflicting task prompts (TPs) are either not from predefined rules (PRs) or all originate from predefined rules (PRs), the checking module 136a sequentially checks the confidence scores of the multiple conflicting task prompts (TPs) and retains the task prompt (TP) with the highest confidence score.

[0053] For example, if the task prompt TP generated by the task prompt generation module 132 contains a first task prompt (please translate into English) and a second task prompt (please answer in Chinese), the module 136a retains the first task prompt or the second task prompt that conforms to the predefined rules, and deletes the first task prompt or the second task prompt that does not conform to the predefined rules.

[0054] If both the first task prompt and the second task prompt meet the predefined rule PR or neither meets the predefined rule PR, check module 136a and retain the one with the higher confidence score between the first task prompt and the second task prompt.

[0055] In some embodiments, the inspection module 136a is further used to check whether the task prompt TP and the task example TE are inconsistent. For example, when the task prompt is "Output Traditional Chinese" and the task example TE is "This is an example…", the inspection module 136a determines that the task prompt TP and the task example TE are inconsistent. In some embodiments, the inspection module 136a deletes this task example TE; in other embodiments, the inspection module translates the task example TE into Traditional Chinese.

[0056] In some embodiments, the inspection module 136a is further used to check whether the task prompt TP and task example TE contain biased or discriminatory content. If the inspection module 136a detects that the task prompt TP or task example TE contains inappropriate content, the inspection module 136a removes the task prompt TP or task example TE containing inappropriate content.

[0057] In some embodiments, the inspection module 136a can be parsed through a large language model, implemented using semantic analysis methods commonly found in the field of traditional natural language processing (such as keyword extraction, named entity recognition), or any text processing method.

[0058] In some embodiments, the synthesis module 136b combines the input content message IM with the task prompt TP and task example TE that have been checked and filtered by the inspection module 136a to generate a prompt message TM and outputs the prompt message TM.

[0059] In some embodiments, the prompt message TM includes any combination of the following three types: 1. Input content message IM, task prompt TP, and task example TE. 2. Input content message IM and task prompt TP. 3. Input content message IM and task example TE.

[0060] Please also refer to Figure 6. Figure 6 illustrates an application embodiment of the prompt message generation device 100 in Figure 1 according to some embodiments of the present invention. In some embodiments, the prompt message TM is the output of the prompt message generation device 100. The prompt message TM can be used as actual output data generated based on the input content message IM and input to the large language model L. The large language model L then generates corresponding application output AO based on the prompt message TM.

[0061] Please refer to Figure 7. Figure 7 is a schematic diagram illustrating a prompt message generation device 100 according to some embodiments of the present invention. In some embodiments, the prompt message generation device 100 includes a processor 702, random access memory 704, network interface element 722, display 710, alphanumeric input device 712, cursor controller 714, data storage device 718, non-transitory computer-readable storage medium 724, signal generator 720, and bus 708. The processor 702, random access memory 704, network interface element 722, display 710, alphanumeric input device 712, cursor controller 714, data storage device 718, non-transitory computer-readable storage medium 724, and signal generator 720 transmit messages, signals, or data to each other via bus 708.

[0062] In some embodiments, the network interface element 722 is connected via a network INT to the user device UI, large language model L, and database DB as illustrated in Figure 1. In some embodiments, the non-transitory computer-readable storage medium 724 in the data storage device 718 stores a computer program 726. The computer program 726 includes a task prompt generation module 132, a task example generation module 134, and an output synthesis module 136. The computer program 726 (and its included task prompt generation module 132, task example generation module 134, and output synthesis module 136) can be loaded into random access memory 704 and read and executed by processor 702 to perform the prompt message generation method 200 as illustrated in Figure 2.

[0063] In some embodiments, the processor 702 may be implemented by one or more processing circuits, such as a central processing circuit and / or a microprocessor circuit, but the embodiments disclosed herein are not limited thereto. In some embodiments, the random access memory 704 may be dynamic random access memory (DRAM) or static random access memory (SRAM). The data storage device 718 may include one or more non-transitory computer-readable storage media 724. The non-transitory computer-readable storage media 724 may be read-only memory (ROM), flash memory, disk drive, hard disk, optical disk, USB flash drive, portable drive, magnetic tape, network-accessible database, and / or any storage media with the same function that can be conceived by those skilled in the art to which this disclosure pertains.

[0064] In summary, the non-transitory computer-readable storage medium and prompt message generation method provided by the present invention automatically generates prompt messages for large language models based on input content information and predefined rules. This eliminates the need for manual intervention in constructing prompt messages or selecting example prompts, reducing the frequency of application-based fine-tuning of prompt messages and thus accelerating the development of text-related applications. Furthermore, the implementation of this method can be applied to any text-related application project with a large language model as its core engine, accelerating application development timelines. For advanced text-based applications, such as intelligent question answering and chatbots, the automatically generated prompt messages allow users to experience a more engaging and interactive chat experience, rather than following rigid, rule-based robots, and enhance the user experience.

[0065] It should be noted that, unless otherwise specified, there is no specific order in the steps of the above-mentioned prompt message generation method 200. In addition, the steps can be executed simultaneously, or the execution times can at least partially overlap.

[0066] Furthermore, according to various embodiments of the present disclosure, steps of the prompt message generation method 200 may be appropriately added, replaced, and / or eliminated.

[0067] Various functional modules, components, or blocks have been described herein. As those skilled in the art will understand, modules or functional blocks will preferably be implemented through circuitry (whether dedicated or general-purpose circuitry, operating under the control of one or more processing circuits and coded instructions), which typically includes transistors or other circuit elements configured to control the circuitry according to the functions and procedures described herein.

[0068] The above embodiments are only used to illustrate some implementations of the present invention and to explain the technical features of the present invention, and are not intended to limit the scope and range of protection of the present invention. Any changes or equivalent arrangements that can be easily made by those skilled in the art to which this invention pertains are within the scope of the present invention, and the scope of protection of the present invention is determined by the scope of the patent application. [Simplified Explanation of the Diagram]

[0009] Figure 1 is a schematic diagram of a prompt message generation device according to some embodiments of the present invention; Figure 2 is a flowchart of a prompt message generation method according to some embodiments of the present invention; Figure 3 is an embodiment of one step in Figure 2 according to some embodiments of the present invention; Figure 4 is an embodiment of two steps in Figure 2 according to some embodiments of the present invention; Figure 5 is an embodiment of one step in Figure 2 according to some embodiments of the present invention; Figure 6 is an application embodiment of the prompt message generation device according to some embodiments of the present invention; and Figure 7 is a schematic diagram of the prompt message generation device according to some embodiments of the present invention. [Biomaterial Storage]

[0070] Domestic storage information (please note in order of storage institution, date, and number): None. International storage information (please note in order of storage country, institution, date, and number): None.

Claims

1. A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores one or more computer programs, and the one or more computer programs can be executed by one or more processors to perform a prompt message generation method, wherein the prompt message generation method includes: obtaining at least one key information based on an input content message and a predefined rule, and generating at least one task prompt based on the at least one key information; obtaining format requirement information based on the predefined rule, and parsing the input content message to obtain semantic requirement information; obtaining at least one example data from a text example database based on the semantic requirement information, and processing the at least one example data based on the format requirement information to generate at least one task example; and synthesizing the input content message, the at least one task prompt, and the at least one task example to generate a prompt message.

2. The non-transitory computer-readable storage media as described in Request 1, wherein the predefined rules include basic principles, application task types, application characteristics, and data formatting.

3. The non-transitory computer-readable storage medium as described in claim 1, wherein analyzing the input content message includes performing at least one of a plurality of semantic analysis tasks, wherein the semantic analysis tasks include emotion recognition, keyword extraction, intent detection, named entity recognition, and language detection.

4. The non-transitory computer-readable storage medium as described in claim 1, wherein the at least one task prompt includes a first task prompt and a second task prompt, wherein the prompt message generation method further includes: generating a first confidence score for the first task prompt and a second confidence score for the second task prompt.

5. The non-transitory computer-readable storage medium as described in claim 4, wherein the prompt message generation method further includes: when the first task prompt and the second task prompt conflict, retaining the first task prompt or the second task prompt that conforms to the predefined rule.

6. The non-transitory computer-readable storage medium as described in claim 4, wherein the prompt message generation method further comprises: retaining the first task prompt when the first task prompt and the second task prompt conflict and the first confidence score is higher than the second confidence score.

7. The non-transitory computer-readable storage medium as described in claim 1, wherein the method for generating the prompt message further comprises: obtaining the at least one example data through a similarity calculation.

8. The non-transitory computer-readable storage medium as described in claim 1, wherein the prompt message includes the input content message, the at least one task prompt, and at least two of the at least one task example.

9. A method for generating a prompt message, used in an electronic device, the method being executed by the electronic device, the method comprising the following steps: obtaining at least one key piece of information based on an input content message and a predefined rule, and generating at least one task prompt based on the at least one key piece of information; obtaining format requirement information based on the predefined rule, and parsing the input content message to obtain semantic requirement information; obtaining at least one example piece of data from a text example database based on the semantic requirement information, and processing the at least one example piece of data based on the format requirement information to generate at least one task example; and synthesizing the input content message, the at least one task prompt, and the at least one task example to generate a prompt message.

10. The method for generating a prompt message as described in Request 9, wherein the predefined rules include basic principles, application task types, application characteristics, and data formatting.

11. The prompt message generation method as described in claim 9, wherein analyzing the input content message includes performing at least one of a plurality of semantic analysis tasks, wherein the semantic analysis tasks include emotion recognition, keyword extraction, intent detection, named entity recognition, and language detection.

12. The prompt message generation method as described in claim 9, wherein the at least one task prompt includes a first task prompt and a second task prompt, wherein the prompt message generation method further includes: generating a first confidence score for the first task prompt and a second confidence score for the second task prompt.

13. The prompt message generation method as described in claim 12 further includes: when the first task prompt and the second task prompt conflict, retaining the first task prompt or the second task prompt that conforms to the predefined rule.

14. The prompt message generation method as described in claim 12 further includes: retaining the first task prompt when the first task prompt and the second task prompt conflict and the first confidence score is higher than the second confidence score.

15. The prompt message generation method as described in claim 9 further includes: obtaining the at least one example data through a similarity calculation.

16. The prompt message generation method as described in claim 9, wherein the prompt message includes the input content message, the at least one task prompt, and at least two of the at least one task example.

Citation Information

Patent Citations

  • Answer determination method and device for knowledge question-answering system, equipment and medium

    CN117556904A

  • Large model prompt generation method based on knowledge graph

    CN117591663A

  • Large model semantic interaction engine and dynamic analysis method of composite intention text

    CN117669590A

  • Method and device for intention classification based on large language model in combination with NLU

    CN117786108A

  • Contextual clarification and disambiguation for question answering processes

    TW202334839A