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

By processing user input text in real time, extracting keywords and generating reply text, the problems of long response time and poor user experience in the traditional digital human interaction system are solved, and more natural and efficient user interaction is achieved.

CN120067269APending Publication Date: 2025-05-30KANG JIAN INFORMATION TECH (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510214606.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

Traditional digital human interaction systems have problems with long response time and poor user experience, and cannot respond to user interruptions or change instructions immediately.

Method used

A reply text generation method is adopted to receive real-time input text from the user terminal, keyword extraction and interface update are performed, and the full input text is continuously received, semantic coding and knowledge base search are performed, context semantic vectors are integrated, reply text data is generated, and sent to the user terminal in real time.

Benefits of technology

It effectively solves the problems of long response time and poor user experience in traditional digital human interaction systems, achieves more natural user interaction, and improves the system's response speed and user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067269A_ABST
    Figure CN120067269A_ABST
Patent Text Reader

Abstract

The embodiment of the invention belongs to the technical field of intelligent decision, and relates to a reply text generation method and device, computer equipment and a storage medium, and the method comprises the following steps: extracting a keyword list according to a keyword extraction algorithm; displaying the keyword list according to a preset front-end interface updating strategy and the keyword list; continuously receiving a real-time input text sent by a user terminal to obtain a full input text; performing semantic coding on the full input text according to a pre-trained deep learning language model to obtain a semantic coding vector; obtaining knowledge base content in the semantic retrieval library; fusing the semantic coding vector and the content of the knowledge base to obtain a context semantic vector; and inputting the context semantic vector into a generative model to obtain reply text data. The problems that a traditional digital human interaction system is long in response time and poor in user experience are effectively solved, and meanwhile, through a dynamic interruption and continuous listening mechanism, the digital human can interact with the user more naturally.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent decision-making technology, and is applicable to the financial or medical field. In particular, it relates to a method, device, computer device, and storage medium for generating reply texts. Background Art

[0002] With the popularization of smart phones and mobile devices, digital humans, as virtual assistants, are playing an increasingly important role in daily life. Although traditional digital human interaction systems can achieve basic interaction functions, they have the following problems:

[0003] 1. Long response time: From the moment the user issues an instruction to the digital human's response, the entire process involves multiple links, such as automatic speech recognition (ASR), natural language understanding (NLU), dialogue generation, text-to-speech conversion (TTS), and voice-driven digital human animation. The serial processing of these links results in an overly long response time.

[0004] 2. Poor user experience: The long waiting time makes users think that the digital human is stuck or unresponsive, affecting the user experience.

[0005] 3. Unnatural interaction: Traditional digital human interaction systems lack flexibility and cannot instantaneously respond to user interruptions or changed instructions.

[0006] Therefore, traditional digital human interaction systems have problems such as long response time and poor user experience. Summary of the Invention

[0007] The purpose of the embodiments of this application is to propose a method, device, computer device, and storage medium for generating reply texts to solve the problems of long response time and poor user experience in traditional digital human interaction systems.

[0008] To solve the above technical problems, the embodiments of this application provide a method for generating reply texts, which adopts the following technical solutions:

[0009] Receive the real-time input text sent by the user terminal;

[0010] Perform keyword extraction operation on the real-time input text according to the keyword extraction algorithm to obtain a keyword list;

[0011] Perform interface update operation on the front-end interface according to the preset front-end interface update strategy and the keyword list to display the keyword list;

[0012] When performing the keyword extraction operation and the interface update operation, continuously receive the real-time input text sent by the user terminal to obtain the full amount of input text;

[0013] When the full input text input by the user terminal meets the preset full input conditions, perform semantic encoding operations on the full input text according to a pre-trained deep learning language model to obtain a semantic encoding vector;

[0014] Read the semantic retrieval library and obtain the knowledge base content corresponding to the semantic encoding vector in the semantic retrieval library;

[0015] Perform a fusion operation on the semantic encoding vector and the knowledge base content to obtain a context semantic vector;

[0016] Input the context semantic vector into a generative model for model text generation operations to obtain reply text data;

[0017] Send the reply text data to the user terminal.

[0018] Further, the step of performing keyword extraction operations on the real-time input text according to a keyword extraction algorithm to obtain a keyword list specifically includes the following steps:

[0019] Perform word segmentation processing on the real-time input text according to a natural language processing algorithm to obtain a word segmentation result sequence;

[0020] Perform keyword extraction operations on the word segmentation result sequence according to a keyword extraction algorithm to obtain the keyword list.

[0021] Further, the step of performing keyword extraction operations on the real-time input text according to a keyword extraction algorithm to obtain a keyword list specifically includes the following steps:

[0022] Perform real-time segmentation operations on the real-time input text according to a sliding window mechanism to obtain segmented input text;

[0023] Perform partitioning operations on the segmented input text according to a preset window size to obtain input text segments;

[0024] Perform keyword extraction operations on each input text segment to obtain the keyword list.

[0025] Further, the step of performing a fusion operation on the semantic encoding vector and the knowledge base content to obtain a context semantic vector specifically includes the following steps:

[0026] Perform weight adjustment operations on the semantic encoding vector and the knowledge base content according to an attention mechanism to obtain fusion weight data;

[0027] Perform a fusion operation on the semantic encoding vector and the knowledge base content according to the fusion weight data to obtain the context semantic vector.

[0028] Further, the step of inputting the context semantic vector into a generative model for model text generation operation to obtain reply text data specifically includes the following steps:

[0029] Distribute the context semantic vector to a plurality of threads for multi-threaded text generation operation to obtain a plurality of multi-threaded reply text data;

[0030] Integrate the plurality of multi-threaded reply text data to obtain the reply text data.

[0031] Further, after the step of sending the reply text data to the user terminal, the following steps are further included:

[0032] Update the dialogue state corresponding to the user terminal according to the reply text data;

[0033] Add the current input-output record to the full input text for generating the context semantic vector in the next round of dialogue.

[0034] To solve the above technical problems, an embodiment of the present application further provides a reply text generation device, which adopts the following technical solutions:

[0035] A real-time input text acquisition module, configured to receive real-time input text sent by a user terminal;

[0036] A keyword extraction module, configured to perform keyword extraction operation on the real-time input text according to a keyword extraction algorithm to obtain a keyword list;

[0037] An interface update module, configured to perform interface update operation on the front-end interface according to a preset front-end interface update policy and the keyword list to display the keyword list;

[0038] A full input text acquisition module, configured to continuously receive real-time input text sent by the user terminal during the keyword extraction operation and the interface update operation to obtain a full input text;

[0039] A semantic encoding module, configured to perform semantic encoding operation on the full input text according to a pre-trained deep learning language model when the full input text input by the user terminal meets a preset full input condition to obtain a semantic encoding vector;

[0040] A knowledge base content acquisition module, configured to read a semantic retrieval library and obtain knowledge base content corresponding to the semantic encoding vector in the semantic retrieval library;

[0041] A fusion module for performing a fusion operation on the semantic encoding vector and the knowledge base content to obtain a context semantic vector;

[0042] A text generation module for inputting the context semantic vector into a generative model to perform model text generation operation to obtain reply text data;

[0043] A text output module for sending the reply text data to the user terminal.

[0044] Further, the keyword extraction module includes:

[0045] A word segmentation sub-module for performing word segmentation processing on the real-time input text according to natural language processing algorithms to obtain a word segmentation result sequence;

[0046] A keyword extraction sub-module for performing keyword extraction operation on the word segmentation result sequence according to keyword extraction algorithms to obtain the keyword list.

[0047] To solve the above technical problems, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:

[0048] It includes a memory and a processor. Computer-readable instructions are stored in the memory, and when the processor executes the computer-readable instructions, the steps of the reply text generation method described above are implemented.

[0049] To solve the above technical problems, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:

[0050] Computer-readable instructions are stored on the computer-readable storage medium, and when the computer-readable instructions are executed by a processor, the steps of the reply text generation method described above are implemented.

[0051] The present application provides a method for generating a response text, including: receiving real-time input text sent by a user terminal; performing keyword extraction operation on the real-time input text according to a keyword extraction algorithm to obtain a keyword list; performing an interface update operation on a front-end interface according to a preset front-end interface update strategy and the keyword list to display the keyword list; when performing the keyword extraction operation and the interface update operation, continuously receiving the real-time input text sent by the user terminal to obtain full-scale input text; when the full-scale input text input by the user terminal meets a preset full-scale input condition, performing a semantic encoding operation on the full-scale input text according to a pre-trained deep learning language model to obtain a semantic encoding vector; reading a semantic retrieval library and obtaining knowledge base content corresponding to the semantic encoding vector in the semantic retrieval library; performing a fusion operation on the semantic encoding vector and the knowledge base content to obtain a context semantic vector; inputting the context semantic vector into a generative model to perform a model text generation operation to obtain response text data; and sending the response text data to the user terminal. Compared with the prior art, the present application effectively solves the problems of long response time and poor user experience of traditional digital human interaction systems. At the same time, through a dynamic interruption and continuous listening mechanism, the digital human can interact with the user more naturally. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the solutions in the present application, the following will briefly introduce the drawings required for the description of the embodiments of the present application. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0053] Figure 1 is an exemplary system architecture diagram to which the present application can be applied;

[0054] Figure 2 is a flowchart of the implementation of the response text generation method provided by the embodiment of the present application;

[0055] Figure 3 is a schematic structural diagram of the response text generation device provided by the embodiment of the present application;

[0056] Figure 4 is a schematic structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above drawings are intended to cover non-exclusive inclusion. The terms "first", "second", etc. in the specification and claims of this application or the above drawings are used to distinguish different objects and not to describe a specific order.

[0058] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in connection with the embodiments can be included in at least one embodiment of the application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive of other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0059] To enable those skilled in the art of this technology to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0060] As Figure 1 shown, the system architecture 100 may include a terminal device 101, a network 102, and a server 103. The terminal device 101 may be a laptop computer 1011, a tablet computer 1012, or a mobile phone 1013. The network 102 is a medium for providing a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0061] A user may use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications may be installed on the terminal device 101, such as a web browser application, a shopping application, a search application, an instant messaging tool, an email client, a social platform software, etc.

[0062] The terminal device 101 can be various electronic devices with a display screen and supporting web browsing. In addition to the laptop 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer, a desktop computer, and so on.

[0063] The server 103 can be a server that provides various services, such as a background server that supports the pages displayed on the terminal device 101.

[0064] It should be noted that the response text generation method provided in the embodiments of the present application is generally executed by the server / terminal device. Correspondingly, the response text generation device is generally set in the server / terminal device.

[0065] It should be understood that Figure 1 the numbers of the terminal devices, networks, and servers in

[0066] Continuing to refer to Figure 2 , a flowchart of an embodiment of the response text generation method according to the present application is shown. The response text generation method includes: step S201, step S202, step S203, step S204, step S205, step S206, step S207, step S208, and step S209.

[0067] In step S201, a real-time input text sent by the user terminal is received.

[0068] In the embodiments of the present application, the system can first receive in real time the text information sent by the user through their terminal (such as keyboard input, speech-to-text, etc.). This text information may be the user's question, request, or any form of input.

[0069] In the embodiments of the present application, users input a question or consultation through their terminal devices (such as mobile phones, computers, etc.), and this input is received by the system. This real-time input text is the specific content that users hope the system to answer. Specifically, the real-time input text can be "transaction data or payment data or business data or purchase data" related to financial institutions (such as banks, etc.), and the real-time input text can also be medical data related to medical scenarios. As an example, such as personal health records, prescriptions, inspection reports and other data. It should be understood that the examples of the real-time input text here are only for convenience of understanding and are not used to limit the present application.

[0070] In step S202, keyword extraction operation is performed on the real-time input text according to the keyword extraction algorithm to obtain a keyword list.

[0071] In the embodiments of the present application, the system uses the keyword extraction algorithm to analyze the received real-time input text to identify and extract the keywords therein. These keywords usually represent the main information or key points of the text. Among them, the extracted keywords are organized into a list, that is, the keyword list.

[0072] In step S203, the front-end interface is updated according to the preset front-end interface update strategy and the keyword list to display the keyword list.

[0073] In the embodiments of the present application, the system dynamically updates the front-end interface according to the preset front-end interface update strategy and the extracted keyword list. This update includes displaying the keyword list on the interface, highlighting the keywords, adjusting the interface layout, etc., so that users can more intuitively see the key points of the input text.

[0074] In step S204, when performing keyword extraction operation and interface update operation, the real-time input text sent by the user terminal is continuously received to obtain the full amount of input text.

[0075] In the embodiments of the present application, while performing keyword extraction and interface update, the system still continuously receives the real-time input text sent by the user terminal, and these texts are accumulated to form the full amount of input text.

[0076] In step S205, when the full amount of input text input by the user terminal meets the preset full amount of input conditions, semantic encoding operation is performed on the full amount of input text according to the pre-trained deep learning language model to obtain a semantic encoding vector.

[0077] In the embodiments of the present application, when the full amount of input text meets the preset full amount of input conditions (such as reaching a certain number of words, containing specific keywords, etc.), the system enters the next processing step.

[0078] In step S206, the semantic retrieval library is read, and the knowledge base content corresponding to the semantic encoding vector is obtained in the semantic retrieval library.

[0079] In the embodiment of the present application, the system performs semantic encoding on the full-volume input text by using a pre-trained deep learning language model, and converts it into a semantic encoding vector. This vector represents the semantic information of the input text and is the basis for subsequent processing.

[0080] In step S207, a fusion operation is performed on the semantic encoding vector and the knowledge base content to obtain a context semantic vector.

[0081] In the embodiment of the present application, the system reads the semantic retrieval library, which is a database containing a large amount of knowledge base content. In the semantic retrieval library, the system searches for the knowledge base content that matches or is similar to the semantic encoding vector. Then, the system performs a fusion operation on the semantic encoding vector and the knowledge base content to generate a context semantic vector. This vector contains both the semantic information of the input text and the relevant knowledge base content.

[0082] In step S208, the context semantic vector is input into a generative model for model text generation operation to obtain reply text data.

[0083] In the embodiment of the present application, the context semantic vector is input into a generative model (such as GPT, BERT, etc.) for model text generation operation. The generative model generates reply text data according to the input context semantic vector. This reply text data is a response or answer to the user input text.

[0084] In step S209, the reply text data is sent to the user terminal.

[0085] In the embodiments of the present application, according to the user's real-time input, a natural language processing algorithm is used to perform word segmentation on the input text to obtain a word segmentation result sequence. At the same time, a keyword extraction algorithm is used to identify keywords from the word segmentation results to form a keyword list. For the obtained keyword list, a reasonable front-end interface update strategy is designed. By setting an appropriate update frequency threshold, without affecting the fluency of the user input, the interface is dynamically updated to highlight the identified keywords, enhancing the visual prominence effect of key information. While performing keyword extraction and interface update, the full input of the user is continuously received. When the input text accumulates to a specified length or reaches a specific input interval, the semantic understanding module is triggered, and a pre-trained deep learning language model is used to perform semantic encoding on the full input. The vector representation after semantic encoding is obtained, and by performing similarity matching with a pre-constructed semantic index library, the local knowledge base content related to the current input semantics is retrieved to achieve local semantic matching, providing the necessary background knowledge for subsequent dialogue generation. The knowledge base content retrieved by local semantic matching is fused with the semantic encoding of the full input to generate an extended context semantic vector, which is used as the input of the subsequent deep learning dialogue generation model, and a response text is generated through a generative model such as Seq2Seq.

[0086] In the embodiments of the present application, a method for generating a response text is provided, including: receiving a real-time input text sent by a user terminal; performing a keyword extraction operation on the real-time input text according to a keyword extraction algorithm to obtain a keyword list; performing an interface update operation on the front-end interface according to a preset front-end interface update strategy and the keyword list to display the keyword list; while performing the keyword extraction operation and the interface update operation, continuously receiving the real-time input text sent by the user terminal to obtain a full input text; when the full input text input by the user terminal meets a preset full input condition, performing a semantic encoding operation on the full input text according to a pre-trained deep learning language model to obtain a semantic encoding vector; reading a semantic retrieval library and obtaining the knowledge base content corresponding to the semantic encoding vector in the semantic retrieval library; performing a fusion operation on the semantic encoding vector and the knowledge base content to obtain a context semantic vector; inputting the context semantic vector into a generative model to perform a model text generation operation to obtain response text data; sending the response text data to the user terminal. Compared with the prior art, the present application effectively solves the problems of long response time and poor user experience in traditional digital human interaction systems. At the same time, through a dynamic interruption and continuous listening mechanism, the digital human can interact with the user more naturally.

[0087] In some optional implementation manners of the embodiments of the present application, the step of performing a keyword extraction operation on the real-time input text according to a keyword extraction algorithm to obtain a keyword list specifically includes the following steps:

[0088] Tokenize the real-time input text according to the natural language processing algorithm to obtain a sequence of tokenization results;

[0089] Extract keywords from the sequence of tokenization results according to the keyword extraction algorithm to obtain a list of keywords.

[0090] In the embodiments of the present application, the natural language processing algorithm is used to perform preliminary processing and understanding on the real-time input text.

[0091] In the embodiments of the present application, tokenization is the process of recombining a continuous sequence of characters into a sequence of words according to certain specifications. In Chinese, since there is no obvious space separation between words, tokenization is a basic step in Chinese information processing. Tokenization can be implemented using rule-based methods, statistic-based methods, or deep learning methods. The result of tokenization is a sequence of tokenization results, where each element is a recognized word or phrase.

[0092] In the embodiments of the present application, after the tokenization process obtains the sequence of tokenization results, the system will use the keyword extraction algorithm to analyze this sequence. The algorithm will evaluate the weight or importance of each word and determine which words are keywords based on these weights or importance.

[0093] In the embodiments of the present application, by performing tokenization on the real-time input text according to the natural language processing algorithm and performing keyword extraction on the sequence of tokenization results using the keyword extraction algorithm, the system can obtain a list of keywords that can summarize the theme or main content of the input text.

[0094] In some optional implementation manners of the embodiments of the present application, the step of extracting keywords from the real-time input text according to the keyword extraction algorithm to obtain a list of keywords specifically includes the following steps:

[0095] Perform real-time segmentation on the real-time input text according to the sliding window mechanism to obtain the segmented input text;

[0096] Divide the segmented input text according to the preset window size to obtain input text segments;

[0097] Perform keyword extraction on each input text segment to obtain a list of keywords.

[0098] In the embodiments of the present application, the sliding window mechanism is a commonly used data processing technology that gradually processes data by moving a window of a fixed size on a data sequence. In this process, the sliding window mechanism is used to perform real-time segmentation on the real-time input text.

[0099] In the embodiments of the present application, the real-time segmentation operation refers to that as the user's input text continues, the system can immediately perform segmentation processing on the input text. This segmentation is not a one-time operation, but continuously progresses as the input proceeds, so it is called real-time segmentation.

[0100] In the embodiments of the present application, the preset window size refers to the fixed-size window used by the system when performing the partitioning operation. This window size can be set according to actual needs, and it determines the length of each input text segment.

[0101] In the embodiments of the present application, the partitioning operation refers to partitioning the segmented input text according to the preset window size to obtain a series of input text segments. These input text segments are the basis for subsequent keyword extraction operations.

[0102] In the embodiments of the present application, by performing a real-time segmentation operation on the real-time input text through a sliding window mechanism and partitioning the segmented input text according to the preset window size, the system can obtain a series of input text segments. Then, by performing a keyword extraction operation on each input text segment, the system can obtain a series of keyword lists.

[0103] In some alternative implementation manners of the embodiments of the present application, the step of performing a fusion operation on the semantic encoding vector and the knowledge base content to obtain a context semantic vector specifically includes the following steps:

[0104] Performing a weight adjustment operation on the semantic encoding vector and the knowledge base content according to the attention mechanism to obtain fusion weight data;

[0105] Performing a fusion operation on the semantic encoding vector and the knowledge base content according to the fusion weight data to obtain a context semantic vector.

[0106] In the embodiments of the present application, the attention mechanism mimics the ability of humans to focus on important parts and ignore irrelevant parts when processing information. In this process, the attention mechanism is used to perform weight adjustment on the semantic encoding vector and the knowledge base content to determine their contribution degrees in the fusion operation.

[0107] In the embodiments of the present application, the weight adjustment operation refers to evaluating the semantic encoding vector and the knowledge base content according to the attention mechanism and determining their weights in the fusion operation. These weights reflect the importance of each element in the fusion process.

[0108] In the embodiments of the present application, by performing a weight adjustment operation on the semantic encoding vector and the knowledge base content according to the attention mechanism and performing a fusion operation according to the fusion weight data, the system can obtain a context semantic vector that fuses the semantic information of the input text and the context information of the knowledge base.

[0109] In some alternative implementation manners of the embodiments of the present application, the step of inputting the context semantic vector into the generative model for model text generation operation to obtain the reply text data specifically includes the following steps:

[0110] Distribute the context semantic vector to a plurality of threads for multi-threaded text generation operation to obtain a plurality of multi-threaded reply text data;

[0111] Perform an integration operation on the plurality of multi-threaded reply text data to obtain the reply text data.

[0112] In the embodiments of the present application, in order to improve the speed and efficiency of text generation, the system distributes the context semantic vector to a plurality of threads for parallel processing. These threads can run simultaneously on different processor cores, thereby making full use of the computing power of the multi-core processor.

[0113] In the embodiments of the present application, in each thread, the system uses a text generation algorithm (such as a sequence-to-sequence model based on deep learning, GPT series models, etc.) to generate a reply text according to the context semantic vector. Since the threads run in parallel, multiple reply texts can be generated simultaneously.

[0114] In the embodiments of the present application, the integration operation refers to the process of merging a plurality of multi-threaded reply text data into a unified reply text data. This process can be implemented through various strategies, such as selecting the optimal reply, combining the essence of multiple replies, using weighted average, etc.

[0115] In the embodiments of the present application, after the integration operation, the system will obtain a final reply text data. This data not only contains the semantic information and context information of the input text, but also reflects the diversity and efficiency of multi-threaded text generation.

[0116] In the embodiments of the present application, to ensure that the concurrent execution of local semantic matching and full-volume input processing does not interfere with each other, a reasonable multi-threaded task scheduling mechanism is designed to dynamically allocate computing resources, and an independent data buffer is maintained between the local matching thread and the full-volume input processing thread to ensure data consistency.

[0117] In the embodiments of the present application, by distributing the context semantic vector to a plurality of threads for multi-threaded text generation operation and performing an integration operation on the generated plurality of multi-threaded reply text data, the system can obtain a reply text data that not only contains the semantic information and context information of the input text, but also reflects the diversity and efficiency of multi-threaded generation.

[0118] In some alternative implementation manners of the embodiments of the present application, after the step of sending the reply text data to the user terminal, the following steps are further included:

[0119] Update the dialogue state corresponding to the user terminal according to the reply text data;

[0120] Add the current input-output record to the full input text for generating the context semantic vector of the next round of dialogue.

[0121] In the embodiment of the present application, after the full input processing and dialogue generation are completed, the generated reply text is returned to the user. At the same time, the session state is updated, and the current input-output record is added to the session history for the context information of the next round of dialogue, forming a coherent multi-round interaction.

[0122] In the embodiment of the present application, updating the dialogue state corresponding to the user terminal according to the reply text data and adding the current input-output record to the full input text are very important steps in the dialogue system. They help the system track the progress of the dialogue, understand the user's intention, and provide a basis for generating the context semantic vector of the next round of dialogue.

[0123] The embodiment of the present application can obtain and process relevant data based on artificial intelligence technology. Among them, Artificial Intelligence (AI) is to use a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results of theory, method, technology and application system.

[0124] The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. The artificial intelligence software technology mainly includes several major directions such as computer vision technology, robotics technology, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0125] Those of ordinary skill in the art can understand that all or part of the processes of implementing the above method embodiments can be completed by instructing relevant hardware through computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM), etc.

[0126] It should be understood that although the steps in the flowchart of the accompanying drawings are shown sequentially according to the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear indication in this document, there is no strict order restriction for the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.

[0127] Further reference Figure 3 , as an implementation of the method shown above Figure 2 , an embodiment of a response text generation device is provided in this application. This device embodiment corresponds to Figure 2 the method embodiment shown, and this device can be specifically applied to various electronic devices.

[0128] As Figure 3 shown, the response text generation device 200 in the embodiment of this application includes:

[0129] A real-time input text acquisition module 210, configured to receive the real-time input text sent by the user terminal;

[0130] A keyword extraction module 220, configured to perform keyword extraction operations on the real-time input text according to a keyword extraction algorithm to obtain a keyword list;

[0131] An interface update module 230, configured to perform interface update operations on the front-end interface according to a preset front-end interface update policy and the keyword list to display the keyword list;

[0132] A full-volume input text acquisition module 240, configured to continuously receive the real-time input text sent by the user terminal during the keyword extraction operation and the interface update operation to obtain the full-volume input text;

[0133] A semantic encoding module 250, configured to perform semantic encoding operations on the full-volume input text according to a pre-trained deep learning language model to obtain a semantic encoding vector when the full-volume input text input by the user terminal meets the preset full-volume input conditions;

[0134] A knowledge base content acquisition module 260, configured to read the semantic retrieval library and obtain the knowledge base content corresponding to the semantic encoding vector in the semantic retrieval library;

[0135] A fusion module 270, configured to perform fusion operations on the semantic encoding vector and the knowledge base content to obtain a context semantic vector;

[0136] A text generation module 280, configured to input the context semantic vector into a generative model for model text generation operation to obtain reply text data;

[0137] A text output module 290, configured to send the reply text data to a user terminal.

[0138] In an embodiment of the present application, a reply text generation device 200 is provided, including: a real-time input text acquisition module 210, configured to receive real-time input text sent by a user terminal; a keyword extraction module 220, configured to perform keyword extraction operation on the real-time input text according to a keyword extraction algorithm to obtain a keyword list; an interface update module 230, configured to perform an interface update operation on a front-end interface according to a preset front-end interface update policy and the keyword list to display the keyword list; a full-scale input text acquisition module 240, configured to continuously receive the real-time input text sent by the user terminal during the keyword extraction operation and the interface update operation to obtain full-scale input text; a semantic encoding module 250, configured to perform semantic encoding operation on the full-scale input text according to a pre-trained deep learning language model when the full-scale input text input by the user terminal meets a preset full-scale input condition to obtain a semantic encoding vector; a knowledge base content acquisition module 260, configured to read a semantic retrieval library and obtain knowledge base content corresponding to the semantic encoding vector in the semantic retrieval library; a fusion module 270, configured to perform a fusion operation on the semantic encoding vector and the knowledge base content to obtain a context semantic vector; a text generation module 280, configured to input the context semantic vector into a generative model for model text generation operation to obtain reply text data; a text output module 290, configured to send the reply text data to a user terminal. Compared with the prior art, the present application effectively solves the problems of long response time and poor user experience of traditional digital human interaction systems. At the same time, through a dynamic interruption and continuous listening mechanism, the digital human can interact with the user more naturally.

[0139] In some optional implementation manners of the embodiment of the present application, the above keyword extraction module includes:

[0140] A word segmentation sub-module, configured to perform word segmentation processing on the real-time input text according to a natural language processing algorithm to obtain a word segmentation result sequence;

[0141] A keyword extraction sub-module, configured to perform keyword extraction operation on the word segmentation result sequence according to a keyword extraction algorithm to obtain a keyword list.

[0142] To solve the above technical problems, an embodiment of the present application also provides a computer device. For details, please refer to Figure 4 , Figure 4 which is a basic structural block diagram of the computer device in the embodiment of the present application.

[0143] The computer device 300 includes a memory 310, a processor 320, and a network interface 330 that are communicatively connected to each other via a system bus. It should be noted that only the computer device 300 with components 310 - 330 is shown in the figure, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Among them, those skilled in the art of this technology can understand that a computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field - programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0144] The computer device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The computer device can perform human - machine interaction with users through means such as a keyboard, a mouse, a remote control, a touchpad, or a voice - controlled device.

[0145] The memory 310 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, a hard disk, a multimedia card, a card - type memory (such as an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read - only memory (ROM), an electrically erasable programmable read - only memory (EEPROM), a programmable read - only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 310 can be an internal storage unit of the computer device 300, such as the hard disk or memory of the computer device 300. In other embodiments, the memory 310 can also be an external storage device of the computer device 300, such as a plug - in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the computer device 300. Of course, the memory 310 can also include both the internal storage unit and the external storage device of the computer device 300. In the embodiments of the present application, the memory 310 is generally used to store the operating system installed on the computer device 300 and various application software, such as computer - readable instructions for the response text generation method. In addition, the memory 310 can also be used to temporarily store various types of data that have been output or will be output.

[0146] In some embodiments, the processor 320 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 320 is generally used to control the overall operation of the computer device 300. In the embodiments of the present application, the processor 320 is used to run the computer-readable instructions stored in the memory 310 or process data, such as running the computer-readable instructions of the reply text generation method.

[0147] The network interface 330 may include a wireless network interface or a wired network interface. The network interface 330 is generally used to establish a communication connection between the computer device 300 and other electronic devices.

[0148] The computer device provided by the present application effectively solves the problems of long response time and poor user experience in traditional digital human interaction systems. At the same time, through the dynamic interruption and continuous listening mechanisms, the digital human can interact with the user more naturally.

[0149] The present application also provides another implementation manner, that is, to provide a computer-readable storage medium storing computer-readable instructions that can be executed by at least one processor, so that the at least one processor executes the steps of the reply text generation method as described above.

[0150] The computer-readable storage medium provided by the present application effectively solves the problems of long response time and poor user experience in traditional digital human interaction systems. At the same time, through the dynamic interruption and continuous listening mechanisms, the digital human can interact with the user more naturally.

[0151] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation manner. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc) and includes several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in the various embodiments of the present application.

[0152] Obviously, the embodiments described above are only a part of the embodiments of the present application, rather than all the embodiments. The accompanying drawings show the preferred embodiments of the present application, but do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosed content of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions described in the foregoing specific embodiments, or perform equivalent replacements on some of the technical features. Any equivalent structure made by using the content of the specification and drawings of the present application, directly or indirectly applied in other related technical fields, is similarly within the scope of patent protection of the present application.

Claims

1. A method for generating a reply text, characterized in that: The steps include: Receiving real-time input text sent by a user terminal; Performing a keyword extraction operation on the real-time input text according to a keyword extraction algorithm to obtain a keyword list; Performing an interface update operation on the front-end interface according to a preset front-end interface update strategy and the keyword list to display the keyword list; When performing the keyword extraction operation and the interface update operation, continuously receiving the real-time input text sent by the user terminal to obtain the full input text; When the full input text input by the user terminal meets the preset full input condition, a semantic encoding operation is performed on the full input text according to a pre-trained deep learning language model to obtain a semantic encoding vector; Reading a semantic retrieval library, and acquiring knowledge base content corresponding to the semantic encoding vector in the semantic retrieval library; Performing a fusion operation on the semantic encoding vector and the knowledge base content to obtain a context semantic vector; Inputting the context semantic vector into a generative model to perform a model text generation operation to obtain reply text data; The reply text data is sent to the user terminal.

2. The method for generating a reply text according to claim 1, characterized in that: The step of performing a keyword extraction operation on the real-time input text according to a keyword extraction algorithm to obtain a keyword list specifically includes the following steps: Performing word segmentation processing on the real-time input text according to a natural language processing algorithm to obtain a word segmentation result sequence; A keyword extraction operation is performed on the word segmentation result sequence according to a keyword extraction algorithm to obtain the keyword list.

3. The reply text generation method according to claim 1, characterized in that: The step of performing a keyword extraction operation on the real-time input text according to a keyword extraction algorithm to obtain a keyword list specifically includes the following steps: Performing a real-time segmentation operation on the real-time input text according to a sliding window mechanism to obtain a segmented input text; The segmented input text is divided according to a preset window size to obtain input text segments; A keyword extraction operation is performed on each of the input text segments to obtain the keyword list.

4. The method for generating a reply text according to claim 1, characterized in that: The step of fusing the semantic coding vector and the knowledge base content to obtain a context semantic vector specifically includes the following steps: Performing a weight adjustment operation on the semantic encoding vector and the knowledge base content according to the attention mechanism to obtain fusion weight data; The semantic encoding vector and the knowledge base content are fused according to the fusion weight data to obtain the context semantic vector.

5. The reply text generation method according to claim 1, characterized in that: The step of inputting the context semantic vector into the generative model to perform a model text generation operation to obtain reply text data specifically includes the following steps: Distributing the context semantic vector to a plurality of threads to perform a multi-thread text generation operation, and obtaining a plurality of multi-thread reply text data; An integration operation is performed on the plurality of multi-threaded reply text data to obtain the reply text data.

6. The reply text generation method according to claim 1, characterized in that: After the step of sending the reply text data to the user terminal, the method further includes the following steps: Updating the dialog state corresponding to the user terminal according to the reply text data; The current input and output records are added to the full input text for generating a context semantic vector for the next round of dialogue.

7. A reply text generating device, characterized in that: include: A real-time input text acquisition module is used to receive the real-time input text sent by the user terminal; A keyword extraction module, used to perform a keyword extraction operation on the real-time input text according to a keyword extraction algorithm to obtain a keyword list; An interface update module, used to perform an interface update operation on the front-end interface according to a preset front-end interface update strategy and the keyword list to display the keyword list; A full input text acquisition module, used to continuously receive the real-time input text sent by the user terminal to obtain the full input text when performing the keyword extraction operation and the interface update operation; A semantic encoding module, configured to perform a semantic encoding operation on the full input text according to a pre-trained deep learning language model to obtain a semantic encoding vector when the full input text input by the user terminal meets a preset full input condition; A knowledge base content acquisition module, used for reading a semantic search library and acquiring knowledge base content corresponding to the semantic encoding vector in the semantic search library; A fusion module, used for fusing the semantic coding vector and the knowledge base content to obtain a context semantic vector; A text generation module, used for inputting the context semantic vector into a generative model to perform a model text generation operation to obtain reply text data; A text output module is used to send the reply text data to the user terminal.

8. The reply text generating device according to claim 7, characterized in that: The keyword extraction module includes: A word segmentation submodule, used to perform word segmentation processing on the real-time input text according to a natural language processing algorithm to obtain a word segmentation result sequence; The keyword extraction submodule is used to perform a keyword extraction operation on the word segmentation result sequence according to a keyword extraction algorithm to obtain the keyword list.

9. A computer device comprising a memory and a processor, characterized in that: The memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the reply text generation method as described in any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the reply text generation method as described in any one of claims 1 to 6.

Citation Information

Cited By

  • Network multi-source financial text big data processing method

    CN120578767A