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

By selecting target transition phrases based on interactive and contextual information and generating response information using a pre-set large model, the method solves the problems of latency perception and natural transition in real-time dialogue scenarios using LLM, achieving immediacy and naturalness in dialogue, solving the problems of user-perceived latency and interactivity, and enhancing the immediacy and naturalness of human-computer dialogue.

CN121256005AActive Publication Date: 2026-01-02SHANGHAI XULU INFORMATION TECHNOLOGY CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202511767682.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-01-02
Estimated Expiration
2045-11-28

AI Technical Summary

Technical Problem

In real-time voice or text dialogue scenarios, the generation speed of LLM becomes a bottleneck, 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, the target transition phrase is selected from the preset transition phrase pool as the first response information, and the response information is generated using the preset large model to ensure the timeliness and coherence of the response. The timely return of the target transition phrase and the natural coherence of the subsequent response information are achieved through the selection module and the generation module.

Benefits of technology

It effectively reduces user perception latency, enhances the naturalness, coherence, and fluency of human-computer dialogue, and ensures the immediacy and coherence of interaction by promptly returning target transition phrases and generating response information using preset large models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121256005A_ABST
    Figure CN121256005A_ABST
Patent Text Reader

Abstract

The invention relates to a man-machine interaction technology, and provides a man-machine conversation realization method and device, electronic equipment and a computer storage medium, and the method comprises the steps: receiving interaction information inputted by a user; if the preset condition is met, selecting a target transition language from a preset transition language verbal skill pool according to the interaction information and the context information of the interaction information; returning the target transition language to the user as first response information of the interaction information; generating response information by using a preset large model according to the interaction information, the context information and the target transition language; and generating second response information of the interaction information according to the response information and returning to the user. According to the method, the natural continuity of man-machine conversation can be enhanced while the perception delay is effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of human-computer interaction, in particular to a human-computer dialogue implementation method and device, electronic equipment and computer storage medium. BACKGROUND

[0002] LLM (Large Language Module) based dialogue systems 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 user-perceptible delays and affecting the smoothness of interaction. In addition, the direct generation of LLM replies may sometimes lack the natural transitions commonly found in human dialogue to manage turns and express the thinking process, appearing rather rigid or mechanical.

[0003] To improve user experience, one solution is to try to alleviate the sense of delay through streaming output, or to use simple preset replies to deal with certain specific requests. However, streaming output may not form complete meaning when the first few tokens are generated, and simple preset replies lack context adaptability and coherence of subsequent content. SUMMARY

[0004] The present application aims to provide a human-computer dialogue implementation method, device, electronic equipment and computer storage medium.

[0005] Embodiments of the present application can be implemented as follows: In a first aspect, the present application provides a human-computer dialogue implementation method, the method comprising: receiving user input interaction information; if a preset condition is met, selecting a target transition speech from a preset transition speech pool according to the interaction information and context information of the interaction information; returning the target transition speech as the first response information of the interaction information to the user; generating response information using a preset large model according to the interaction information, the context information and the target transition speech; generating second response information of the interaction information according to the response information and returning it to the user.

[0006] In an optional implementation, the method further comprises: obtaining the total text length of the interaction information and the context information; extracting a preset instruction word representing the complexity of processing in the interaction information; evaluating the estimated duration of calling the preset large model according to the total text length and the preset instruction word; If the estimated duration is greater than the preset duration, it is determined that the preset condition is met.

[0007] In optional embodiments, the method further comprises: extracting emotional keywords representing emotional color in the interaction information and the context information, and processing keywords representing information processing mode; If the emotional keywords represent that the current context belongs to an emotional expression context, or the processing keywords represent that the current context belongs to a thinking expression context, it is determined that the preset condition is met.

[0008] In optional embodiments, the preset transition speech pool includes a plurality of preset transition speeches, each of which is provided with a preset category related to a preset interaction feature, and the step of selecting a target transition speech from the preset transition speech pool according to the interaction information and the context information of the interaction information comprises: extracting a target interaction feature from the interaction information and the context information, the target interaction feature representing at least one of an interaction intent, an interaction state, an interaction emotion, and an interaction frequency; evaluating a category score of the target interaction feature belonging to each of all preset categories of the preset transition speech pool; determining a target transition speech from the plurality of preset transition speeches according to all the category scores.

[0009] In optional embodiments, the step of determining a target transition speech from the plurality of preset transition speeches according to all the category scores comprises: arranging all the category scores from large to small; arranging the top preset number of preset transition speeches as preliminary selected preset transition speeches; obtaining a preferred interaction style of the user; selecting the preliminary selected preset transition speech with the highest similarity in interaction style to the preferred interaction style as the target transition speech.

[0010] In optional embodiments, the step of generating a response information using a preset large model according to the interaction information, the context information, and the target transition speech comprises: constructing an interaction prompt word according to the interaction information, the context information, and the target transition speech; inputting the interaction prompt word into the preset large model to obtain the response information.

[0011] In optional embodiments, the step of constructing an interaction prompt word according to the interaction information, the context information, and the target transition speech comprises: The target transition language is concatenated after the context and the interaction information to generate the interaction prompt word.

[0012] In an optional embodiment, the step of constructing the interaction prompt word according to the interaction information, the context information and the target transition language comprises: generating the interaction prompt word according to the context and the interaction information; embedding a preset category of the target transition language into the interaction prompt word as control information, the control information being used to strengthen the attention of the preset large model to the preset category of the target transition language.

[0013] In an optional embodiment, the step of generating the second response information of the interaction information according to the response information and returning the user comprises: if the response information includes the semantic of the target transition language, directly taking the response information as the second response information and returning the user, otherwise, taking the target transition language as a preface and taking the response information as a main body to generate the second response information and return the user.

[0014] In a second aspect, the present application provides a human-computer dialogue implementation device, the device comprising: a receiving module configured to receive interaction information input by a user; a selecting module configured to select a target transition language from a preset transition language script pool according to the interaction information and context information of the interaction information if a preset condition is met; the selecting module is further configured to return the target transition language to the user as first response information of the interaction information; a generating module configured to generate response information by using a preset large model according to the interaction information, the context information and the target transition language; the generating module is further configured to generate second response information of the interaction information according to the response information and return the user.

[0015] In a third aspect, the present application provides an electronic device comprising a controller and a memory, the memory being configured to store a program, and the controller being configured to implement the human-computer dialogue implementation method according to any one of the preceding embodiments when executing the program.

[0016] In a fourth aspect, the present application provides a computer storage medium having a computer program stored thereon, the computer program being configured to implement the human-computer dialogue implementation method according to any one of the preceding embodiments when executed by a controller.

[0017] Compared with the prior art, the present application has the following beneficial effects: The present application aims at the interactive information input by a user, when a preset condition is met, a target transition language is selected from a preset transition language pool according to the interactive information and context information thereof, and is returned to the user as first response information, then, a response information is generated by using a preset large model according to the interactive information, context information and target transition language, and a second response information is generated according to the response information and is returned to the user. Since the target transition language is selected according to the interactive information and context information and is returned in time, the present application guarantees the timeliness of the response and the coherence with the interactive information, and when the response information is generated by using the preset large model, the target transition language and the interactive information and context information are taken as inputs, which guarantees the coherence between the first response information and the second response information, effectively reduces the perception delay and enhances the natural coherence of the human-computer dialogue. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.

[0019] Figure 1 The flowchart of the human-computer dialogue implementation method provided for the present embodiment.

[0020] Figure 2 The example diagram of the human-computer dialogue in the speech scene provided for the present embodiment.

[0021] Figure 3 The block diagram of the human-computer dialogue implementation device provided for the present embodiment.

[0022] Figure 4 The block diagram of the electronic device provided for the present embodiment.

[0023] Icon: 10-electronic device; 11-processor; 12-memory; 13-bus; 100-human-computer dialogue implementation device; 110-receiving module; 120-selection module; 130-generation module. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solutions and advantages of the embodiments of the present application more clear, the following will combine the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0025] Therefore, the following detailed description of the embodiments of the application provided in the drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the application.

[0026] It should be noted that similar reference numbers and letters represent similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0027] In the description of the application, it should be noted that if the terms "upper", "lower", "inner", "outer" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship in which the product of the application is usually placed, and are only for the convenience of describing the application and simplifying the description, and therefore cannot be understood as indicating or implying that the device or element must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the application.

[0028] In addition, if the terms "first", "second" and the like appear, they are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0029] It should be noted that the features in the embodiments of the application can be combined with each other without conflict.

[0030] Please refer to Figure 1 , Figure 1 The flowchart of the human-computer interaction method provided in this embodiment is shown in the following figure, which includes the following steps: Step S101, receiving the interactive information input by the user.

[0031] In this embodiment, the interactive information can be text input directly by the user or text obtained by recognizing and converting the voice input by the user through a voice recognition module, the content of which carries the user's instant intention and request information.

[0032] Step S102, if the preset condition is met, selecting a target transition speech from a preset transition speech pool according to the interactive information and the context information of the interactive information.

[0033] In the embodiment, after receiving the interaction information, instead of starting the transition speech response process for all requests, it is further determined whether the preset condition is met. The preset condition is used to screen out scenarios that are more suitable for inserting preliminary feedback, such as situations that are expected to generate a long time-consuming, dialogue context involves complex thinking or emotional expression, etc. For scenarios that do not meet the preset condition, the step of selecting the target transition speech can be skipped, and the response information generated according to the interaction information and the context information by using the preset large model is directly returned to the user.

[0034] In the embodiment, in the application scenario of multi-round dialogue, the context information records and transmits the historical track of the current session, including but not limited to the previous user's speech content, the response made to the speech content, the evolution path of the dialogue theme, and the implied emotional or logical state. As an implementation manner, a dialogue history manager can be used to store and manage the context information and dynamically maintain it, continuously update it with each round of interaction, and ensure that the subsequent processing can be based on the complete dialogue context for decision-making.

[0035] In the embodiment, the preset transition speech rhetoric pool stores a plurality of pre-defined transition speech expression forms, for example, the preset transition speech rhetoric pool includes "let me think" or "I need to think about this problem" and other transition speeches that represent confirmation, express thinking, accept the topic or embody empathy. The target transition speech is the transition speech selected from the preset transition speech rhetoric that best fits the current context characteristics.

[0036] Step S103, returning the target transition speech to the user as the first response information of the interaction information.

[0037] In the embodiment, the first response information can not contain complete answer content, and is presented in a short and instant form, the purpose of which is to quickly establish a feedback loop and effectively fill the time gap during the processing of the main content by the large language model. The user perceives that the request has been received and is being processed, thereby reducing the negative feelings of delay.

[0038] Step S104, generating the response information by using the preset large model according to the interaction information, the context information and the target transition speech.

[0039] In the embodiment, the preset large model refers to a language model with strong context understanding and text generation capability. Since the interaction information, the context information and the target transition speech are input to the preset large model, the preset large model is affected by the existence of the target transition speech in the process of generating the response information, thereby tending to output subsequent content that is consistent in style and smooth in logic connection with the target transition speech.

[0040] Step S105, generating the second response information of the interaction information according to the response information and returning it to the user.

[0041] In the embodiment, according to different forms of response information output by different preset large models or different styles of prompt words given by the user, if the response information itself has natural coherence with the first response information, the response information can be directly returned to the user as the second response information, otherwise, the target transition language and the response information can be integrated or spliced to obtain complete and natural second response information and return to the user.

[0042] The above method provided by the embodiment selects a target transition language according to interactive information and context information and returns the target transition language in time, guarantees response timeliness and coherence with the interactive information, and then uses a preset large model to generate response information, which guarantees coherence between the first response information and the second response information, effectively reduces perceptual delay, and enhances natural coherence of human-computer dialogue.

[0043] In an optional implementation, according to the requirements of different interactive scenarios, not all cases need to return the target transition language to the user, and the target transition language is returned only when preset conditions are met. In order to reasonably determine whether the target transition language needs to be returned at present, the embodiment further provides at least two implementation manners of whether the preset conditions are met: Manner one: First, the total text length of the interactive information and the context information is obtained. In the embodiment, the total text length can be used as a basic index for measuring the input data amount of the preset large model, and reflects the overall information load of the current dialogue context. The total text length is usually quantified in the form of character number, token number, or sentence number, and the numerical value directly affects the computing resources and timing overhead required by the large language model in the understanding and reasoning stages.

[0044] Second, a preset instruction word representing processing complexity in the interactive information is extracted. In the embodiment, the preset instruction word is a type of key word with high computing or reasoning load semantic tendency defined in advance, for example, “detailed explanation”, “list multiple examples”, “compare similarities and differences”, “reasoning reasons”, and the like. The appearance of the preset instruction word often means that the subsequent generation task involves deep understanding or multi-step deduction. By identifying such words, the semantic complexity that cannot be reflected by the text length can be captured, so that the actual processing pressure can be more accurately predicted.

[0045] Third, the estimated duration of calling the preset large model is evaluated according to the total text length and the preset instruction word. In the embodiment, the preset large model with different reasoning capabilities can be selected according to the total text length and the preset instruction word. The deployment mode, model size, allowed context length and concurrency number of different reasoning capabilities and preset large models are related. For example, in a voice dialogue scene, if the tool is called, the instruction compliance capability has a particularly high requirement, the larger the size of the model, the better the performance, and the time consumed for the generation of the first token will be longer. The estimated processing time of different preset large models can be obtained by stress testing after deployment. For example, for a 72B model, the time can be about 400ms-500ms (4 concurrency, 4x4090 graphics card). For a 7B model, (4 concurrency, 2x4090 graphics card) can be about 80-150ms.

[0046] Fourth, if the estimated time is greater than the preset time, it is determined that the preset condition is met.

[0047] In the embodiment, the preset time can be set according to the user experience demand in the actual application scene, for example, the preset time is set to 300ms or 500ms, which corresponds to the acceptable boundary of people's interaction interruption in general cases.

[0048] The first way is to actively provide feedback before the actual delay to make up for the long processing delay of the preset large model, thereby effectively improving the fluency of the dialogue and the user satisfaction. In addition, in the process of human-computer dialogue, the content expressed by the user not only contains information request, but also often accompanies emotional appeal or externalization of cognitive state. In order to improve the system's perception ability of the context and make the response behavior more situationally adaptive, the second way to determine whether the preset condition is met is also provided in the embodiment.

[0049] The second way: First, extract the emotional keywords representing the emotional color in the interaction information and the context information, and the processing keywords representing the information processing mode; In the embodiment, the emotional keywords refer to the words or phrases with obvious emotional polarity or emotional intensity in natural language, for example, “worried” in “I am very worried”, “too good” in “this is too good”, and “sad”, “excited”, “anxious” and other words directly expressing subjective feelings. Such words can be located and extracted by matching a preset emotional dictionary, recognizing a rule template or a lightweight emotion classification model, and then analyzing whether they are sufficient to represent the emotional expression context of the current dialogue that requires empathetic response.

[0050] In the embodiment, the processing keyword is used to identify the cognitive state that the user is thinking, seeking reasoning or expecting a deep response. Typical examples include "uncertain" in "I think... but I am not sure", "analysis" in "Can you help me analyze", "reason" in "I want to know the reason", and the like, which imply that the user is in an exploratory dialogue stage and expects the system to exhibit a human-like thinking process.

[0051] Secondly, if the emotional keyword represents that the current context belongs to an emotional expression context, or the processing keyword represents that the current context belongs to a thinking expression context, it is determined that the preset condition is met.

[0052] In the embodiment, the presence of the emotional keyword indicates that the current context is mainly an emotional expression context, meaning that the user pays more attention to being listened to and emotional identification. At this time, inserting a transition such as "I understand your feelings" helps to establish an emotional connection. The processing keyword indicates that the current context belongs to a thinking expression context, and the user expects the system to undergo a certain cognitive processing process. Using a transition such as "Let me think about it" or "This question is worth thinking about" can enhance the authenticity of the response. As long as any one of the conditions is met, it is determined that the preset condition is met, and the selection and output process of the target transition is triggered.

[0053] As an implementation manner, the transition can be a language unit that is structured after functional classification and pragmatic design. Each preset transition can correspond to a specific interactive functional category, for example, indicating confirmation, expressing thinking, taking over a topic, or embodying empathy, and the like.

[0054] In an optional implementation, in order to make the judgment of the preset condition more matched with the current interactive features and make the human-computer dialogue more natural, the embodiment further provides an implementation manner of selecting a target transition from a preset transition phrase pool according to interactive information and context information of the interactive information: (1) extracting a target interactive feature from the interactive information and the context information, the target interactive feature representing at least one of an interactive intention, an interactive state, an interactive emotion, and an interactive number of times; In the embodiment, the interactive intention includes, but is not limited to, an intention of inquiry, request, confirmation, and the like, the interactive state includes, but is not limited to, a state of initial questioning, follow-up questioning, clarification, and the like, the interactive emotion includes, but is not limited to, a positive, negative, neutral, and the like, and the interactive number of times is the number of the current interaction. As an implementation manner, the target interactive feature can be extracted by a context feature extractor, which can be a lightweight analysis model based on natural language understanding technology, including, but not limited to, a classification model such as FastText and BiLSTM.

[0055] (2) evaluating a class score of each preset class of all preset classes of the preset transition phrase pool to which the target interactive feature belongs. (3) selecting a target transition from the preset transition phrase pool according to the class score of each preset class of all preset classes of the preset transition phrase pool to which the target interactive feature belongs; and (4) outputting the target transition. In the embodiment, the preset transition speech pool includes a plurality of preset transitions stored in advance and classified, each preset transition is provided with a preset category related to the preset interaction feature, and the preset categories can be organized according to functions (such as confirmation, question, thinking, and follow-up), emotional color, length, and the like. For example, the preset transitions of the preset category "acknowledgement" include "good", "understood", and "received", which are represented as: {"acknowledgement": ["good", "understood", "received"]};The preset transitions of the preset category "thinking" include "let me think", "hmm...", and "I need to think about this problem"]", which are represented as: {"thinking": ["let me think", "hmm...", "I need to think about this problem"]}。

[0056] (3) Determine the target transition from the plurality of preset transitions according to the category scores of all categories.

[0057] In the embodiment, a lightweight classification model or a rule engine can be used to calculate the category score of the target interaction feature for each preset category, which reflects the degree of appropriateness of using a category transition in the current context. For example, when it is detected that the user expresses confusion, the category score of the "empathy category" may increase significantly; and when facing a complex problem, the score of the "thinking category" is more prominent. The lightweight classification model or rule engine includes, but is not limited to, decision tree, support vector machine, small Transformer classifier such as DistilBERT / ELECTRA-small, or a hybrid system based on rule-based logical judgment and model combination. After obtaining the category scores of all preset categories, the overall distribution of the category scores can be considered to preferentially retain the candidate set with higher scores, and the target transition can be finally selected according to semantic adaptability, diversity, or individual preference on this basis.

[0058] In the optional implementation, a single-dimensional decision only according to the category score may not fully meet the needs of individualized communication experience of the user. To improve the affinity and fit of the feedback language, the embodiment introduces an individualized matching mechanism on the basis of preliminary screening, realizes more refined selection control through similarity evaluation of the candidate transition and the user's preferred style, and for this purpose, the embodiment provides an implementation manner of determining the target transition from the plurality of preset transitions according to the category scores of all categories: First, arrange all the category scores from large to small; Second, arrange the preset transitions in the preset number in front as the preliminary selected preset transitions; In the embodiment, each preset transition phrase obtains a corresponding ranking position according to the score of the category to which it belongs. The higher the score, the stronger the matching degree of the functional attribute of the preset transition phrase to the current dialogue context. On this basis, the preliminary selected preset transition phrase is a high-quality candidate set formed by a plurality of preset transition phrases ranked in the front and the number of which is preset.

[0059] Thirdly, the preferred interaction style of the user is obtained. Fourthly, the preliminary selected preset transition phrase with the highest similarity to the preferred interaction style is selected as the target transition phrase.

[0060] In the embodiment, the preferred interaction style can be derived from long-term dialogue history analysis, explicit user settings or inference by a machine learning model, and can be manifested as a tendency in terms of language formality, emotional expression intensity, response rhythm, etc. For example, some users prefer a concise and direct communication mode, while others prefer a warm and empathetic response. The preferred interaction style can be stored in a structured label or vector form and used as a benchmark for personalized matching.

[0061] In the embodiment, the similarity between the interaction style of each preliminary selected preset transition phrase and the preferred interaction style of the user is compared one by one. Each preset transition phrase is annotated with corresponding style features when it is constructed, such as "formal", "affectionate", "concise", "detailed", etc. The similarity between the interaction style and the preferred interaction style can be calculated by cosine similarity of text embedding vectors or by rule mapping for matching scoring.

[0062] It should be noted that, in order to facilitate integration and independent optimization, the implementation of selecting the target transition phrase from the preset transition phrase pool according to the interaction information and the context information of the interaction information can be encapsulated as an independent module: an instant transition phrase selection module (IDMSM). The module is responsible for quickly selecting one or a group of most suitable target transition phrases (for example, "good, let me think about it", "I understand", "um, this question is a bit complex", etc.) from the preset transition phrase pool according to the current dialogue context. The selection process is performed by a lightweight and fast-response intelligent model (such as a classifier based on BERT or a rule and model hybrid system).

[0063] In an optional implementation, in order to make the response information generated by the preset large model and the first response information more natural and coherent, the embodiment provides an implementation: Firstly, an interaction prompt word is constructed according to the interaction information, the context information and the target transition phrase. Secondly, the interaction prompt word is input into the preset large model to obtain the response information.

[0064] In this embodiment, the interactive prompt word can be a sequence of text with clear role division and logical order, which is used to parse the preset large model and generate subsequent content accordingly. The interactive prompt word directly affects the model's understanding of the starting semantics and the control of the generation direction.

[0065] In this embodiment, the preset large model refers to a language model with strong learning ability and context understanding performance, such as GPT series, Claude series or PaLM series, etc. The preset large model can generate response content token by token through the autoregressive method. After receiving the interactive prompt word, the preset large model encodes it into implicit representation and continues the semantic flow from the end of the prompt based on the knowledge system and language patterns obtained through its own training. Since the prompt already contains the information of the target transition language, the model tends to regard it as part of the actual conversation, thereby generating response information that is consistent in style and naturally logically connected.

[0066] In optional implementations, in order to accurately convey the complete context of the dialogue history, the user's current request, and the system's preliminary feedback, this embodiment provides at least two ways to construct the interactive prompt word.

[0067] Method one: The target transition language is used as a prefix, and the context and interaction information are concatenated in sequence after the target transition language to generate the interactive prompt word.

[0068] In this embodiment, the output of the preset large model can also be specified in the interactive prompt word as the beginning of the response to the target transition language, and the output of the preset large model is located after the target transition language, finally obtaining the response information including the target transition language.

[0069] Method two: Generate an interactive prompt word according to the context and interaction information; Embed the preset category of the target transition language as control information into the interactive prompt word, which is used to strengthen the attention of the preset large model to the preset category of the target transition language.

[0070] In this embodiment, the preset category to which the target transition language belongs in the preset transition language script pool is obtained, which is an abstract induction of the functional attributes of the target transition language, such as "confirmation type", "thinking type", "acceptance type" or "emotional feedback type", etc. Each preset category corresponds to a specific communicative intention and language feature. The preset category is converted into a structured signal that can be parsed by the preset large model and injected as control information into the specified position in the interactive prompt word. Common methods include placing it in the system instruction paragraph, adding a special marker prefix (such as "[DISCOURSE_TYPE:THINKING]"), or explicitly displaying the generation expectation through a small number of example forms.

[0071] It should be noted that as a specific embodiment, the above implementation mode of obtaining the response information by using the preset large model according to the interaction information, the context information and the target transition language can be packaged as an independent module: a conditional content generation module (CCGM), the input of the conditional content generation module is: the interaction information, the context information and the target transition language, and the output is the response information, and the components include: Large language model: such as GPT series, Claude series, PaLM series and the like, which have strong text understanding and generation capabilities.

[0072] Prompt builder: responsible for integrating the context information, interaction information and target transition language into a structured prompt (prompt) for the large language model. For example, {s1} is the transition language selected by the transition language selection module IDMSM, such as “OK, happy to serve you.” or “Book about artificial intelligence ethics, let me think...”.

[0073] User input: Can you recommend a few books about artificial intelligence ethics? Response information: {s1} I recommend the following books for you:...

[0074] In an optional embodiment, after obtaining the response information, in order to avoid unnecessary repetition when responding to the user and further enhance the user experience, the embodiment also provides an implementation mode of generating second response information according to the response information and returning to the user: If the response information includes the semantics of the target transition language, the response information is directly used as the second response information and returned to the user, otherwise, the target transition language is used as the preface and the response information is used as the main text, the second response information is generated and returned to the user.

[0075] In this embodiment, the response information and the target transition language are analyzed for semantic consistency, if the semantics of the two are consistent, it is determined that the response information includes the semantics of the target transition language, otherwise, it is determined that the response information does not include the semantics of the target transition language. Semantic consistency means that the core intention or emotional attitude conveyed by the language is close, but it does not necessarily mean complete matching in literal form, even if the response information does not directly reproduce the words of the target transition language, as long as it expresses the same or similar emotional appeasement, thinking confirmation or acceptance guidance and the like, it is considered to contain the semantics of the target transition language.

[0076] In this embodiment, if it is determined that the semantic of the target transition language has been covered in the response information, it indicates that the preset large model has autonomously absorbed and reproduced the previous guiding content in the generation process, at this time, no additional superposition is needed, and the response information can be directly returned to the user terminal as the second response information of the interactive information. This processing method helps to prevent information redundancy and avoid unnatural dialogue phenomena such as repeated apologies and repeated confirmations, thereby maintaining the compactness of the dialogue rhythm and the professionalism of the language expression. On the contrary, it indicates that the preset large model generation result fails to inherit the previously established dialogue tone, at this time, a structured output needs to be actively constructed. As an implementation manner, the target transition language can be placed in the front position of the output sequence as a guiding preface content, and then the response information generated by the large model is spliced as the main body text part, thereby combining to form a complete second response information and pushing to the user interface.

[0077] It should be noted that the second response information can be displayed by text or TTS (Text-To-Speech, text-to-speech) speech synthesis.

[0078] For the application scenario of voice interaction, when voice dialogue, it cannot wait for a reply to be generated and then synthesize speech, and the synthesized speech is always word by word, and is sent to the user in real time. Therefore, the human-computer dialogue provided in this embodiment can achieve better user experience in the application scenario of voice interaction. In order to more clearly illustrate the technical effects of the human-computer dialogue implementation method provided in this embodiment in the language interaction scene, please refer to Figure 2 , Figure 2 The example diagram of the human-computer dialogue provided in this embodiment in the voice scene is as follows, Figure 2In the embodiment, the BERT model used by the first response information takes no more than 100 ms to generate, and the user is played immediately after the generation is completed. The second response information is generated with the first response information as a prefix, and the second response information is sent to the speech synthesis module (TTS) as soon as the first word is generated. If the preset large model has a calling tool, the first word generation time delay is about 2-3 s, otherwise the first word generation time delay is 300-500 ms. However, the playing speed of the first response information is 3-5 words per second, and the speed of the preset large model generating the second response information is much higher than the playing speed. Therefore, the time for playing the first response information is sufficient for the first word of the second response information, and the first response information is still being played on the user side when the first response information is generated. At this time, the preset large model generates the second response information with the first response information as a prefix, and the first word of the second response information is synthesized in real time and sent to the user as soon as it is generated. Since the average round conversion time of human conversation is 200 ms, if the real human conversation exceeds 200 ms, the user experience will be affected. However, the first response information of 100 ms plus the TTS speech synthesis time can make the user reply in the shortest time. Thus, smooth and coherent interaction between man and machine is realized.

[0079] In order to perform the corresponding steps in the above-mentioned embodiments and various possible implementations, an implementation of a man-machine dialogue implementation device 100 is given below. Please refer to Figure 3 , Figure 3 The block schematic diagram of the man-machine dialogue implementation device provided in the embodiment needs to be explained. The basic principle and technical effects of the man-machine dialogue implementation device 100 provided by the present application are the same as those of the above-mentioned embodiments, and for brief description, part of the embodiment is not mentioned.

[0080] The man-machine dialogue implementation device 100 includes a receiving module 110, a selection module 120, and a generation module 130.

[0081] The receiving module 110 is configured to receive interactive information input by a user.

[0082] The selection module 120 is configured to, if a preset condition is met, select a target transition speech from a preset transition speech pool according to the interactive information and context information of the interactive information.

[0083] The selection module 120 is further configured to return the target transition speech to the user as first response information of the interactive information.

[0084] The generation module 130 is configured to generate response information by using a preset large model according to the interactive information, the context information, and the target transition speech.

[0085] The generating module 130 is further configured to generate second response information of the interaction information according to the response information and return the user.

[0086] In optional embodiments, the selecting module 120 is further configured to: acquire a total text length of the interaction information and the context information; extract a preset instruction word in the interaction information, the preset instruction word representing a processing complexity; evaluate an estimated duration of calling the preset large model according to the total text length and the preset instruction word; if the estimated duration is greater than a preset duration, determine that the preset condition is met.

[0087] In optional embodiments, the selecting module 120 is further configured to: extract a sentiment keyword representing a sentiment color and a processing keyword representing an information processing mode in the interaction information and the context information; if the sentiment keyword represents that the current context belongs to a sentiment expression context or the processing keyword represents that the current context belongs to a thinking expression context, determine that the preset condition is met.

[0088] In optional embodiments, the preset transition speech technique pool includes a plurality of preset transition speeches, each preset transition speech is provided with a preset category related to a preset interaction feature, and the selecting module 120 is specifically configured to: extract a target interaction feature from the interaction information and the context information, the target interaction feature representing at least one of an interaction intent, an interaction state, an interaction sentiment, and an interaction frequency; evaluate a category score of each preset category of all preset categories of the preset transition speech technique pool to which the target interaction feature belongs; determine a target transition speech from the plurality of preset transition speeches according to all category scores.

[0089] In optional embodiments, when the selecting module 120 is used to determine the target transition speech from the plurality of preset transition speeches according to all category scores, the selecting module 120 is specifically configured to: arrange all category scores from large to small; arrange a preset number of preset transition speeches in front as preliminary selected preset transition speeches; acquire a preferred interaction style of the user; determine a preliminary selected preset transition speech with the highest similarity between the interaction style and the preferred interaction style as the target transition speech.

[0090] In optional embodiments, the generating module 130 is specifically configured to: construct an interaction prompt word according to the interaction information, the context information, and the target transition speech; input the interaction prompt word into the preset large model to obtain the response information.

[0091] In an optional implementation, when the generating module 130 is specifically configured to construct the interactive prompt word according to the interaction information, the context information and the target transition language, the generating module 130 is further configured to: concatenate the target transition language as a prefix and the context and the interaction information in sequence after the target transition language to generate the interactive prompt word.

[0092] In an optional implementation, when the generating module 130 is specifically configured to construct the interactive prompt word according to the interaction information, the context information and the target transition language, the generating module 130 is further configured to: generate the interactive prompt word according to the context and the interaction information; embed a preset category of the target transition language as control information in the interactive prompt word, and the control information is used to strengthen the attention of the preset large model to the preset category of the target transition language.

[0093] In an optional implementation, the generating module 130 is further configured to: if the semantic of the target transition language is included in the response information, directly return the response information as the second response information to the user, otherwise, generate the second response information by taking the target transition language as a preface and the response information as a body and return the second response information to the user.

[0094] The embodiment of the present application further provides a block schematic diagram of an electronic device 10, and the electronic device 10 implements the man-machine dialogue implementation method in the foregoing embodiment. Figure 4 , Figure 4 The block schematic diagram of the electronic device 10 provided in the embodiment is shown in the figure, and the electronic device 10 includes a processor 11, a memory 12 and a bus 13, and the processor 11 and the memory 12 are connected through the bus 13.

[0095] The processor 11 can be an integrated circuit chip with a signal processing capability. In the implementation process, each step of the man-machine dialogue implementation method in the foregoing embodiment can be completed by the integrated logic circuit of hardware or the instruction in the form of software in the processor 11. The processor 11 can be a general-purpose processor including a CPU (Central Processing Unit, central processor), an NP (Network Processor, network processor) and the like; or can be a DSP (Digital Signal Processor, digital signal processor), an ASIC (Application Specific Integrated Circuit, application specific integrated circuit), an FPGA (Field Programmable Logic Gate Array, field programmable logic gate array) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0096] The memory 12 is configured to store a program for implementing the method for implementing human-computer conversation, which can be a software function module stored in the memory 12 in the form of software or firmware or solidified in an operating system (OS) of the electronic device 10.

[0097] The processor 11 executes the program to implement the method for implementing human-computer conversation of the foregoing embodiments after receiving the execution instruction.

[0098] The embodiment provides a computer storage medium, which stores a computer program, and the computer program implements the method for implementing human-computer conversation when executed by a controller.

[0099] In summary, the embodiment of the present application provides a method and device for implementing human-computer conversation, an electronic device and a computer storage medium. The method comprises: receiving interactive information input by a user; if a preset condition is met, selecting a target transition language from a preset transition language pool according to the interactive information and context information of the interactive information; returning the target transition language as first response information of the interactive information to the user; generating response information by using a preset large model according to the interactive information, the context information and the target transition language; and generating second response information of the interactive information according to the response information and returning the second response information to the user. Compared with the prior art, the embodiment has at least the following advantages: (1) the target transition language is selected according to the interactive information and the context information and returned in time, which ensures the timeliness of the response and the coherence with the interactive information, and then the target transition language, the interactive information and the context information are used as inputs when generating the response information by using the preset large model, which ensures the coherence between the first response information and the second response information, effectively reduces the perception delay and enhances the natural coherence of the human-computer conversation; (2) the system can give preliminary feedback almost immediately after the user asks a question by selecting the transition language and using the first response information for quick response, which effectively fills the “waiting time” required for the operation of the preset large model and improves the user experience; (3) the transition language simulates the connecting words, filler words and thinking marks naturally existing in human conversation, which makes the AI reply more rhythmic and human, and the transition smoother; (4) the selected transition language is used as a condition for generating content by the preset large model, which ensures the consistency and coherence in semantics and style between the preliminary feedback and the subsequent core reply; (5) the human-computer interaction realizes a communication mode closer to human, which is easier to obtain the trust and positive feedback of the user; (6) the transition language selection module is used to realize the quick selection of the transition language, and the conditional content generation module is used to guide the large language model to generate more natural and coherent output, and the two core modules have clear functions and can be optimized independently and integrated into the existing dialogue system architecture.

[0100] The above merely describes various embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for implementing human-computer dialogue, characterized in that, The method includes: Receive interactive information input by the user; 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; 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; The second response information is generated based on the response information and returned to the user. The second response information includes the semantics of a majority of target transition phrases or the target transition phrases are guiding preface content of the second response information.

2. The method according to claim 1, characterized in that, 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 according to claim 1, characterized in that, The method further includes: Extract emotional keywords representing emotional color and processing keywords representing information processing methods from the interaction information and the 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.

4. The method according to claim 1, characterized in that, 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.

5. The method according to claim 4, characterized in that, 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.

6. The method according to claim 1, characterized in that, 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.

7. The method according to claim 1, characterized in that, 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 large model to the preset category of the target transition phrase.

8. The method according to claim 1, characterized in that, The steps of generating second response information based on the response information and returning it to the user include: 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.

9. A human-computer dialogue implementation device, characterized in that, 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 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 generate second response information of the interaction information based on the response information and return it to the user. The second response information includes the semantics of a majority of target transition phrases or the target transition phrases are guiding preface content of the second response information.

10. 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-8 when executing the program.

11. A computer storage medium, characterized in that, It stores a computer program that, when executed by the controller, implements the human-computer dialogue implementation method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Multi-mode man-machine interaction method and device

    CN114020153A

  • Voice conversation method and device, equipment, storage medium and product

    CN119314478A

  • Voice response method and device based on knowledge base, equipment and storage medium

    CN119541497A

  • Voice interaction method and device, equipment, storage medium and product

    CN119601015A

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

    CN119807683A