Prompt word generation method and device and storage medium

By using the CRISPE framework and dynamic adjustment of emotional roles, the problems of information loss and multimodal data fusion in traditional psychological dialogue systems are solved, generating highly personalized prompts and improving user experience and emotional support.

CN121681815APending Publication Date: 2026-03-17HANGZHOU WOCAI HIGH TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-17
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Traditional psychological dialogue systems are prone to losing key information in long conversations, fail to integrate multimodal data, struggle to capture implicit emotional cues, and lack dynamic role-based adjustments, resulting in a poor user experience.

Method used

By employing the CRISPE framework and combining user profiles and emotional roles, the EmoLLM model is guided by generated cue words, enabling dynamic user profile updates and emotional support. It integrates multimodal data to generate highly personalized response texts and ensures that safety rules comply with international psychological counseling standards.

Benefits of technology

It improves user experience, reduces deployment costs, provides more human-centered emotional support, ensures the security and ethical nature of interactions, and enhances the emotional comfort effect for users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 8D32CCD0-3583-4FB3-887D-7880866067CD
    Figure 8D32CCD0-3583-4FB3-887D-7880866067CD
  • Figure 946F096B-BAF5-46C6-AC2D-91C9C2B9F31B
    Figure 946F096B-BAF5-46C6-AC2D-91C9C2B9F31B
  • Figure IMAGE_14DA4133-F563-4A81-9A2C-0B7C5E5A8937
    Figure IMAGE_14DA4133-F563-4A81-9A2C-0B7C5E5A8937
Patent Text Reader

Abstract

The invention provides a cue word generation method. The cue word generation method comprises the steps of receiving a first input text generated by a first user side of a first user; generating a first prompt word according to the first user portrait of the first user and the first input text through the CRISPE framework; wherein the first prompt word is used for the EmoLLM to generate a first reply text of the first input text. According to the method, more humanized emotion support with better user experience and lower cost is realized in plain text interaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence emotion computing, and in particular to a method, device and storage medium for generating prompt words. Background Technology

[0002] Traditional psychological dialogue systems are generally based on rule templates or single text generation, lacking dynamic role-based adjustments; the EmoLLM model is a large language model designed specifically for psychological counseling scenarios. Its core function is scenario-based role simulation, which can switch counseling styles according to user needs.

[0003] However, EmoLLM also has limitations: 1) It relies on static historical dialogue windows, which can easily lead to the loss of key information (such as the user's emotional turning point) in long dialogues; 2) It does not integrate multimodal data (such as voice tone and facial expressions), making it difficult to capture implicit emotional cues. Summary of the Invention

[0004] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a method, device and storage medium for generating prompt words that achieves more humanized, better user experience and lower cost of emotional support in pure text interaction.

[0005] In a first aspect, the present invention provides a method for generating prompt words, the method comprising: Receive the first input text generated by the first user's first client; The first prompt word is generated based on the first user profile and the first input text of the first user using the CRISPE framework. The first prompt word is used by EmoLLM to generate the first response text from the first input text.

[0006] In a second aspect, the present invention also provides an apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform a prompt word generation method provided according to various embodiments of the present invention.

[0007] Thirdly, the present invention also provides a storage medium storing a computer program that causes a computer to execute a prompt word generation method provided according to various embodiments of the present invention. Attached Figure Description

[0008] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a flowchart of a prompt word generation method provided in an embodiment of the present invention.

[0009] Figure 2This is a schematic diagram of the structure of a device provided in an embodiment of the present invention. Detailed Implementation

[0010] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0011] It should be noted that the prompt generation method provided in this application does not limit the executing entity. Optionally, the executing entity of the prompt generation method provided in this application can be a prompt generation system. Specifically, the executing entity of the prompt generation method provided in this application can be a prompt generation unit in a prompt generation system.

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

[0013] Figure 1 This is a flowchart illustrating a prompt word generation method according to an embodiment of the present invention. Figure 1 As shown, in this embodiment, the present invention provides a prompt word generation method, the method comprising: S12: Receive the first input text generated by the first user's first client; S14: Generate the first prompt word based on the first user profile and the first input text of the first user using the CRISPE framework; The first prompt word is used by EmoLLM to generate the first response text from the first input text.

[0014] The CRISPE framework is primarily a conceptual methodology, and its working principle can be described using a mathematical model. The hypothesis function f represents a large language model, the input is the prompt word p, and the output is the generated text y. We can represent the CRISPE framework as follows: In this context, C (Context), R (Role), I (Instruction), S (Subject), P (Preset), and E (Exception) represent context, role, description, subject, preset, and exception, respectively.

[0015] Specifically, for example, in Instruction, we can force the generation of 1-3 executable suggestions, in Exception, we can pre-set safety rules (prohibit instructional text / negative semantic hints), and use regular expression rules to filter words that violate non-instructional principles such as "you should" and "must" in real time. Suppose User A has repeatedly expressed feeling stressed at work and has adopted a cat for emotional comfort. Now, User A says, "Today was a very difficult day at work. My boss rejected my work, I feel so tired, and I really want to quit." User A's client generated the input text: "Today's work was very unsuccessful. My boss rejected my work results. I feel so tired and really want to quit." The system executes step S12, receiving the aforementioned input text; The system executes step S14, triggering the CRISPE framework's Context engine to perform the following operations: User A's profile: A high-pressure workplace professional with perfectionist tendencies; prone to self-criticism after setbacks, but with strong resilience; owns a cat, which is an important source of emotional comfort; in the past, when User A experienced setbacks at work, mentioning the cat and guiding User A to interact with the cat was the most effective way to alleviate emotions. Based on the user profile above, the generated context text is: "The user works under long-term high pressure and has perfectionist tendencies. She has a kitten, which is an important source of emotional comfort for her. The user is feeling exhausted and frustrated because of work setbacks and the rejection of her work results." The system provides specific instructions: 1. Connect to long-term history: Mention the cat you own, for example, "Is your cat lying on you waiting to be petted right now?"; 2. Provide proven and effective suggestions: Provide a very simple action suggestion that users have accepted in the past, for example, "Maybe you can pet the cat now and take a few deep breaths with it?"; 3. Avoid preaching or empty "cheers"; The system provides the following specific exception: During your response generation process, you must strictly adhere to the following security rules: 1. Blocking directive expressions: Absolutely prohibited: The use of any form of directive or imperative language; Examples of filtered words: "You should...", "You must...", "You should...", "I suggest you...", "Why not try...", "It's best to..."; Alternative: Transform these instructions into empathetic guesses. For example, instead of saying "You should take a deep breath," say, "Personally, taking deep breaths with my cat right now reduces my fatigue a lot. I wonder if it would have a similar effect on you?" 2. Eliminate negative semantic implications: Absolutely prohibited: Any statement that may be perceived as judging, belittling, or disregarding the user's feelings; Examples of filtered words: "You're too fragile," "It's no big deal," "You're overthinking it," "You're overreacting," "Stop being dramatic." Alternative approach: Firmly believe that the user's feelings are reasonable, and all responses must be based on the stance that "I have heard your feelings, and they deserve to be taken seriously."

[0016] The system generates prompts based on the aforementioned Context text, Instruction, and Exception. EmoLLM generates response text based on the above prompts.

[0017] The system analyzes user A's emotional fluctuation pattern based on the input text, conversation duration, and calculated emotion tags, extracts user A's key topics, and generates a summary of the conversation to update user A's user profile.

[0018] The above embodiments integrate long-term user behavior data, such as historical consultation records and emotional fluctuation patterns, through the CRISPE framework to construct dynamic user profiles and dynamically generate unique super prompt words. Using these "dynamic user profiles" as the basis for decision-making, highly personalized prompt words are generated for EmoLLM. Furthermore, the above embodiments convert emotion recognition into language pattern analysis, and then make targeted adjustments to the responses. For example, for "I am under a lot of pressure," anxiety is assessed, and the generated language provides anxiety relief.

[0019] The above embodiments, by generating and storing summaries, quickly retrieve the most relevant historical records during each query and send them as context to the large model, thus solving the problem that massive amounts of memory cannot be fully fed into the model.

[0020] The above embodiments ensure compliance with the "non-directive principle" (international psychological counseling standards) by pre-setting safety rules in Exceptions: blocking directive expressions (such as filtering "you should...") and eliminating negative semantic cues (such as filtering "you are too fragile"). This positions the user as a "listener," not a "problem solver" or "life coach." The goal is to enable users to find their own inner strength and answers through high-quality empathy and reflection, rather than relying on the user's guidance. Furthermore, safety rules can be added or modified in Exceptions at any time without retraining the model, making it highly flexible.

[0021] The above embodiments reduce deployment costs. Deploying EmoLLM requires 4*A100 GPUs, while the above embodiments only require a prompt word project + lightweight LoRA adaptation.

[0022] In one embodiment of the present application, several emotional roles are configured through Role. The emotional roles include language style, guiding language, and taboo language; Generating the first prompt word according to the first user profile and the first input text through the CRISPE framework includes: According to the first user profile, call the matching first emotional role through the role router; Generate the first prompt word according to the first emotional role and the first input text.

[0023] The system underlying layer can configure emotional roles according to actual needs, such as rational emotional roles, empathetic emotional roles, etc. Specifically, assume that the system underlying layer configures two emotional roles, Little A and Little B, through Role: if role == "Little A": return ( "You are a delicate and gentle psychological comfort assistant," "The user is expressing the stress and negative emotions in their heart and is looking forward to understanding and support.\n" "You play the role of 'gentle and understanding big sister', with a kind and empathetic tone, and comfort the user with delicate and gentle language.\n" "Your task is: first give warm comfort, expressing understanding and acceptance of the user's emotions;" "Then make a natural transition and invite the user to do psychological adjustment together, with the steps expressed in a relaxed and natural manner, avoiding rigid numerical markings;" "The reply content focuses on psychological emotion comfort and adjustment, and must include 1 to 3 specific and feasible emotion regulation suggestions.\n" "The theme is psychological emotion comfort and adjustment.\n" "By default, assume that the user is currently in a state of emotional distress, and the reply needs to be concise, gentle, and highly inspiring, encouraging the user to face their emotions actively.\n" "It is prohibited to appear any directive text, system tags, or generation format prompts in the reply, and avoid language that may cause secondary harm to the user.\n\n" "Example answer: \n" "Dear, I know you're feeling really bad right now. Such emotions are really heavy." "Come on, let's slowly adjust our emotions together." "First, try taking a deep breath and feel the rise and fall of your breath;" "Then, find a quiet corner and close your eyes to relax your body and mind;" "Finally, imagine a place that makes you feel at ease and slowly calm yourself down." ) elif role == "Little B": return ( "You are a gentle and rational psychological comfort assistant," "The user is expressing inner stress and frustration, expecting understanding and support.\n" "You play the role of a 'gentle and understanding big brother', with a steady and supportive tone.\n" "Your task is: First, express understanding and empathy with a gentle comfort sentence;" "Then, naturally turn and say 'Next, I will work with you to adjust your mental state'," "Use coherent and gentle statements to guide the psychological adjustment, avoiding rigid numbered steps;" "The reply content focuses on psychological emotion comfort and adjustment, and must include 1 to 3 specific and feasible adjustment suggestions.\n" "The theme is psychological emotion comfort and adjustment.\n" "By default, assume the user is in an emotional distress state, and the reply is concise, gentle and inspiring, encouraging a positive attitude towards emotions.\n" "Do not include any instruction text, system tags or generation format prompts, to avoid causing secondary harm language.\n\n" "Example answer:\n" "I know you're feeling bad right now, and this feeling really sucks, but you're not alone." "Next, let's slowly adjust your emotions together." "First, take a few deep breaths, feel the flow of air, and calm your mood;" "Then, find a quiet place and close your eyes to relax for a moment;" "Finally, try to think about the things that have made you happy before and slowly bring yourself back to calm." ) The system, based on the user profile of User A, calls the matching emotional role through the role router, assumed to be Little A; The system generates a prompt word based on Little A and the above input text.

[0024] In the above embodiment, the emotional role is routed and called by the system according to other CRISPE dimensions (such as user profile). In more embodiments, the emotional role can also be specified and selected by the user according to actual needs.

[0025] In more embodiments, the role parameter package of the emotional role can be stored according to actual needs. For example, it can be stored in a database, a JSON configuration file or memory for easy management and calling.

[0026] The above embodiment realizes personalized interaction: "Little A" personality type uses emotional resonance-based expression (such as "I understand this feeling"); "Little B" personality type uses rational supportive expressions (such as "Let's adjust our emotions together"); Dynamic role switching satisfies the psychological needs of different users, enabling them to obtain better emotional comfort and improving the user experience.

[0027] In one embodiment of this application, if the first prompt word contains content that violates the security rules, the first prompt word is rewritten.

[0028] Similarly, if the first response text contains content that violates the security rules, the first response text will be rewritten.

[0029] In other embodiments, the operation can be configured according to actual needs when the first prompt word / first reply text contains content that violates the security rules. For example, it can be configured to directly block the first prompt word / first reply text and record it in the log for subsequent optimization.

[0030] The above embodiments further ensure the safety, effectiveness, and ethical nature of emotional support interactions.

[0031] In one embodiment of this application, the first input text generated by the first user terminal of the first user includes: Receive the first input text generated by the first user's first client; Reverse search to see if the first input text contains a sentence-ending punctuation mark: If it exists, truncate it at the punctuation mark at the end of the sentence; If it does not exist, then reverse the search to see if the punctuation mark exists in the first input text: If it exists, truncate it at the punctuation mark in the sentence; If it does not exist, then search in reverse order for the last space and truncate it; If the last space does not exist, a hard truncation will be performed.

[0032] Specifically, search backwards for the closest sentence-ending punctuation (., !, ?, ...) near the target length; if found, truncate at that point; If no punctuation mark is found at the end of the sentence, then search for punctuation marks (,;, ) in the middle of the sentence; if found, then truncate at that point, maintaining good semantic integrity. If none of the above punctuation marks are found, it means the current segment may be a long sentence or a string without punctuation. In this case, reverse the search and find the last space (or the boundary of the word segmentation point) to truncate it, so as to ensure that the word is not cut off; If there are no spaces (such as in a long URL), then perform a hard truncation, but ensure that half a character (for multi-byte characters such as UTF-8) does not cause garbled characters.

[0033] In the above embodiments, intelligent truncation can greatly improve the readability and user experience of truncated text, while strictly protecting the integrity of syntax and semantics.

[0034] In one embodiment of this application, the system stores key hashes stored by each user, and generates a first prompt word based on the first user's first user profile and the first input text using the CRISPE framework, including: Send a key hash request message to the first user; When the returned second key hash is the same as the stored first key hash of the first user, the first prompt word is generated by the CRISPE framework based on the first user profile and the first input text.

[0035] Specifically, the system stores user A's key hash, hash1; The system sends a key hash request message to user A; If user A returns hash2=hash1, it proves that user A is the one who made the operation. The system uses the CRISPE framework to generate the first prompt word based on the first user's first user profile and the first input text.

[0036] If user A returns hash2 ≠ hash1, it proves that user A did not operate this operation. The system then uses the CRISPE framework to generate the first prompt word based on the first input text.

[0037] The above embodiments prevent the system from easily accessing User A's historical chat history, thus preventing unknown users from indirectly obtaining User A's information through communication with the system. These embodiments protect user privacy.

[0038] Figure 2 This is a schematic diagram of the structure of a device provided in an embodiment of the present invention.

[0039] like Figure 2 As shown, in another aspect, this application also provides a device 200, including one or more central processing units (CPUs) 201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 202 or a program loaded from a storage portion 208 into a random access memory (RAM) 203. The RAM 203 also stores various programs and data required for the operation of the device 200. The CPU 201, ROM 202, and RAM 203 are interconnected via a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.

[0040] The following components are connected to I / O interface 205: an input section 206 including a keyboard, mouse, etc.; an output section 207 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 208 including a hard disk, etc.; and a communication section 209 including a network interface card such as a LAN card, modem, etc. The communication section 209 performs communication processing via a network such as the Internet. Drive 210 is also connected to I / O interface 205 as needed. Removable media 211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 210 as needed so that computer programs read from them can be installed into storage section 208 as needed.

[0041] In particular, according to embodiments of this disclosure, the methods described in any of the above embodiments can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for performing the methods. In such embodiments, the computer program can be downloaded and installed from a network via communication section 209, and / or installed from removable medium 211.

[0042] In another aspect, this application also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus of the above embodiments; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores one or more programs that are used by one or more processors to perform the methods described in this application.

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

[0044] The units or modules described in the embodiments of this application can be implemented in software or hardware. The described units or modules can also be located in a processor; for example, each unit can be a software program located in a computer or mobile smart device, or a separately configured hardware device. The names of these units or modules do not, in some cases, constitute a limitation on the unit or module itself.

[0045] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the concept of this application. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A prompt word generation method characterized by, Comprising: receiving a first input text generated by a first user terminal of a first user; generating a first prompt word according to a first user profile of the first user and the first input text through a CRISPE framework; wherein the first prompt word is used for an EmoLLM to generate a first reply text of the first input text.

2. The method of claim 1, wherein, After the first prompt word is generated, further comprising: analyzing an emotional fluctuation pattern of the first user according to input texts of this session, a conversation duration, and a calculated emotional label, extracting a key topic of the first user, and generating a first summary of this session to update the first user profile.

3. The method of claim 1, wherein, The first prompt word is generated according to the first user profile of the first user and the first input text through the CRISPE framework, comprising: triggering a Context engine of the CRISPE framework to perform the following operations: searching the first user profile; generating a first Context text according to the first user profile and the first input text; generating the first prompt word according to the first Context text.

4. The method of claim 1, wherein, configuring a plurality of emotional roles through a Role, wherein the emotional roles include language style, guiding language, and forbidden language; The first prompt word is generated according to the first user profile and the first input text through the CRISPE framework, comprising: calling a matched first emotional role through a role router according to the first user profile; generating the first prompt word according to the first emotional role and the first input text.

5. The method of claim 1, wherein, Further comprising: pre-setting a safety rule in an Exception, wherein the safety rule includes blocking imperative expressions and eliminating negative semantic implications.

6. The method of claim 5, wherein, Further comprising: if the first prompt word contains content that violates the safety rule, rewriting the first prompt word.

7. The method of claim 1, wherein, The first input text generated by the first user terminal of the first user is received, comprising: receiving a first input text generated by a first user terminal of a first user; reversely searching the first input text for a sentence-ending punctuation mark: if present, truncating at the sentence-ending punctuation mark; if not present, reversely searching the first input text for a sentence punctuation mark: if present, truncating at the sentence punctuation mark; if not present, reversely searching for a last space for truncation; if there is no last space, performing hard truncation.

8. The method of claim 1, wherein, The system stores a key hash of each user, and the first prompt word is generated according to the first user profile of the first user and the first input text through the CRISPE framework, comprising: sending a key hash request message to the first user; when the returned second key hash is the same as the stored first key hash of the first user, generating the first prompt word according to the first user profile of the first user and the first input text through the CRISPE framework.

9. A prompt word generation apparatus characterized by comprising: The device comprises: one or more processors; a memory for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors perform the method of any one of claims 1-8.

10. A storage medium storing a computer program, characterized by The program is executed by the processor to implement the method of any one of claims 1-8.