Speech dialogue method and system, electronic device, and storage medium
By using radix trees and GPT models for prediction in the voice dialogue system, pre-execution is achieved when the user has not fully expressed the voice request, solving the problem of slow response speed of the existing system and improving the response speed of the dialogue system and user experience.
Patent Information
- Application Number
- PCT/CN2024/138671
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-25
- Filing Date
- 2024-12-12
- Publication Date
- 2025-10-02
AI Technical Summary
The existing voice dialogue system has a slow response speed and cannot achieve leapfrog latency optimization and super-fast response experience.
By generating streaming recognition results based on part of the voice audio stream when the user has not fully expressed the voice request, and using the radix tree and GPT model for prediction, the pre-request response results are obtained and cached until the user's voice request is complete, achieving pre-execution and fast response.
It significantly improves the response speed and user experience of the intelligent dialogue system, enhances the efficiency and accuracy of dialogue management, and provides a fast interactive experience.
Smart Images

Figure CN2024138671_02102025_PF_FP_ABST
Abstract
Description
Voice dialogue method, system, electronic device and storage medium
[0001] This application claims priority to Chinese patent application No. 202410346854.9 filed on March 25, 2024, with the invention name “A voice conversation method, system, electronic device and storage medium”. The entire contents of the above Chinese patent application are incorporated into this application by reference. Technical Field
[0002] The present application relates to the field of speech recognition technology, and in particular to a speech dialogue method, system, electronic device and storage medium. Background Art
[0003] Automatic speech recognition (ASR) is a technology that converts speech into text. Streaming ASR, also known as real-time speech recognition, converts speech audio into text in real time. Existing voice dialogue systems implement a conversational process that first uses streaming ASR to obtain streaming recognition results (i.e., speech-to-text) of the user's input speech. Then, based on this text, the subsequent conversational process generates a conversational response. The entire conversational process is executed serially, and the overall latency of the voice dialogue system is equal to the sum of the time consumed by each module along the process. As we all know, voice dialogue systems have very high response speed requirements, and response latency along the process directly affects the user experience. Conventional latency optimization solutions for each module along the process have generally reached their limits, failing to achieve significant latency reduction and a super-fast response experience. Therefore, a new, more efficient response acceleration solution for voice dialogue systems is needed to optimize the entire conversational process and improve user experience and satisfaction. Summary of the Invention
[0004] In response to the defects of the existing technology, the voice dialogue method proposed in this application is a new and more efficient response acceleration solution for the voice dialogue system, which can solve the problem of further improving the response speed of the voice dialogue system.
[0005] In a first aspect, the present application provides a voice dialogue method applicable to a voice dialogue system that generates a conversation response result according to a user voice request, characterized in that the method comprises:
[0006] In response to a voice audio stream of a first preset duration, generating a first streaming recognition result; obtaining a prediction result of a user voice request based on the first streaming recognition result; obtaining a pre-request response result based on the prediction result and caching the result;
[0007] In response to the voice audio stream of the second preset duration, obtaining the cached pre-request response result as the session response result;
[0008] The voice audio stream of the first preset duration corresponds to the incomplete user voice request, and the voice audio stream of the second preset duration corresponds to the complete user voice request.
[0009] Furthermore, the above method also includes: when the voice audio stream is acquired, determining the voice audio stream of the first preset duration and the voice audio stream of the second preset duration through voice endpoint detection.
[0010] In some implementation schemes, the prediction result of the user voice request obtained based on the first stream recognition result is specifically:
[0011] Obtaining a radix tree constructed based on historical high-frequency request sentences, searching the radix tree to obtain candidate results based on the first streaming recognition result, and obtaining a prediction result of the user voice request based on the candidate results;
[0012] Or specifically: input the first streaming recognition result into the GPT model to generate candidate results, and obtain the prediction result of the user voice request based on the candidate results.
[0013] In some implementation schemes, the above-mentioned searching for candidate results from the radix tree according to the first stream recognition result, and obtaining a prediction result of the user voice request based on the candidate results are specifically:
[0014] searching for candidate results from the radix tree according to the first stream recognition result;
[0015] If a candidate result is found, a prediction result of the user's voice request is obtained based on the candidate result;
[0016] If no candidate results are found, the first streaming recognition results are input into the GPT model to generate candidate results, and a prediction result of the user voice request is obtained based on the candidate results.
[0017] In some embodiments, the candidate results include multiple candidate text sequences and weight values corresponding to each candidate text sequence; the text content of the candidate text sequence includes the first stream recognition result;
[0018] The step of obtaining a prediction result of the user voice request based on the candidate results specifically comprises: sorting the plurality of candidate text sequences based on the weight values corresponding to the respective candidate text sequences, and selecting a prediction result from the plurality of candidate text sequences based on the sorting result;
[0019] Or specifically: obtaining a user personalized weighting strategy, adjusting the weight value of each candidate text sequence based on the user personalized weighting strategy, sorting multiple candidate text sequences based on the adjusted weight value, and selecting a prediction result from the multiple candidate text sequences based on the sorting result.
[0020] In some implementation schemes, obtaining and caching the pre-request response result based on the prediction result specifically includes:
[0021] A confidence assessment is performed on the prediction result, and it is determined whether to initiate a pre-request based on the prediction result according to the confidence assessment result. If yes, a pre-request response result is obtained and cached by initiating a pre-request; otherwise, a pre-request response result is not obtained.
[0022] In some embodiments, the step of obtaining the cached pre-request response result as the session response result includes:
[0023] Determine whether there is a pre-request response result in the cache;
[0024] If the judgment is yes, the cached pre-request response result is obtained as the session response result; otherwise, a second streaming recognition result is generated based on the voice audio stream of the second preset duration, and a session response result is obtained based on the second streaming recognition result.
[0025] In a second aspect, the present application provides a voice dialogue system, comprising a voice recognition module, a prediction module, a pre-request module, and a response module;
[0026] The speech recognition module is configured to generate a first stream recognition result in response to a speech audio stream of a first preset duration;
[0027] The prediction module is configured to obtain a prediction result of the user voice request based on the first streaming recognition result;
[0028] The pre-request module is used to obtain and cache a pre-request response result based on the prediction result;
[0029] The response module is configured to obtain the cached pre-request response result as a session response result in response to the voice audio stream of the second preset duration.
[0030] In a third aspect, the present application provides an electronic device comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program, and the computer program is executed by the at least one processor to implement the voice conversation method described in any one of the technical solutions of the above-mentioned voice conversation method.
[0031] In a fourth aspect, the present application provides a computer-readable storage medium storing a plurality of program codes, wherein the program codes are suitable for being loaded and run by a processor to execute the voice conversation method described in any one of the technical solutions of the above-mentioned voice conversation method.
[0032] The above one or more technical solutions of this application have at least one or more of the following beneficial effects:
[0033] In the technical solution for implementing the present application, a voice dialogue method applicable to a voice dialogue system includes: generating a first streaming recognition result in response to a voice audio stream of a first preset duration; obtaining a prediction result of a user voice request based on the first streaming recognition result, obtaining a pre-request response result based on the prediction result and caching it; and obtaining the cached pre-request response result as a session response result in response to a voice audio stream of a second preset duration. The voice audio stream of the first preset duration corresponds to an incomplete user voice request, and the voice audio stream of the second preset duration corresponds to a complete user voice request. This method obtains a prediction result of a complete user voice request based on a partial voice audio stream, and obtains a pre-request response result based on the prediction result, thereby achieving pre-execution when the user voice request has not been fully expressed, thereby significantly improving the response speed and user experience of the intelligent dialogue system. This application overcomes the problem of slow response speed of the intelligent dialogue system, realizes a more efficient and intelligent dialogue system, significantly improves the efficiency and accuracy of dialogue management, and brings a fast interactive experience to users. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The disclosure of this application will be more easily understood with reference to the accompanying drawings. Those skilled in the art will readily appreciate that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this application. Furthermore, similar numbers in the figures represent similar components, where:
[0035] FIG1 is a schematic diagram of the working principle of a voice dialogue system according to an embodiment of the present application;
[0036] FIG2 is a flow chart showing the main steps of a voice dialogue method according to an embodiment of the present application;
[0037] FIG3 is a flowchart of a specific implementation of obtaining a prediction result of a user voice request based on a candidate result according to an embodiment of the present application;
[0038] FIG4 is a schematic diagram of an exemplary implementation method of obtaining a prediction result of a user voice request based on the first stream recognition result;
[0039] FIG5 is a schematic block diagram of a voice dialogue system according to an embodiment of the present application. DETAILED DESCRIPTION
[0040] Some embodiments of the present application are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application and are not intended to limit the scope of protection of the present application.
[0041] In the description of this application, "module" and "processor" may include hardware, software, or a combination of both. A module may include hardware circuitry, various suitable sensors, communication ports, and memory. It may also include software components, such as program code, or a combination of software and hardware. A processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. A processor has data and / or signal processing capabilities. A processor may be implemented in software, hardware, or a combination of both. Non-transitory computer-readable storage media include any suitable medium capable of storing program code, such as magnetic disks, hard disks, optical disks, flash memory, read-only memory, random access memory, etc. The term "A and / or B" refers to all possible combinations of A and B, such as only A, only B, or both A and B. The terms "at least one of A or B" or "at least one of A and B" have similar meanings to "A and / or B" and may include only A, only B, or both A and B. The singular forms "a" and "the" may also include the plural forms.
[0042] The voice dialogue method provided in the embodiments of the present application is implemented by a voice dialogue system (e.g., an in-vehicle voice interaction system), which can be an electronic entity or an application integrated with software. The electronic entity includes, but is not limited to, a smartphone, a tablet computer, an in-vehicle device, and a computer.
[0043] The following describes specific embodiments of the present application in conjunction with the drawings in the specification. It should be understood that the specific embodiments described herein are only used to illustrate and explain the present application and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application can be combined with each other if there is no conflict.
[0044] The voice dialogue system of the embodiment of the present application is used to generate a conversation response result based on a user's voice request. Its working principle is shown in Figure 1. The dialogue process chain includes automatic speech recognition (ASR), natural language understanding (NLU), dialogue management (DM), natural language generation (NLG), and text-to-speech (TTS), among which:
[0045] Automatic speech recognition (ASR) is responsible for pre-processing the user's voice signal. Through key tasks such as preprocessing and decoding the user's voice information, it ultimately obtains the text content corresponding to the voice signal.
[0046] Natural Language Understanding (NLU) performs semantic understanding of the text input by the user after completing the recognition of the voice content in order to enable the system to successfully execute the user's intention.
[0047] After natural language understanding analyzes and processes the speech recognition text, a dialogue management system (DM) is needed to identify the user's intent and determine what they want to do. It also tracks the conversation state and determines the next action or response method. This process includes selecting appropriate strategies based on user input, controlling the multi-round conversation flow, and resolving ambiguities. The DM system operates based on a predefined dialogue model, which defines the conversation flow, state, and strategy. During the dialogue management process, the system uses this model to process user requests.
[0048] Natural language generation (NLG) extracts information from relevant knowledge bases or corpora according to the instructions of the dialogue management system, and converts structured data into natural, logically coherent text based on context and context information, answering user questions, providing suggestions or performing tasks in human language. The process of generating natural language generally includes: syntactic analysis, semantic analysis, grammatical analysis, information extraction, and text output.
[0049] From text to speech TTS (Text To Speech), after analyzing and processing the user's voice information through speech recognition, natural language understanding, dialogue management, and natural language generation, if you finally want the machine to communicate with people, you need to convert the natural language text into speech and output it to the user through an output device.
[0050] Based on the voice dialogue system shown in Figure 1, the existing dialogue process is as follows: when the user completes the user voice request, the complete recognition text can be obtained. The complete recognition text is then input into the dialogue management system. The system will complete the natural language understanding, dialogue management, natural language generation and other processes, and finally obtain a text-to-speech feedback, namely TTS, to complete the entire voice dialogue interaction process. The entire link is executed serially, and the response delay on the link will directly affect the user's actual experience. Conventional delay optimization solutions for each module on the link have mostly reached their limits and cannot achieve leapfrog delay optimization and super-fast response experience. The dialogue process of this application is as follows: when the user has not completed the complete user voice request, the recognition result of the voice audio stream corresponding to the partial voice request is obtained, and the prediction result of the user voice request is obtained based on the recognition result. The prediction result is then input into the dialogue management system to obtain a pre-request response result. When the user completes the complete user voice request, the pre-request response result can be directly obtained as TTS, completing the entire voice dialogue interaction process. This application realizes the pre-acquisition of TTS through text prediction and pre-execution when the user has not fully expressed the voice request, thereby greatly improving the response speed of the dialogue system and user experience, solving the bottleneck of traditional dialogue processes in real-time processing of user voice requests, overcoming the problem of slow response speed of intelligent dialogue systems, and realizing a more efficient and intelligent dialogue process.
[0051] Specifically as shown in Figure 2, a voice dialogue method provided by an embodiment of the present application mainly includes the following steps S11 and S12, wherein the voice audio stream of the first preset duration corresponds to an incomplete user voice request, and the voice audio stream of the second preset duration corresponds to a complete user voice request. It should be understood that the voice dialogue system generally performs VAD (Voice Activity Detection) detection before obtaining the voice audio stream for voice recognition. The VAD detection can be used to determine the starting point position and the ending point position of the user voice request corresponding to the voice audio stream, that is, by detecting the voice audio stream, it can be determined whether the complete user voice request is obtained. Specifically in this embodiment, when the voice audio stream of the second preset duration is detected, it indicates that the complete user voice request is obtained, and when the voice audio stream of the first preset duration is detected, it indicates that a partial user voice request is obtained. The first preset duration is less than the second preset duration.
[0052] Step S11: generating a first stream recognition result in response to a voice audio stream of a first preset duration; obtaining a prediction result of a user voice request based on the first stream recognition result; obtaining a pre-request response result based on the prediction result and caching the result;
[0053] In this embodiment, a speech audio stream of a first preset duration is determined through VAD detection. In response to the speech audio stream of the first preset duration, speech recognition can be performed on the speech audio stream using an existing ASR algorithm model to generate a first stream recognition result. Based on the first stream recognition result, text prediction and pre-execution are then performed using a behavior prediction approach. Specifically, a pre-request response result is obtained and cached based on the prediction result, thereby significantly improving the interactive speed of the dialogue system.
[0054] In a specific implementation, a weighted prefix search method with a very large data scale can be used to generate predicted candidate results, and then the predicted results are selected from the candidate results. Specifically, the predicted result of the user voice request obtained based on the first streaming recognition result is specifically as follows: obtaining a radix tree constructed based on historical high-frequency request sentences, searching the radix tree to obtain candidate results according to the first streaming recognition result, and obtaining the predicted result of the user voice request based on the candidate results. It should be understood that a radix tree is generally used to efficiently store and search a set of strings. It splits a string into individual characters according to a prefix, and stores each character as a node in the tree. In layman's terms, when multiple strings, i.e., keywords, have the same prefix, the strings with the same prefix are merged into a shared node to reduce storage space, and weighted values are assigned to each node according to the frequency of string association.
[0055] In order to ensure that the search results are in line with the user's real habits, we use the first 500,000 historical high-frequency request sentences (i.e., text content with a high historical frequency) to construct a radix tree (also called radix trie or compressed prefix tree) as a search tree for search. The radix tree is a data structure, a more space-saving Trie (prefix tree), in which each node that is the only child node is merged with its parent node. In order to further improve the search efficiency, we introduced the WPRT (Wighted Pruning Radix Trie) algorithm, which records the weight parameters (sum_weight and max_weight) of each node and dynamically prunes the nodes according to the weight of the nodes during the search process, that is, dynamically selects and retains the node branches where the high-frequency sentences are located and discards other node branches according to the changes in the weight parameters of each node, thereby reducing the time and space complexity of the search. In the performance test, we found that using the radix tree constructed by this application and the above-mentioned search method, the response time (such as TP95) for searching for candidate results when the first-stream recognition result is empty and three words is 5.15ms and 0.13ms respectively, which has excellent performance.
[0056] In a specific embodiment, a deep autoregressive neural network language model (GPT) can be used to generate candidate prediction results, and then the prediction results are selected from the candidate results. The GPT (Generative Pre-Training) model was proposed by OpenAI in 2018. GPT adopts a pre-training and fine-tuning training method. It first uses a large-scale corpus for pre-training, and then fine-tunes according to the specific generation task, which has a good text generation effect. GPT-2 is an upgraded version of GPT proposed by OpenAI in 2019. Using the GPT-2 model, taking advantage of its powerful model generalization ability, and using a large-scale dialogue data set for training, the text generation effect of the model can be improved. Therefore, the pre-trained GPT model can generate corresponding predicted text according to the text sequence of the input model. Specifically in this embodiment, the prediction result of the user voice request based on the first streaming recognition result is specifically: the first streaming recognition result is input into the GPT model to generate a candidate result, and the prediction result of the user voice request is obtained based on the candidate result. For example, when generating candidate results, we can use the industry's pre-trained GPT-2 model and employ beam search with restricted decoding to control the prediction range and speed. Furthermore, to ensure the accuracy and reliability of the generated candidate results, we can also design a pornography detection module to filter out objectionable information. In implementation, we can also employ techniques such as pre-training with equal-length data streams and multi-task learning to make the model's predictions even more accurate and reliable.
[0057] In a specific implementation, it is also possible to simultaneously combine a weighted prefix search method and a GPT model generation method to obtain predicted candidate results, and then select a predicted result from the candidate results. Specifically: the specific implementation of searching from the radix tree to obtain candidate results based on the first streaming recognition result and obtaining a predicted result of the user voice request based on the candidate results is shown in Figure 3, and specifically includes the following steps S21 to S24.
[0058] Step S21: Obtain a radix tree constructed based on historical high-frequency request statements;
[0059] Step S22: searching for candidate results from the radix tree according to the first stream recognition result;
[0060] If a candidate result is found, step S23 is executed; if no candidate result is found, step S24 is executed;
[0061] Step S23: obtaining a prediction result of the user's voice request based on the candidate results;
[0062] Step S24: Input the first streaming recognition result into the GPT model to generate candidate results, and obtain a prediction result of the user voice request based on the candidate results.
[0063] It is understood that in the above specific implementation method, the candidate results include multiple candidate text sequences and weight values corresponding to each candidate text sequence; the text content of the candidate text sequence includes the first streaming recognition result. For example, the first streaming recognition result is "play", and the text content of one candidate text sequence is "play song".
[0064] In this embodiment, the prediction result of the user voice request obtained based on the candidate results can be specifically as follows: sorting multiple candidate text sequences based on the weight values corresponding to each candidate text sequence, selecting a prediction result from the multiple candidate text sequences based on the sorting results, for example, sorting multiple candidate text sequences from large to small according to the weight values, and selecting at least one candidate text sequence in the sorting results as the prediction result.
[0065] To further improve prediction accuracy and user experience, candidate results can be re-ranked using a personalized weighting strategy, that is, combining historical high-frequency request sentences and user-personalized language to predict more accurate candidate results. Accordingly, obtaining a prediction result of the user's voice request based on the candidate results can be specifically performed by: obtaining a user-personalized weighting strategy, adjusting the weight values of each candidate text sequence based on the user-personalized weighting strategy, sorting multiple candidate text sequences based on the adjusted weight values, and selecting a prediction result from the multiple candidate text sequences based on the sorting results. For example, a user-personalized weighting strategy can be a strategy that adjusts the weights of certain text sequences based on user language habits. For example, the original weight value of a candidate text sequence is 0.5. After adjustment based on the user-personalized weighting strategy, the weight value of the candidate text sequence becomes 0.8, and its ranking position in multiple candidate text sequences is adjusted from 3rd to 1st. Furthermore, in implementation, the efficiency of prediction can be further improved by adopting technical means such as inverted indexing and candidate set reduction.
[0066] In this embodiment, the obtaining of the pre-request response result based on the prediction result and caching can be specifically as follows: performing a confidence assessment on the prediction result, judging whether to initiate a pre-request based on the prediction result according to the confidence assessment result, and if so, obtaining the pre-request response result by initiating a pre-request and caching it, otherwise failing to obtain the pre-request response result. For example, if the confidence assessment result reaches a preset threshold, a pre-request is initiated, otherwise no pre-request is initiated. Furthermore, before initiating the pre-request, a step of displaying the prediction result or the confidence assessment result to the user through a screen may be included. It should be understood that initiating a pre-request refers to inputting the prediction result into the dialogue management system to execute subsequent natural language understanding, dialogue management, natural language generation and other processes, and then outputting a text-to-speech TTS as a pre-request response result.
[0067] Among them, one implementation method of performing confidence assessment on the prediction result is: performing confidence assessment based on the weight value corresponding to the prediction result, the larger the weight value, the higher the confidence, and judging whether to initiate a pre-request based on the prediction result based on the confidence assessment result can be: judging whether the weight value reaches a preset threshold, if so, initiating a pre-request based on the prediction result, otherwise not initiating a pre-request, that is, failing to obtain the pre-request response result and caching it.
[0068] Step S12: In response to the voice audio stream of the second preset duration, the cached pre-request response result is obtained as the session response result.
[0069] In this embodiment, a voice audio stream of a second preset duration is determined through VAD detection, and in response to the voice audio stream of the second preset duration, it is determined whether a pre-request response result is cached; if it is determined to be, the cached pre-request response result is obtained as the session response result; otherwise, a second streaming recognition result is generated based on the voice audio stream of the second preset duration, and a request is initiated based on the second streaming recognition result to obtain a session response result. It should be understood that initiating a request based on the second streaming recognition result to obtain a session response result means inputting the second streaming recognition result, i.e., the complete user voice request, into the dialogue management system to execute subsequent natural language understanding, dialogue management, natural language generation and other processes, and then outputting a text-to-speech TTS as the session response result of the user voice request.
[0070] In order to better understand the key contents of the embodiments of the present application, as shown in Figure 4, there is a schematic diagram of a specific implementation method of obtaining a prediction result of a user voice request based on the first streaming recognition result in the embodiment of the present application. Taking the first streaming recognition result as the word "play" as an example, first, based on the radix tree constructed using historical high-frequency request statements, the candidate results are searched through the WRPT algorithm. For example, the searched candidate results are the first candidate set shown in the figure, which contains multiple candidate text sequences and their weight values. If no candidate results are found through the WRPT algorithm, candidate results can be generated based on the GPT model. For example, the generated candidate results are the second candidate set shown in the figure, which contains multiple candidate text sequences and their weight values. Then, the weight values of the candidate texts in the first candidate set or the second candidate set are adjusted in combination with the user personalized weighting strategy, the candidate texts after the adjusted weights are rearranged (Reranker), and finally the prediction results are selected from the rearranged candidate texts.
[0071] Furthermore, the present application also provides a voice dialogue system.
[0072] 5 , which is a block diagram of the main structure of a voice dialogue system according to an embodiment of the present application, the system mainly includes: a voice recognition module 401 , a prediction module 402 , a pre-request module 403 and a response module 404 ;
[0073] The speech recognition module 401 is configured to generate a first stream recognition result in response to a speech audio stream of a first preset duration;
[0074] The prediction module 402 is configured to obtain a prediction result of the user voice request based on the first streaming recognition result;
[0075] The pre-request module 403 is configured to obtain and cache a pre-request response result based on the prediction result;
[0076] The response module 404 is configured to obtain the cached pre-request response result as a session response result in response to the voice audio stream of the second preset duration.
[0077] For ease of explanation, the introduction to the above voice dialogue system only shows the part related to the embodiment of the present application. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application.
[0078] It should be understood that since the configuration of each module is merely for the purpose of illustrating the functional units of this application, the physical devices corresponding to these modules may be the processor itself, or a portion of the software in the processor, a portion of the hardware, or a combination of software and hardware. Therefore, the number of modules in the figure is merely illustrative.
[0079] Those skilled in the art will appreciate that the various modules in the system can be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principles of this application. Therefore, the technical solutions after splitting or merging will fall within the scope of protection of this application.
[0080] It will be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment of the present application can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium can include: any entity or device, medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0081] Furthermore, the present application also provides an electronic device.
[0082] In an embodiment of an electronic device according to the present application, the electronic device primarily includes a processor and a storage device. The storage device may be configured to store a program for executing the voice conversation method of the above-described method embodiment, and the processor may be configured to execute the program in the storage device, including but not limited to a program for executing the voice conversation method of the above-described method embodiment. For ease of illustration, only the portions relevant to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method section of the embodiment of the present application.
[0083] In the embodiment of the present application, the electronic device may be a control device device formed by various electronic devices. In some possible implementations, the electronic device may include multiple storage devices and multiple processors. The program for executing the voice dialogue method of the above method embodiment can be divided into multiple subroutines, and each subroutine can be loaded and run by the processor to execute different steps of the voice dialogue method of the above method embodiment. Specifically, each subroutine can be stored in different storage devices respectively, and each processor can be configured to execute the program in one or more storage devices to jointly implement the voice dialogue method of the above method embodiment, that is, each processor executes different steps of the voice dialogue method of the above method embodiment respectively to jointly implement the voice dialogue method of the above method embodiment.
[0084] The aforementioned multiple processors may be processors deployed on the same device. For example, the aforementioned electronic device may be a high-performance device composed of multiple processors, and the aforementioned multiple processors may be processors configured on the high-performance device. Furthermore, the aforementioned multiple processors may also be processors deployed on different devices. For example, the aforementioned electronic device may be a server cluster, and the aforementioned multiple processors may be processors on different servers in the server cluster.
[0085] Furthermore, the present application also provides a computer-readable storage medium.
[0086] In one embodiment of a computer-readable storage medium according to the present application, the computer-readable storage medium can be configured to store a program for executing the voice conversation method of the above-described method embodiment. The program can be loaded and executed by a processor to implement the above-described voice conversation method. For ease of explanation, only the portion related to the embodiment of the present application is shown. For specific technical details not disclosed, please refer to the method section of the embodiment of the present application. The computer-readable storage medium can be a storage device formed by various electronic devices. In the embodiment of the present application, the computer-readable storage medium is a non-transitory computer-readable storage medium.
[0087] The relevant user personal information that may be involved in the various embodiments of this application is strictly in accordance with the requirements of laws and regulations, following the principles of legality, legitimacy and necessity, and based on the reasonable purposes of business scenarios, to process the personal information that users actively provide during the use of products / services or generated due to the use of products / services, as well as the personal information obtained with the user's authorization.
[0088] The user personal information processed in this application will vary depending on the specific product / service scenario and will be based on the specific scenario in which the user uses the product / service. This may involve the user's account information, device information, driving information, vehicle information, or other related information. The applicant will treat the user's personal information and its processing with a high degree of diligence.
[0089] This application attaches great importance to the security of user personal information and has taken reasonable and feasible security protection measures that comply with industry standards to protect user information and prevent personal information from being accessed, disclosed, used, modified, damaged or lost without authorization.
[0090] Thus far, the technical solutions of the present application have been described in conjunction with the specific embodiments shown in the accompanying drawings. However, it is readily understood by those skilled in the art that the scope of protection of the present application is obviously not limited to these specific embodiments. Without departing from the principles of the present application, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will fall within the scope of protection of the present application.
Claims
1. A voice dialogue method, applicable to a voice dialogue system that generates a conversation response result according to a user's voice request, characterized in that: The method comprises: In response to a voice audio stream of a first preset duration, generating a first streaming recognition result; obtaining a prediction result of a user voice request based on the first streaming recognition result; obtaining a pre-request response result based on the prediction result and caching the result; In response to the voice audio stream of the second preset duration, obtaining the cached pre-request response result as the session response result; The voice audio stream of the first preset duration corresponds to the incomplete user voice request, and the voice audio stream of the second preset duration corresponds to the complete user voice request.
2. The voice dialogue method according to claim 1, wherein: The method further includes: when the voice audio stream is acquired, determining a voice audio stream of a first preset duration and a voice audio stream of a second preset duration through voice endpoint detection.
3. The voice dialogue method according to claim 1, wherein: The prediction result of the user voice request obtained based on the first streaming recognition result is specifically: Obtaining a radix tree constructed based on historical high-frequency request sentences, searching the radix tree to obtain candidate results based on the first streaming recognition result, and obtaining a prediction result of the user voice request based on the candidate results; Or specifically: input the first streaming recognition result into the GPT model to generate candidate results, and obtain the prediction result of the user voice request based on the candidate results.
4. The voice dialogue method according to claim 3, wherein: The step of searching the radix tree to obtain candidate results according to the first stream recognition result, and obtaining a prediction result of the user voice request based on the candidate results is specifically as follows: searching for candidate results from the radix tree according to the first stream recognition result; If a candidate result is found, a prediction result of the user's voice request is obtained based on the candidate result; If no candidate results are found, the first streaming recognition results are input into the GPT model to generate candidate results, and a prediction result of the user voice request is obtained based on the candidate results.
5. The voice dialogue method according to claim 3, wherein: The candidate results include multiple candidate text sequences and weight values corresponding to each candidate text sequence; the text content of the candidate text sequence includes the first stream recognition result; The step of obtaining a prediction result of the user voice request based on the candidate results specifically comprises: sorting the plurality of candidate text sequences based on the weight values corresponding to the respective candidate text sequences, and selecting a prediction result from the plurality of candidate text sequences based on the sorting result; Or specifically: obtaining a user personalized weighting strategy, adjusting the weight value of each candidate text sequence based on the user personalized weighting strategy, sorting multiple candidate text sequences based on the adjusted weight value, and selecting a prediction result from the multiple candidate text sequences based on the sorting result.
6. The voice dialogue method according to claim 1, wherein: The obtaining and caching of the pre-request response result based on the prediction result is specifically as follows: A confidence assessment is performed on the prediction result, and it is determined whether to initiate a pre-request based on the prediction result according to the confidence assessment result. If yes, a pre-request response result is obtained and cached by initiating a pre-request; otherwise, a pre-request response result is not obtained.
7. The voice dialogue method according to claim 6, characterized in that: The step of obtaining the cached pre-request response result as the session response result includes: Determine whether there is a pre-request response result in the cache; If the judgment is yes, the cached pre-request response result is obtained as the session response result; otherwise, a second streaming recognition result is generated based on the voice audio stream of the second preset duration, and a session response result is obtained based on the second streaming recognition result.
8. A voice dialogue system, characterized in that: It includes speech recognition module, prediction module, pre-request module and response module; The speech recognition module is configured to generate a first stream recognition result in response to a speech audio stream of a first preset duration; The prediction module is configured to obtain a prediction result of the user voice request based on the first streaming recognition result; The pre-request module is used to obtain and cache a pre-request response result based on the prediction result; The response module is configured to obtain the cached pre-request response result as a session response result in response to the voice audio stream of the second preset duration.
9. An electronic device comprising a processor and a storage device, wherein the storage device is adapted to store a plurality of program codes, wherein: The program code is suitable for being loaded and run by the processor to execute the voice dialogue method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and run by a processor to execute the voice dialogue method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Flow type voice recognition method, device and equipment and storage medium
CN110111775A
Voice interaction method and device, electronic equipment and storage medium
CN114078478A
Voice interaction method, electronic equipment and storage medium
CN114822532A
Voice interaction method, model training method, electronic equipment and storage medium
CN114822533A
Voice conversation interaction method and system, electronic equipment and storage medium
CN116153310A
Cited By
Multi-modal evidence chain management and control method and device, computer equipment and medium
CN121188059A
Voice interaction method and device, storage medium and electronic device
CN121708912A
Machine-learning-based networking graphical user interface
US20250232758A1