Man-machine conversation implementation method and device, electronic equipment and computer storage medium

By selecting and using preset transition phrases and large model-generated response information in the LLM dialogue system, the problems of slow LLM generation speed and lack of natural transition in responses are solved, achieving timely and coherent user responses and improving the fluency of human-computer dialogue and user experience.

CN121256005BActive Publication Date: 2026-04-17SHANGHAI XULU INFORMATION TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI XULU INFORMATION TECHNOLOGY CO LTD
Filing Date
2025-11-28
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing large-scale language models based on LLM are slow to generate responses in real-time voice or text dialogue scenarios, resulting in perceived delays for users, affecting the smoothness of interaction, and the directly generated responses lack natural transitions and coherence.

Method used

When preset conditions are met, a target transition phrase is selected from the preset transition phrase pool as the first response information, and a response information is generated using a preset large model to ensure the timeliness and coherence of the response. The selection module selects a transition phrase based on the interaction information and context information, and generates a response information using the preset large model. Combining the interaction information and context information as input, the coherence of the first and second response information is guaranteed.

Benefits of technology

It effectively reduces user perception latency, enhances the naturalness and coherence of human-computer dialogue, and improves the smoothness of interaction and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121256005B_ABST
    Figure CN121256005B_ABST
Patent Text Reader

Abstract

The present application relates to human-computer interaction technology, provide a kind of human-computer dialogue implementation method, device, electronic equipment and computer storage medium, the method comprises: receiving the interactive information of user input;If meet preset condition, then according to interactive information and the context information of interactive information from preset transition speech technique pool selects target transition speech;Target transition speech is returned as the first response information of interactive information to user;According to interactive information, context information and target transition speech, generate response information using preset large model;According to response information, generate the second response information of interactive information and return user.The present application can effectively reduce the perception delay while enhancing the natural coherence of human-computer dialogue.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of human-computer interaction technology, and more specifically, to a method, apparatus, electronic device, and computer storage medium for implementing human-computer dialogue. Background Technology

[0002] Dialogue systems based on LLM (Large Language Module) have made significant progress in understanding user intent and generating rich responses. However, in real-time voice or text dialogue scenarios, the generation speed of LLM often becomes a bottleneck, resulting in perceptible latency and affecting the smoothness of the interaction. Furthermore, responses directly generated by LLM may sometimes lack the natural transitions common in human conversations—transitions used to manage turn-taking and express thought processes—making them sound stiff or mechanical.

[0003] To improve user experience, one solution is to try to alleviate the feeling of latency through streaming output, or to use simple preset responses to handle certain specific requests. However, streaming output may not have formed a complete meaning when the first few tokens are generated, while simple preset responses lack contextual adaptability and coherence with subsequent content. Summary of the Invention

[0004] The purpose of this invention is to provide a method, apparatus, electronic device, and computer storage medium for implementing human-computer dialogue.

[0005] The embodiments of the present invention can be implemented as follows:

[0006] In a first aspect, the present invention provides a method for implementing human-computer dialogue, the method comprising:

[0007] Receive interactive information input by the user;

[0008] If the preset conditions are met, the target transition phrase is selected from the preset transition phrase pool based on the interaction information and the context information of the interaction information;

[0009] The target transition message is returned to the user as the first response information of the interactive information;

[0010] Based on the interaction information, the context information, and the target transition phrase, response information is generated using a preset large model;

[0011] The second response information is generated based on the response information and returned to the user.

[0012] In an optional implementation, the method further includes:

[0013] Obtain the total text length of the interaction information and the context information;

[0014] Extract preset instruction words representing the processing complexity from the interaction information;

[0015] The estimated time for calling the preset large model is evaluated based on the total text length and the preset instruction words;

[0016] If the estimated duration is greater than the preset duration, then the preset condition is determined to be met.

[0017] In an optional implementation, the method further includes:

[0018] Extract emotional keywords representing emotional color and processing keywords representing information processing methods from the interaction information and the context information;

[0019] If the emotional keyword indicates that the current context belongs to the emotional expression context, or the processing keyword indicates that the current context belongs to the thinking expression context, then it is determined that the preset condition is met.

[0020] In an optional implementation, the preset transition phrase pool includes multiple preset transition phrases, each preset transition phrase being assigned a preset category related to preset interaction features. The step of selecting a target transition phrase from the preset transition phrase pool based on the interaction information and the context information of the interaction information includes:

[0021] Target interaction features are extracted from the interaction information and the context information, wherein the target interaction features represent at least one of interaction intent, interaction state, interaction emotion and interaction frequency;

[0022] Evaluate the category score of each preset category among all preset categories in the preset transition language pool for the target interaction feature;

[0023] Based on the scores of all the categories, the target transition phrase is determined from the plurality of preset transition phrases.

[0024] In an optional implementation, the step of determining the target transition phrase from the plurality of preset transition phrases based on all the category scores includes:

[0025] Sort all the scores of the categories from largest to smallest;

[0026] The first preset number of preset transition phrases will be selected as the initial preset transition phrases;

[0027] Obtain the user's preferred interaction style;

[0028] The preliminary preset transition phrase whose interaction style is most similar to the preferred interaction style is selected as the target transition phrase.

[0029] In an optional implementation, the step of generating response information using a preset large model based on the interaction information, the context information, and the target transition phrase includes:

[0030] Interactive prompts are constructed based on the interaction information, the context information, and the target transition phrase;

[0031] The interactive prompt is input into the preset large model to obtain the response information.

[0032] In an optional implementation, the step of constructing interactive prompt words based on the interaction information, the context information, and the target transition phrase includes:

[0033] The target transition phrase is used as a prefix, and the context and interaction information are sequentially concatenated after the target transition phrase to generate the interaction prompt word.

[0034] In an optional implementation, the step of constructing interactive prompt words based on the interaction information, the context information, and the target transition phrase includes:

[0035] The interactive prompt words are generated based on the context and the interactive information;

[0036] The preset category of the target transition phrase is embedded as control information into the interactive prompt word. The control information is used to enhance the attention of the preset large model to the preset category of the target transition phrase.

[0037] In an optional implementation, the step of generating second response information based on the response information and returning it to the user includes:

[0038] If the response information includes the semantics of the target transition phrase, then the response information is directly used as the second response information and returned to the user; otherwise, the target transition phrase is used as the preamble and the response information is used as the body to generate the second response information and return it to the user.

[0039] In a second aspect, the present invention provides a human-computer dialogue implementation device, the device comprising:

[0040] The receiving module is used to receive interactive information input by the user;

[0041] The selection module is used to select a target transition phrase from a preset transition phrase pool based on the interaction information and the context information of the interaction information if preset conditions are met.

[0042] The selection module is also used to return the target transition message as the first response information of the interaction information to the user;

[0043] The generation module is used to generate response information based on the interaction information, the context information, and the target transition phrase using a preset large model;

[0044] The generation module is further configured to generate second response information of the interaction information based on the response information and return it to the user.

[0045] Thirdly, the present invention provides an electronic device, including a controller and a memory, wherein the memory is used to store a program, and the controller is used to implement the human-computer dialogue implementation method as described in any of the foregoing embodiments when executing the program.

[0046] Fourthly, the present invention provides a computer storage medium having a computer program stored thereon, which, when executed by a controller, implements the human-computer dialogue implementation method as described in any of the foregoing embodiments.

[0047] Compared with the prior art, the present invention has the following beneficial effects:

[0048] This invention addresses user-input interactive information. When preset conditions are met, it selects a target transition phrase from a preset transition phrase pool based on the interactive information and its context, and returns this as the first response to the user. Then, based on the interactive information, the context, and the target transition phrase, it generates a response using a preset large-scale model, and finally generates a second response, which is also returned to the user. Because this invention selects and promptly returns the target transition phrase based on the interactive and contextual information, it ensures timely response and continuity with the interactive information. Furthermore, when generating the response using the preset large-scale model, the target transition phrase, interactive information, and contextual information are all used as input, ensuring continuity between the first and second response information. This effectively reduces perceptual latency while enhancing the natural flow of human-computer dialogue. Attached Figure Description

[0049] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0050] Figure 1 This is a flowchart illustrating the human-computer dialogue implementation method provided in this embodiment.

[0051] Figure 2 This is an example diagram of human-computer dialogue in a voice scenario provided in this embodiment.

[0052] Figure 3This is a block diagram illustrating the human-computer dialogue implementation device provided in this embodiment.

[0053] Figure 4 This is a block diagram of the electronic device provided in this embodiment.

[0054] Icons: 10-Electronic device; 11-Processor; 12-Memory; 13-Bus; 100-Human-machine dialogue implementation device; 110-Receiving module; 120-Selection module; 130-Generation module. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0056] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0057] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0058] In the description of this invention, it should be noted that if terms such as "upper," "lower," "inner," or "outer" are used to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship in which the product of this invention is usually placed, they are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.

[0059] Furthermore, the terms "first" and "second" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.

[0060] It should be noted that, where there is no conflict, the features in the embodiments of the present invention can be combined with each other.

[0061] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating the human-computer dialogue implementation method provided in this embodiment. The method includes the following steps:

[0062] Step S101: Receive interactive information input by the user.

[0063] In this embodiment, the interactive information can be text input directly by the user or text representation obtained by the speech recognition module after recognizing and converting the user's input speech. Its content carries the user's immediate intentions and request information.

[0064] Step S102: If the preset conditions are met, select the target transition phrase from the preset transition phrase pool based on the interaction information and the context information of the interaction information.

[0065] In this embodiment, upon receiving the interaction information, the transition response process is not initiated for all requests. Instead, it is necessary to further determine whether preset conditions are met. These preset conditions are used to filter out scenarios more suitable for inserting initial feedback, such as those with a long expected generation time, or dialogue contexts involving complex thinking or emotional expression. For scenarios that do not meet the preset conditions, the step of selecting a target transition can be skipped, and the response information can be directly generated using a preset large model based on the interaction and context information and returned to the user.

[0066] In this embodiment, in multi-turn dialogue scenarios, context information records and transmits the historical trajectory of the current session, including but not limited to previous user statements, responses to those statements, the evolution path of the dialogue topic, and implicit emotional or logical states. As one implementation approach, a dialogue history manager can be used to store and manage the context information, dynamically maintaining it and continuously updating it with each round of interaction to ensure that subsequent processing is based on the complete dialogue context.

[0067] In this embodiment, the preset transition phrase pool stores multiple predefined transition phrase expressions. For example, the preset transition phrase pool includes transition phrases such as "Let me think about it" or "I need to think about this problem," which indicate confirmation, express thinking, connect topics, or demonstrate empathy. The target transition phrase is the transition phrase selected from the preset transition phrase pool that best fits the characteristics of the current context.

[0068] Step S103: Return the target transition message to the user as the first response message of the interaction information.

[0069] In this embodiment, the first response information may not contain a complete answer; it is presented in a concise and immediate manner to quickly establish a feedback loop and effectively fill the time gaps during the processing of the main content by the large language model. This allows the user to perceive that the request has been received and is being processed, thereby reducing the negative perception of delays.

[0070] Step S104: Generate response information using a preset large model based on interaction information, context information, and target transition language.

[0071] In this embodiment, the preset large model refers to a language model with strong contextual understanding and text generation capabilities. Since interactive information, contextual information, and target transition phrases are used as inputs to the preset large model, the preset large model is affected by the presence of the target transition phrases during the generation of response information, and thus tends to produce subsequent content that is consistent with its style and has smooth logical connection.

[0072] Step S105: Generate second response information based on the response information and return it to the user.

[0073] In this embodiment, depending on the form of the response information output by different preset large models or the style of the prompt words given by the user, if the response information itself has a natural coherence with the first response information, it can be directly returned to the user as the second response information. Otherwise, the target transition words and response information can be integrated or spliced ​​together to obtain a complete and natural second response information to be returned to the user.

[0074] The method provided in this embodiment selects the target transition phrase based on the interaction information and context information and returns it in a timely manner, ensuring the timeliness of the response and the continuity with the interaction information. Then, when generating response information using the preset large model, the target transition phrase, interaction information, and context information are used as input together, ensuring the continuity between the first response information and the second response information. This effectively reduces the perception delay while enhancing the natural continuity of human-computer dialogue.

[0075] In optional implementations, depending on the needs of different interaction scenarios, it is not necessary to return the target transition message to the user in all cases. The target transition message is only returned when preset conditions are met. In order to reasonably determine whether the target transition message needs to be returned, this embodiment also provides at least two implementation methods for determining whether the preset conditions are met:

[0076] Method 1:

[0077] First, obtain the total text length of the interaction information and context information;

[0078] In this embodiment, the total text length can be used as a basic indicator to measure the amount of input data for a pre-defined large model, reflecting the overall information load of the current dialogue context. The total text length is usually quantified in terms of the number of characters, tokens, or sentences, and its value directly affects the computational resources and time overhead required by large language models in the understanding and reasoning stages.

[0079] Secondly, extract the preset instruction words that represent the processing complexity from the interaction information;

[0080] In this embodiment, preset instruction words refer to a predefined class of keywords with a high computational or reasoning load semantic tendency, such as "detailed explanation," "list multiple examples," "compare similarities and differences," and "reasoning reasons." Their appearance often indicates that subsequent generation tasks involve deep understanding or multi-step deduction. By identifying such words, semantic complexity that cannot be reflected by text length alone can be captured, thereby more accurately predicting the actual processing pressure.

[0081] Third, the estimated time for calling the preset large model is evaluated based on the total text length and preset instruction words;

[0082] In this embodiment, different preset large models with varying inference capabilities can be selected based on the total text length and preset instruction words. The deployment method, model size, allowed context length, and concurrency of different inference capabilities and preset large models are related. For example, in a voice dialogue scenario, if the requirement is to invoke a tool and the instruction compliance capability is particularly high, a larger model will perform better, but the time required to generate the first token will increase. The estimated processing time for different preset large models can be obtained through stress testing after deployment. For example, for a 72B model, this time can be around 400ms-500ms (4 concurrent users, 4 x 4090 graphics cards). For a 7B model (4 concurrent users, 2 x 4090 graphics cards), it can be around 80-150ms.

[0083] Fourth, if the estimated duration is longer than the preset duration, then the preset conditions are deemed met.

[0084] In this embodiment, the preset duration can be set according to the user experience requirements in the actual application scenario. For example, the preset duration can be set to 300ms or 500ms, which corresponds to the acceptable boundary of people's interaction interruption under normal circumstances.

[0085] Method one proactively provides feedback before actual delays occur to compensate for the processing time of the pre-set large model, thereby effectively improving dialogue fluency and user satisfaction. Furthermore, in human-computer dialogue, the content expressed by users not only includes informational requests but also often includes emotional appeals or the manifestation of cognitive states. To enhance the system's ability to perceive context and make its response behavior more situationally adaptable, this embodiment also provides method two: determining whether preset conditions are met.

[0086] Method 2:

[0087] First, extract the emotional keywords that represent emotional color and the processing keywords that represent the information processing method from the interaction information and context information;

[0088] In this embodiment, sentiment keywords refer to words or phrases in natural language that have obvious emotional polarity or intensity, such as "worried" in "I'm worried," "great" in "this is great," and words that directly express subjective feelings, such as "sad," "excited," and "anxious." Such words can be located and extracted using a pre-defined sentiment dictionary matching, rule template recognition, or a lightweight sentiment classification model, and then analyzed to determine whether they are sufficient to characterize the current dialogue as being in an emotional expression context requiring an empathetic response.

[0089] In this embodiment, processing keywords are used to identify the cognitive state of a user who is thinking, seeking reasoning, or expecting a deeper response. Typical examples include "uncertain" in "I feel... but I'm not sure," "analyze" in "Can you help me analyze this?", and "reason" in "I want to know why." These words suggest that the user is in an exploratory dialogue stage and expects the system to demonstrate a human-like thought process.

[0090] Secondly, if the emotional keywords indicate that the current context belongs to the emotional expression context, or the processing keywords indicate that the current context belongs to the thinking expression context, then the preset conditions are met.

[0091] In this embodiment, the presence of emotional keywords indicates that the current context is primarily one of emotional expression, meaning the user values ​​being heard and emotional empathy. Inserting transitional phrases like "I understand how you feel" helps establish an emotional connection. Processing keywords indicate that the current context is one of thought expression, meaning the user expects the system to undergo some cognitive processing. Using transitional phrases like "Let me think about it" or "This is a thought-provoking question" can enhance the authenticity of the response. Meeting any one of these conditions constitutes a preset condition, triggering the selection and output of the target transitional phrase.

[0092] As a means of implementation, transition phrases can be structured language units that have undergone functional classification and pragmatic design. Each pre-set transition phrase can correspond to a specific category of interactive function, such as indicating confirmation, expressing thoughts, connecting topics, or demonstrating empathy.

[0093] In an optional implementation, to better match the judgment of the preset conditions with the current interaction characteristics and make the human-computer dialogue more natural, this embodiment also provides a method for selecting a target transition phrase from a preset transition phrase pool based on the interaction information and the context information of the interaction information:

[0094] (1) Extract target interaction features from interaction information and context information. The target interaction features represent at least one of interaction intention, interaction state, interaction emotion and interaction frequency.

[0095] In this embodiment, the interaction intent includes, but is not limited to, inquiries, requests, and confirmations; the interaction state includes, but is not limited to, initial questions, follow-up questions, and clarifications; the interaction emotion includes, but is not limited to, positive, negative, and neutral emotions; and the interaction number refers to the number of rounds of dialogue the current interaction is in. As one implementation method, target interaction features can be extracted using a context feature extractor. The context feature extractor can be a lightweight analysis model based on natural language understanding technology, including, but not limited to, classification models such as FastText and BiLSTM.

[0096] (2) Evaluate the category score of each preset category among all preset categories in the preset transition language pool for the target interaction features;

[0097] In this embodiment, the preset transition phrase pool includes multiple predefined and categorized preset transition phrases. Each preset transition phrase is assigned a preset category related to a preset interaction feature. The preset categories can be organized according to function (such as confirmation, question, thinking, continuation, etc.), emotional tone, length, etc. For example, the preset transition phrases with the preset category "acknowledgement" include "okay", "understood", and "received", represented as: {"acknowledgement": ["okay", "understood", "received"]}; the preset transition phrases with the preset category "thinking" include "let me think about it", "um...", and "I need to think about this problem"]}.

[0098] (3) Based on the scores of all categories, determine the target transition phrase from multiple preset transition phrases.

[0099] In this embodiment, a lightweight classification model or rule engine can be used to calculate the category score of the target interaction feature for each preset category. This score reflects the appropriateness of using a certain category of transition phrase in the current context. For example, when a user expresses confusion, the category score for "empathy" may increase significantly; while when facing complex problems, the score for "thinking" is more prominent. The lightweight classification model or rule engine includes, but is not limited to, decision trees, support vector machines, small Transformer classifiers such as DistilBERT / ELECTRA-small, or hybrid systems that combine rule-based logical judgment with models. After obtaining the category scores for all preset categories, the overall distribution of the scores for each category can be considered comprehensively, and the candidate set with higher scores can be retained first. Based on this, the target transition phrase is finally selected according to semantic adaptability, diversity, or personalized preferences.

[0100] In optional implementations, making decisions based solely on category scores may not fully meet the needs of users for a personalized communication experience. To enhance the friendliness and relevance of feedback language, this embodiment introduces a personalized matching mechanism based on initial screening. By evaluating the similarity between candidate transition phrases and user preference styles, more refined selection control is achieved. Specifically, this embodiment provides a method for determining the target transition phrase from multiple preset transition phrases based on scores across all categories:

[0101] First, sort all category scores from largest to smallest;

[0102] Secondly, the preset transition phrases that are ranked first in the preset number will be used as the initial preset transition phrases;

[0103] In this embodiment, each preset transition phrase is ranked according to its category score; a higher score indicates a stronger match between its functional attributes and the current dialogue context. Based on this, the initial selection of preset transition phrases is a high-quality candidate set composed of several top-ranked preset transition phrases of a predetermined number.

[0104] Third, obtain users' preferred interaction styles;

[0105] Fourth, the preliminary preset transition phrases with the highest similarity between their interaction style and the preferred interaction style are selected as the target transition phrases.

[0106] In this embodiment, preferred interaction styles can be derived from long-term dialogue history analysis, explicit user settings, or inferred through machine learning models. These preferences can manifest as a bias towards formality of language, intensity of emotional expression, and pace of response. For example, some users prefer concise and direct communication, while others prefer warmer, more empathetic responses. Preferred interaction styles can be stored in structured tags or vector form and used as a benchmark for personalized matching.

[0107] In this embodiment, the similarity between the interaction style of each pre-selected transition phrase and the user's preferred interaction style is compared one by one. Each pre-selected transition phrase has been labeled with corresponding style features during construction, such as "formal", "friendly", "concise", "detailed", etc. The similarity between the interaction style and the preferred interaction style can be calculated by cosine similarity using text embedding vectors, or by matching and scoring through rule mapping.

[0108] It should be noted that, for ease of integration and independent optimization, the implementation of selecting a target transition phrase from a pre-set transition phrase pool based on interaction information and its context can be encapsulated into a separate module: the Instant Transition Phrases Selection Module (IDMSM). This module is responsible for quickly selecting one or a set of the most suitable target transition phrases (e.g., "Okay, let me think about it," "I understand," "Hmm, this problem is a bit complicated," etc.) from the pre-set transition phrase pool based on the current dialogue context. This selection process is executed by a lightweight, fast-responding intelligent model (such as a BERT-based classifier or a hybrid rule-model system).

[0109] In an optional implementation, to make the response information generated by the preset large model and the first response information more naturally connected, this embodiment provides an implementation method:

[0110] First, interactive prompts are constructed based on interactive information, contextual information, and target transitional phrases;

[0111] Secondly, input the interactive prompts into the preset large model to obtain the response information.

[0112] In this embodiment, the interactive prompts can be a text sequence with clear role division and logical order, which is parsed by a pre-defined large model to generate subsequent content. The interactive prompts directly affect the model's understanding of the initial semantics and its control over the generation direction.

[0113] In this embodiment, the pre-defined large model refers to a language model with strong learning capabilities and contextual understanding performance, such as the GPT series, Claude series, or PaLM series. The pre-defined large model can generate response content token-by-token through an autoregressive approach. After receiving interactive prompts, the pre-defined large model encodes them as implicit representations and, based on its trained knowledge system and language patterns, deduces semantic flow from the end of the prompt. Since the prompt already contains information about the target transition phrase, the model tends to treat it as part of the actual dialogue, thereby generating response information that is consistent in style and logically coherent.

[0114] In an optional implementation, in order to ensure that the interactive prompts accurately convey the complete context of the dialogue history, the user's current request, and the system's initial feedback, this embodiment provides at least two ways to construct interactive prompts.

[0115] Method 1:

[0116] The target transition phrase is used as a prefix, and the context and interactive information are sequentially concatenated after the target transition phrase to generate interactive prompts.

[0117] In this embodiment, the output of the preset large model can also be specified in the interactive prompt words to start with the target transition phrase as the beginning of the response. The output of the preset large model is located after the target transition phrase, and finally the response information including the target transition phrase is obtained.

[0118] Method 2:

[0119] Generate interactive prompts based on context and interaction information;

[0120] The preset category of the target transition phrase is embedded as control information into the interactive prompt words. The control information is used to enhance the attention of the preset large model to the preset category of the target transition phrase.

[0121] In this embodiment, the preset category to which the target transition phrase belongs in the preset transition phrase discourse pool is obtained. This preset category is an abstract summary of the functional attributes of the target transition phrase, such as "confirmation type," "thinking type," "sequence type," or "emotional feedback type," etc. Each preset category corresponds to a specific communicative intention and linguistic feature. The preset category is transformed into a structured signal that can be parsed by the preset large model and injected as control information into a specified position in the interactive prompt words. Common methods include placing it in the system instruction paragraph, adding a special marker prefix (such as "[DISCOURSE_TYPE:THINKING]"), or explicitly showing the generation expectation through a few examples.

[0122] It should be noted that, as a specific implementation method, the above-described method of obtaining response information based on interaction information, context information, and target transition phrases using a preset large model can be encapsulated into an independent module: Conditional Content Generation Module (CCGM). The inputs to this Conditional Content Generation Module are interaction information, context information, and target transition phrases, and the output is response information. The components include:

[0123] Large language models: such as the GPT series, Claude series, and PaLM series, which have powerful text understanding and generation capabilities.

[0124] The prompt builder is responsible for integrating contextual information, interaction information, and the target transition phrase into a structured prompt for use by the large language model. For example, {s1} is the transition phrase selected by the transition phrase selection module IDMSM, such as "Okay, happy to help you" or "Let me think about books on AI ethics...".

[0125] User input: Can you recommend some books on the ethics of artificial intelligence?

[0126] Response information: {s1} I recommend the following books to you: ...

[0127] In an optional implementation, after receiving the response information, in order to avoid unnecessary repetition when responding to the user and further enhance the user experience, this embodiment also provides an implementation method for generating second response information based on the response information and returning it to the user:

[0128] If the response information includes the semantics of the target transition phrase, the response information is directly used as the second response information and returned to the user; otherwise, the target transition phrase is used as the preamble and the response information is used as the body to generate the second response information and return it to the user.

[0129] In this embodiment, semantic consistency analysis is performed on the response information and the target transition phrase. If they are semantically consistent, the response information is determined to contain the semantics of the target transition phrase; otherwise, the response information is determined not to contain the semantics of the target transition phrase. Semantic consistency means that the core intention or emotional attitude conveyed by the language is similar, rather than necessarily a complete match in literal form. Even if the response information does not directly reproduce the text of the target transition phrase, as long as it expresses the same or similar pragmatic functions such as emotional reassurance, confirmation of thought, or guidance, it is considered to contain the semantics of the target transition phrase.

[0130] In this embodiment, if the response information already encompasses the semantics of the target transition phrase, it indicates that the preset large model has autonomously absorbed and reproduced the previous guiding content during the generation process. In this case, no additional layering is needed, and the response information can be directly returned to the user terminal as the second response information of the interaction. This processing method helps prevent information redundancy and avoids unnatural dialogue phenomena such as repeated apologies and confirmations, thereby maintaining the compactness of the dialogue rhythm and the professionalism of the language expression. Conversely, it indicates that the preset large model's generation result has failed to inherit the previously established dialogue tone, and in this case, it is necessary to actively construct a structured output. As one implementation method, the target transition phrase can be placed at the beginning of the output sequence as guiding pre-context content, followed by the response information generated by the large model as the main body text, thereby forming a complete second response information and pushing it to the user interface.

[0131] It should be noted that the second response information can be displayed as text or synthesized via TTS (Text-To-Speech).

[0132] In voice interaction applications, during voice dialogue, it's not feasible to wait for a response to be generated before synthesizing the speech. Instead, speech is synthesized word-by-word and sent to the user in real time. Therefore, the human-computer dialogue implementation provided in this embodiment achieves a better user experience in voice interaction scenarios. To more clearly illustrate the technical effects of the human-computer dialogue implementation method provided in this embodiment in language interaction scenarios, please refer to... Figure 2 , Figure 2 This is an example diagram of human-computer dialogue in a voice scenario provided in this embodiment. Figure 2 In this process, the first response message can be generated using the BERT model, taking no more than 100ms to generate, and is played to the user immediately after generation. Using the first response message as a prefix, a second response message is generated. The second response message is sent to the text-to-speech (TTS) module as soon as its first word is generated. If the default large model uses a tool, the first word generation delay is approximately 2-3 seconds; otherwise, the delay is 300-500ms. However, since the first response message plays at a rate of 3-5 words per second, and the default large model generates the second response message much faster, the playback time of the first response message is sufficient to prepare the first word for the second response message. When the first response message is generated, it is still playing on the user's end. Then, using the first response message as a prefix, the default large model generates the second response message. From the moment the first word of the second response message is generated, the synthesized speech is sent to the user in real time. Since the average turn-by-turn transition time in human dialogue is 200ms, a realistic dialogue exceeding 200ms would negatively impact the user experience. However, the 100ms first response message plus the TTS speech synthesis time allows the user to receive a response in the shortest possible time. This enables smooth and seamless interaction between humans and machines.

[0133] To perform the corresponding steps in the above embodiments and various possible implementations, an implementation method of the human-computer dialogue implementation device 100 is given below. Please refer to... Figure 3 , Figure 3 This is a block diagram of the human-computer dialogue implementation device provided in this embodiment. It should be noted that the basic principle and technical effects of the human-computer dialogue implementation device 100 provided by the present invention are the same as those of the corresponding embodiments described above. For the sake of brevity, some parts of this embodiment are not mentioned.

[0134] The human-computer dialogue implementation device 100 includes a receiving module 110, a selection module 120, and a generation module 130.

[0135] The receiving module 110 is used to receive interactive information input by the user.

[0136] The selection module 120 is used to select a target transition phrase from a preset transition phrase pool based on the interaction information and the context information of the interaction information if preset conditions are met.

[0137] The selection module 120 is also used to return the target transition message as the first response information of the interactive information to the user.

[0138] The generation module 130 is used to generate response information based on interaction information, context information and target transition words using a preset large model.

[0139] The generation module 130 is also used to generate second response information based on the response information and return it to the user.

[0140] In an optional implementation, the selection module 120 is further configured to:

[0141] Get the total text length of the interaction information and context information;

[0142] Extract preset instruction words representing the processing complexity from the interaction information;

[0143] The estimated time for calling the preset large model is evaluated based on the total text length and preset instruction words;

[0144] If the estimated duration is longer than the preset duration, then the preset conditions are met.

[0145] In an optional implementation, the selection module 120 is further configured to:

[0146] Extracting emotional keywords representing emotional tone and processing keywords representing information processing methods from interactive and contextual information;

[0147] If the sentiment keyword indicates that the current context belongs to the sentiment expression context, or the processing keyword indicates that the current context belongs to the thought expression context, then the preset conditions are met.

[0148] In an optional implementation, the preset transition phrase pool includes multiple preset transition phrases, each preset transition phrase being assigned a preset category related to preset interaction features. The selection module 120 is specifically used for:

[0149] Extract target interaction features from interaction information and context information. Target interaction features represent at least one of interaction intent, interaction state, interaction emotion and interaction frequency.

[0150] Evaluate the category score of each preset category among all preset categories in the preset transition language pool for the target interaction feature;

[0151] Based on scores across all categories, the target transition phrase is determined from a pool of pre-set transition phrases.

[0152] In an optional implementation, the selection module 120 is specifically used to: determine the target transition phrase from a plurality of preset transition phrases based on scores across all categories.

[0153] Sort all category scores from largest to smallest;

[0154] The first preset number of preset transition phrases will be selected as the initial preset transition phrases;

[0155] Obtain user's preferred interaction style;

[0156] The preliminary preset transition phrase with the highest similarity between its interaction style and the preferred interaction style will be selected as the target transition phrase.

[0157] In an optional implementation, the generation module 130 is specifically used for:

[0158] Construct interactive prompts based on interactive information, contextual information, and target transitional phrases;

[0159] Input the interactive prompts into the preset large model to obtain the response information.

[0160] In an optional implementation, the generation module 130 is specifically used to construct interactive prompts based on interaction information, context information, and target transition words, and is further used to:

[0161] The target transition phrase is used as a prefix, and the context and interactive information are sequentially concatenated after the target transition phrase to generate interactive prompts.

[0162] In an optional implementation, the generation module 130 is specifically used to construct interactive prompts based on interaction information, context information, and target transition words, and is further used to:

[0163] Generate interactive prompts based on context and interaction information;

[0164] The preset category of the target transition phrase is embedded as control information into mutual prompt words. The control information is used to enhance the attention of the preset large model to the preset category of the target transition phrase.

[0165] In an optional implementation, the generation module 130 is further configured to:

[0166] If the response information includes the semantics of the target transition phrase, the response information is directly used as the second response information and returned to the user; otherwise, the target transition phrase is used as the preamble and the response information is used as the body to generate the second response information and return it to the user.

[0167] This invention also provides a block diagram of an electronic device 10, which implements the human-computer dialogue method described in the foregoing embodiments. Please refer to... Figure 4 , Figure 4 This is a block diagram of the electronic device 10 provided in this embodiment. The electronic device 10 includes a processor 11, a memory 12 and a bus 13. The processor 11 and the memory 12 are connected through the bus 13.

[0168] The processor 11 can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the human-computer dialogue implementation method in the above embodiments can be completed by the integrated logic circuits in the hardware of the processor 11 or by software instructions. The processor 11 can be a general-purpose processor, including a CPU (Central Processing Unit), an NP (Network Processor), etc.; it can also be a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Logic Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0169] The memory 12 is used to store the program for implementing the human-computer dialogue method. The program can be a software function module stored in the memory 12 in the form of software or firmware or embedded in the OS (Operating System) of the electronic device 10.

[0170] After receiving the execution instruction, the processor 11 executes the program to implement the human-computer dialogue implementation method of the aforementioned embodiment.

[0171] This embodiment provides a computer storage medium on which a computer program is stored. When the computer program is executed by a controller, it implements the human-computer dialogue implementation method as described in this embodiment.

[0172] In summary, embodiments of the present invention provide a method, apparatus, electronic device, and computer storage medium for implementing human-computer dialogue. The method includes: receiving interactive information input by a user; if preset conditions are met, selecting a target transition phrase from a preset transition phrase pool based on the interactive information and contextual information of the interactive information; returning the target transition phrase as the first response information of the interactive information to the user; generating response information using a preset large model based on the interactive information, contextual information, and target transition phrase; and generating a second response information of the interactive information based on the response information and returning it to the user. Compared with the prior art, this embodiment has at least the following advantages: (1) Selecting the target transition phrase based on the interaction information and context information and returning it in a timely manner ensures the timeliness of the response and the continuity with the interaction information. When generating response information using the preset large model, the target transition phrase, interaction information, and context information are used as input together, ensuring the continuity between the first response information and the second response information. This effectively reduces the perception delay while enhancing the natural continuity of human-computer dialogue; (2) By selecting the transition phrase and using the first response information for a rapid response, the system can provide preliminary feedback almost immediately after the user asks a question, effectively filling the "waiting time" required for the preset large model to operate and improving the user experience; (3) The transition words simulate the natural conjunctions, filler words and thinking markers in human dialogue, making the AI's response more rhythmic and humane, and the transition smoother; (4) By using the selected transition words as the conditions for the content generated by the preset large model, the semantic and stylistic consistency and coherence between the initial feedback and the subsequent core response are ensured; (5) The human-computer interaction realizes a communication style that is closer to that of humans, thus making it easier to gain the trust of users and positive feedback; (6) The transition word selection module is used to realize the rapid selection of transition words, and the conditional content generation module is used to guide the large language model to generate more natural and coherent output. The two core modules have clear functions, can be optimized independently, and can be easily integrated into the existing dialogue system architecture.

[0173] The above descriptions are merely various embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method of implementing a man-machine dialogue, characterized in that, The method includes: Receive interactive information input by the user; Extract the emotional keywords representing emotional color and the processing keywords representing the information processing method from the interaction information and context information; If the emotional keyword indicates that the current context belongs to the emotional expression context, or the processing keyword indicates that the current context belongs to the thinking expression context, then it is determined that the preset condition is met; If the preset conditions are met, a target transition phrase is selected from the preset transition phrase pool based on the interaction information and the context information of the interaction information; The target transition message is returned to the user as the first response information of the interactive information; Interactive prompts are constructed based on the interaction information, the context information, and the target transition phrase; Input the interactive prompts into a preset large model to obtain response information; Perform semantic consistency analysis on the response information and the target transition phrase. If the two are semantically consistent, it is determined that the response information includes the semantics of the target transition phrase; otherwise, it is determined that the response information does not include the semantics of the target transition phrase. If the response information includes the semantics of the target transition phrase, then the response information is directly used as the second response information and returned to the user; otherwise, the target transition phrase is used as the preamble and the response information is used as the body to generate the second response information and return it to the user. The second response information includes the semantics of most of the target transition phrases or the target transition phrases are guiding preambles of the second response information. The step of constructing interactive prompts based on the interaction information, the context information, and the target transition phrase includes: The interactive prompt words are generated based on the context and the interactive information; The preset category of the target transition phrase is embedded as control information into the interactive prompt word. The control information is used to enhance the attention of the preset big model to the preset category of the target transition phrase. The preset category is determined by abstract generalization of the functional attributes of the target transition phrase and corresponds to specific communicative intentions and linguistic features.

2. The method of claim 1, wherein, The method further includes: Obtain the total text length of the interaction information and the context information; Extract preset instruction words representing the processing complexity from the interaction information; The estimated time for calling the preset large model is evaluated based on the total text length and the preset instruction words; If the estimated duration is greater than the preset duration, then the preset condition is determined to be met.

3. The method of claim 1, wherein, The preset transition phrase pool includes multiple preset transition phrases, each of which is assigned a preset category related to preset interaction features. The step of selecting a target transition phrase from the preset transition phrase pool based on the interaction information and the context information of the interaction information includes: Target interaction features are extracted from the interaction information and the context information, wherein the target interaction features represent at least one of interaction intent, interaction state, interaction emotion and interaction frequency; Evaluate the category score of each preset category among all preset categories in the preset transition language pool for the target interaction feature; Based on the scores of all the categories, the target transition phrase is determined from the plurality of preset transition phrases.

4. The method of claim 3, wherein, The step of determining the target transition phrase from the plurality of preset transition phrases based on the scores of all the categories includes: Sort all the scores of the categories from largest to smallest; The first preset number of preset transition phrases will be selected as the initial preset transition phrases; Obtain the user's preferred interaction style; The preliminary preset transition phrase whose interaction style is most similar to the preferred interaction style is selected as the target transition phrase.

5. The method of claim 1, wherein, The step of constructing interactive prompts based on the interaction information, the context information, and the target transition phrase includes: The target transition phrase is used as a prefix, and the context and interaction information are sequentially concatenated after the target transition phrase to generate the interaction prompt word.

6. A man-machine dialog implementation device, characterized by The device includes: The receiving module is used to receive interactive information input by the user; The selection module is used to select a target transition phrase from a preset transition phrase pool based on the interaction information and the context information of the interaction information if preset conditions are met. The selection module is also used to return the target transition message as the first response information of the interaction information to the user; The selection module is also used to: extract emotional keywords representing emotional color and processing keywords representing information processing methods from the interaction information and context information; If the emotional keyword indicates that the current context belongs to the emotional expression context, or the processing keyword indicates that the current context belongs to the thinking expression context, then it is determined that the preset condition is met; The generation module is used to construct interactive prompts based on the interaction information, the context information, and the target transition phrase; and input the interactive prompts into a preset large model to obtain response information. The generation module is further configured to: perform semantic consistency analysis on the response information and the target transition phrase; if the two are semantically consistent, determine that the response information includes the semantics of the target transition phrase; otherwise, determine that the response information does not include the semantics of the target transition phrase; if the response information includes the semantics of the target transition phrase, directly use the response information as the second response information and return it to the user; otherwise, use the target transition phrase as the preamble and the response information as the body to generate the second response information and return it to the user; the second response information includes the semantics of a majority of the target transition phrases or the target transition phrases are guiding preamble content of the second response information. The generation module is further configured to: generate the interactive prompt words based on the context and the interactive information; embed the preset category of the target transition word as control information into the interactive prompt words, wherein the control information is used to enhance the attention of the preset large model to the preset category of the target transition word, wherein the preset category is determined by abstract generalization of the functional attributes of the target transition word and corresponds to specific communicative intentions and linguistic features.

7. An electronic device, characterized in that, It includes a controller and a memory, the memory being used to store a program, and the controller being used to implement the human-computer dialogue implementation method as described in any one of claims 1-5 when executing the program.

8. A computer storage medium, characterized in that A computer program is stored thereon, which, when executed by the controller, implements the man-machine dialogue implementation method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Multi-mode man-machine interaction method and device

    CN114020153A

  • Knowledge base sensitive question test method, system, equipment and medium

    CN119807683A

  • Response text generation method and device, computer equipment and storage medium

    CN120508609A

  • Off-line and on-line voice module user experience optimization method, storage medium and electronic device

    CN120636384A