Method, device and storage medium for improving response speed of voice interaction
Patent Information
- Application Number
- CN202411883735.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2044-12-19
AI Technical Summary
[0006]针对相关技术中,语音交互的响应速度太慢的技术问题,尚未提出有效的解决方案
[0018] In this embodiment, text data obtained after recognizing the voice interaction command of the target object is acquired; intent parsing is performed on the text data to obtain first intent data, and second intent data corresponding to the text data is queried from a preset intent cache library; if the first intent data and the second intent data are determined to be inconsistent, compensation processing is performed on the second intent data based on the first intent data to obtain third intent data, and the target intent data is determined based on the third intent data. This technical solution solves the technical problem of slow response speed in voice interaction. By parallel calling of the intent parsing program and querying the preset intent cache library, the intent of the user's voice command can be parsed quickly and accurately, effectively improving the accuracy and response speed of voice interaction command processing, thus improving the efficiency and accuracy of voice interaction. Furthermore, when the first intent data and the second intent data are inconsistent, compensation processing, combined with the user's historical behavior and the current intent recognition result, improves the flexibility and intelligence of intent recognition, thereby enhancing the user experience.
Smart Images

Figure CN119964562B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart home technology, and more specifically, to a method, apparatus, and storage medium for improving the response speed of voice interaction. Background Technology
[0002] With the rapid development of information technology, voice interaction technology has become an important part of the human-computer interaction field. This technology realizes natural communication between humans and machines by converting users' voice commands into machine-understandable commands. The application scope of voice interaction technology is expanding day by day, from smart homes to mobile devices and in-vehicle systems, covering almost every aspect of daily life.
[0003] In a typical voice interaction system, users issue voice commands such as "turn on the TV" or "check tomorrow's weather." Processing these commands usually involves two key stages: speech recognition and intent resolution. The speech recognition stage converts the user's voice signal into text information, while the intent resolution stage analyzes this text information to determine the user's intent and execute the corresponding action.
[0004] However, existing voice interaction systems suffer from efficiency issues when processing voice commands. Specifically, speech recognition is typically completed quickly, while intent parsing, due to its complex logic and real-time requirements, takes longer. This speed mismatch results in a significant time delay between speech recognition and intent parsing, increasing the overall interaction time. This delay forces users to wait longer for a system response, meaning the voice interaction response is too slow, negatively impacting user experience and reducing the efficiency of voice command processing.
[0005] Therefore, in related technologies, there is a technical problem that the response speed of voice interaction is too slow.
[0006] No effective solution has yet been proposed to address the technical problem of slow response speed in voice interaction. Summary of the Invention
[0007] This application provides a method, apparatus, and storage medium for improving the response speed of voice interaction, so as to at least solve the technical problem of slow response speed of voice interaction in related technologies.
[0008] According to one embodiment of this application, a method for improving the response speed of voice interaction is provided, comprising: acquiring text data obtained after recognizing a voice interaction command of a target object; performing intent parsing on the text data to obtain first intent data, and querying second intent data corresponding to the text data from a preset intent cache library; if it is determined that the first intent data and the second intent data are inconsistent, performing compensation processing on the second intent data based on the first intent data to obtain third intent data, and determining target intent data based on the third intent data.
[0009] In an exemplary embodiment, performing intent parsing on the text data to obtain first intent data includes: performing natural language processing on the text data using an intent parsing program to obtain the first intent data; parsing the preprocessed text data to obtain entity words; inputting the entity words into an intent recognition model to obtain intent categories output by the intent recognition model, wherein the intent recognition model is used to map the input words to predefined intent categories; and generating the first intent data according to the default intent framework corresponding to the entity words and the intent categories.
[0010] In one exemplary embodiment, performing compensation processing on second intent data based on first intent data to obtain third intent data includes: sending multiple queried second intent data to the target object, and receiving fourth intent data selected by the target object from the multiple second intent data; calculating a first intent confidence level between the first intent data and the fourth intent data, and a second intent confidence level between the second intent data and the fourth intent data; and updating the second intent data based on the first intent data when it is determined that the first intent confidence level meets a preset matching condition to obtain the third intent data.
[0011] In an exemplary embodiment, after determining the target intent data based on the third intent data, the method further includes: sending a plurality of queried second intent data to the target object, and receiving fourth intent data selected by the target object from the plurality of second intent data; calculating the third intent confidence level between the target intent data and the fourth intent data; if it is determined that the third intent confidence level does not meet a preset matching condition, generating a query statement based on the target intent data, and sending the query statement to the target object, wherein the query statement is used to ask the target object whether it approves the target intent data; and determining whether to adjust the target intent data based on the target object's response statement based on the query statement.
[0012] In an exemplary embodiment, before querying the second intent data corresponding to the text data from the preset intent cache library, the method further includes: obtaining historical high-frequency corpus with an interaction frequency higher than a preset frequency from historical interaction data, and historical intent data corresponding to the historical high-frequency corpus; establishing the preset intent cache library based on the historical high-frequency corpus and the historical intent data corresponding to the historical high-frequency corpus; classifying the historical high-frequency corpus in the preset intent cache library according to the object behavior of the target object to obtain historical behavior corpus corresponding to different object behaviors; querying the second intent data corresponding to the text data from the preset intent cache library includes: determining target behavior corpus belonging to the target object from the historical behavior corpus corresponding to different object behaviors, and querying the second intent data corresponding to the text data from the historical intent data corresponding to the target behavior corpus.
[0013] In an exemplary embodiment, querying the second intent data corresponding to the text data from a preset intent cache library includes: obtaining a first text vector corresponding to the text data, and obtaining a second text vector of cached data in the preset intent cache library; calculating the cosine similarity between the first text vector and the second text vector using a word vector model; obtaining intent cache data whose cosine similarity exceeds a preset threshold from the cached data; splitting the text data to obtain multiple keywords, and querying the second intent data corresponding to the multiple keywords from the intent cache data.
[0014] In one exemplary embodiment, the method further includes: determining the time when the first intent data is obtained and the time when the second intent data is queried; if the time when the obtained time is earlier than the time when the queried time is determined, determining the target intent data based on the first intent data; if the time when the obtained time is later than the time when the queried time is determined, determining the target intent data based on the second intent data.
[0015] According to another aspect of the embodiments of this application, an apparatus for improving the response speed of voice interaction is also provided, comprising: an obtaining module, configured to obtain text data obtained after recognizing a voice interaction command of a target object; a querying module, configured to perform intent parsing on the text data to obtain first intent data, and query second intent data corresponding to the text data from a preset intent cache library; and a determining module, configured to, when it is determined that the first intent data and the second intent data are inconsistent, perform compensation processing on the second intent data based on the first intent data to obtain third intent data, and determine target intent data based on the third intent data.
[0016] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described method for improving the response speed of voice interaction when it is run.
[0017] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described method for improving the response speed of voice interaction through the computer program.
[0018] In this embodiment, text data obtained after recognizing the voice interaction command of the target object is acquired; intent parsing is performed on the text data to obtain first intent data, and second intent data corresponding to the text data is queried from a preset intent cache library; if the first intent data and the second intent data are determined to be inconsistent, compensation processing is performed on the second intent data based on the first intent data to obtain third intent data, and the target intent data is determined based on the third intent data. This technical solution solves the technical problem of slow response speed in voice interaction. By parallel calling of the intent parsing program and querying the preset intent cache library, the intent of the user's voice command can be parsed quickly and accurately, effectively improving the accuracy and response speed of voice interaction command processing, thus improving the efficiency and accuracy of voice interaction. Furthermore, when the first intent data and the second intent data are inconsistent, compensation processing, combined with the user's historical behavior and the current intent recognition result, improves the flexibility and intelligence of intent recognition, thereby enhancing the user experience. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of the hardware environment for a method to improve the response speed of voice interaction according to an embodiment of this application;
[0022] Figure 2 This is a flowchart of a method for improving voice interaction response speed according to an embodiment of this application;
[0023] Figure 3 This is a schematic diagram illustrating the process of improving voice interaction response speed according to an embodiment of this application;
[0024] Figure 4 This is a flowchart (a) of the process of improving the response speed of voice interaction according to an embodiment of this application;
[0025] Figure 5 This is a flowchart (II) of the process for improving the response speed of voice interaction according to an embodiment of this application;
[0026] Figure 6 This is a flowchart (III) of the process for improving the response speed of voice interaction according to an embodiment of this application;
[0027] Figure 7 This is a structural block diagram of a device for improving the response speed of voice interaction according to an embodiment of this application. Detailed Implementation
[0028] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0030] According to one aspect of the embodiments of this application, a method for improving voice interaction response speed is provided. This method for improving voice interaction response speed is widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the above-mentioned method for improving voice interaction response speed can be applied to, for example... Figure 1The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.
[0031] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.
[0032] This embodiment provides a method for improving voice interaction response speed, applied to the aforementioned terminal device. Figure 2 This is a flowchart of a method for improving voice interaction response speed according to an embodiment of this application, the process including the following steps:
[0033] Step S202: Obtain the text data obtained after recognizing the voice interaction commands of the target object;
[0034] Step S204: Perform intent parsing on the text data to obtain first intent data, and query the second intent data corresponding to the text data from the preset intent cache library;
[0035] The process of performing intent parsing on the text data to obtain first intent data may include: responding to a parallel call instruction, calling the intent parsing program of the text data, and using the intent parsing program to perform intent parsing on the text data to obtain first intent data.
[0036] The processes of performing intent parsing on the text data and querying the second intent data corresponding to the text data from the preset intent cache library are executed simultaneously and in parallel.
[0037] For example Figure 3 As shown, during voice interaction, the intent parsing process and cache query process of NLP semantic analysis can be called in parallel. If the NLP intent cache is hit, the cached result will be obtained first. At this time, the cached result can be used for subsequent processing, that is, the obtained result is used first for other subsequent processing.
[0038] Step S206: If it is determined that the first intent data and the second intent data are inconsistent, compensation processing is performed on the second intent data based on the first intent data to obtain the third intent data, and the target intent data is determined based on the third intent data.
[0039] Through the above steps, text data obtained after recognizing the voice interaction command of the target object is acquired; intent parsing is performed on the text data to obtain first intent data, and second intent data corresponding to the text data is queried from a preset intent cache library; if the first intent data and the second intent data are determined to be inconsistent, compensation processing is performed on the second intent data based on the first intent data to obtain third intent data, and the target intent data is determined based on the third intent data. This technical solution solves the technical problem of slow response speed in voice interaction. By parallel calling of the intent parsing program and querying the preset intent cache library, the intent of the user's voice command can be parsed quickly and accurately, effectively improving the accuracy and response speed of voice interaction command processing, and enhancing the efficiency and accuracy of voice interaction. Furthermore, when the first intent data and the second intent data are inconsistent, compensation processing, combined with the user's historical behavior and the current intent recognition result, improves the flexibility and intelligence of intent recognition, thereby enhancing the user experience.
[0040] Understandably, this application optimizes the internal logic of voice interaction processing by using a response mechanism that involves parallel invocation of the intent parser and querying of the preset intent cache library. This can improve the voice interaction response speed and reduce the interaction time. It is also applicable to situations where there are multiple intent parsers, thus improving the efficiency of improving the voice interaction response speed.
[0041] In one alternative embodiment, such as Figure 4 As shown, an implementation flow for voice interaction commands is proposed, which specifically includes:
[0042] Step 1: The user initiates a voice command.
[0043] Step 2: Record audio using the device.
[0044] Step 3: Perform Automatic Speech Recognition (ASR) on the audio stream sent by the device in the cloud.
[0045] Step 4: Is this high-frequency corpus? If so, proceed to step 5; otherwise, proceed to step 6.
[0046] Step 5: Did the intent cache hit? If yes, proceed to step 7; otherwise, proceed to step 6.
[0047] Step 6: Perform Natural Language Processing (NLP).
[0048] Based on the above steps, it is also possible to achieve Figure 5 The following steps are shown:
[0049] 1. Obtain the ASR recognition result.
[0050] 2. Perform intent parsing and query caching in parallel.
[0051] 3. Does the recognition result meet the caching conditions? If yes, proceed to step 4; otherwise, proceed to step 2.
[0052] 4. Retrieve cached results.
[0053] 5. Call the NLP interface. Further execute the NLP parsing from 5.1.
[0054] 6. Write the cached results.
[0055] 7. If no cached result is found, wait for the NLP parsing result from the NLP interface to be called.
[0056] 8. Follow-up processing.
[0057] 9. If the cached result is inconsistent with the NLP parsing result, update the cached result.
[0058] If the processing results of the cached results are inconsistent with the processing results of the NLP parsing results, the NLP content for subsequent processing will be modified.
[0059] Step 7: Use intent to cache the results.
[0060] Step 8, skill processing.
[0061] Step 9: Generate the text to be broadcast.
[0062] Step 10, speech synthesis, can be achieved using TTS (Text-to-Speech).
[0063] Step 11: The device plays audio based on the audio stream sent from the cloud.
[0064] Step 12: The user hears a voice announcement.
[0065] In an exemplary embodiment, the process of performing intent parsing on the text data to obtain first intent data specifically includes: performing natural language processing on the text data using an intent parsing program to obtain the first intent data; parsing the preprocessed text data to obtain entity words; inputting the entity words into an intent recognition model to obtain the intent category output by the intent recognition model, wherein the intent recognition model is used to map the input words to predefined intent categories; and generating the first intent data according to the default intent framework corresponding to the entity words and the intent categories.
[0066] In this embodiment, the process of obtaining the first intent data through natural language processing can also be described as follows: The original text data is cleaned by removing irrelevant characters, punctuation, and stop words, and the text is normalized, such as by case conversion and standardization of numbers and text. Then, sentences are broken down into words or phrases, and the part of speech of each word is labeled, such as noun, verb, adjective, etc., which helps in understanding the basic structure of the text. Next, entity words such as names of people, places, and organizations in the text are identified, and the sentence structure is analyzed to identify components such as subject, predicate, and object, understanding the basic semantics of the sentence, which is crucial for understanding and locating specific information. The text is then converted into a structured semantic representation, such as a logical form or semantic framework. A machine learning model (equivalent to an intent recognition model) is used to identify the user's intent from the data processed above. Then, entities related to a specific intent are identified and filled into slots in the intent framework, such as identifying the specific song name or artist name in the "play music" intent. Finally, the intent recognition results can be verified to ensure their logic and rationality. Through natural language processing, clear intents can be extracted, providing information for further dialogue management and action execution.
[0067] Optionally, the aforementioned intent recognition model is trained using historical entity words as input samples and the intent categories corresponding to those historical entity words as output samples. For example, existing learning models such as recurrent neural networks and long short-term memory networks can be used for training, enabling the model to learn how to extract key information from entity words and map it to intent categories. When a user inputs new corpus, the model outputs an intent category, or a probability distribution of a series of intent categories, improving the accuracy and robustness of the intent recognition model and enabling it to handle diverse linguistic expressions and contextual dependencies.
[0068] It is understood that generating the first intent data representation based on the entity words and the default intent framework corresponding to the intent category involves filling the entity words into the corresponding slots in the default intent framework.
[0069] In one exemplary embodiment, the process of performing compensation processing on second intent data based on first intent data to obtain third intent data may include: sending multiple retrieved second intent data sets to the target object, and receiving fourth intent data selected by the target object from the multiple second intent data sets; calculating a first intent confidence level between the first intent data set and the fourth intent data set, and a second intent confidence level between the second intent data set and the fourth intent data set; and updating the second intent data based on the first intent data set to obtain the third intent data when the first intent confidence level satisfies a preset matching condition. This embodiment can dynamically select intent data based on confidence levels. For example, if the first intent confidence level is higher than the second intent confidence level, the first intent data can also be updated based on the second intent data to obtain the third intent data.
[0070] The process of determining that the confidence level of the first intent meets the preset matching conditions includes: determining that the confidence level of the first intent is higher than the confidence level of the second intent.
[0071] In an exemplary embodiment, after determining the target intent data based on the third intent data, furthermore, multiple retrieved second intent data can be sent to the target object, and a fourth intent data selected by the target object from the multiple second intent data can be received; the third intent confidence score between the target intent data and the fourth intent data can be calculated; if it is determined that the third intent confidence score does not meet a preset matching condition, a query statement is generated based on the target intent data, and the query statement is sent to the target object, wherein the query statement is used to ask the target object whether it approves of the target intent data; and the target intent data is adjusted based on the target object's response statement based on the query statement. Furthermore, by asking the user whether they approve of the target intent data, the interactivity and intelligence of the system are further enhanced, ensuring the accuracy of voice command processing.
[0072] The process of determining that the confidence level of the first intent meets the preset matching conditions includes: determining that the confidence level of the third intent is lower than the preset intent confidence level.
[0073] In this embodiment, if the target intent data is determined to be adjusted based on the response statement of the target object to the query statement, the target intent data can be regenerated or deleted.
[0074] In an exemplary embodiment, before querying the second intent data corresponding to the text data from a preset intent cache library, further, historical high-frequency corpus with an interaction frequency higher than a preset frequency and historical intent data corresponding to the historical high-frequency corpus are obtained from historical interaction data; the preset intent cache library is established based on the historical high-frequency corpus and the historical intent data corresponding to the historical high-frequency corpus; the historical high-frequency corpus is classified in the preset intent cache library according to the object behavior of the target object to obtain historical behavior corpus corresponding to different object behaviors; querying the second intent data corresponding to the text data from the preset intent cache library includes: determining the target behavior corpus belonging to the target object from the historical behavior corpus corresponding to different object behaviors, and querying the second intent data corresponding to the text data from the historical intent data corresponding to the target behavior corpus. By caching the historical intent data corresponding to the historical high-frequency corpus, the real-time intent parsing step can be skipped in some cases during subsequent user voice interaction, thereby reducing the duration and improving interaction efficiency.
[0075] Among them, such as Figure 3 As shown, a cached NLP corpus (i.e., a pre-defined intent cache) can be built using high-frequency corpora before or during interaction. By caching high-frequency corpora intents, NLP does not need to be called when the intent of a high-frequency corpus is hit, which can reduce the interaction time.
[0076] Optionally, in one embodiment, historical interaction data may represent, for example, a historical record of voice interactions between the user and the device, and may have attributes such as time, device, corpus, and intent. The historical records are shown in Table 1 below.
[0077] Table 1 Historical Records
[0078]
[0079]
[0080] Optionally, in one embodiment, the proportion of a certain type of corpus in the total number of interactions = number of interactions with a certain type of corpus / total number of interactions * 100%. By comparing the proportion of a certain type of corpus in the total number of interactions with a set threshold, it can be determined whether this part of the corpus is high-frequency corpus, and the high-frequency corpus is stored in the cache library. This embodiment proposes an automatic high-frequency corpus filtering mechanism, which can automatically determine whether the corpus has caching value, improving the accuracy of data retrieval from the cache library.
[0081] In an exemplary embodiment, a technical solution for querying second intent data corresponding to text data from a preset intent cache library may include: obtaining a first text vector corresponding to the text data, and obtaining a second text vector of cached data in the preset intent cache library; calculating the cosine similarity between the first text vector and the second text vector using a word vector model; obtaining intent cache data from the cached data whose cosine similarity exceeds a preset threshold; splitting the text data to obtain multiple keywords, and querying second intent data corresponding to the multiple keywords from the intent cache data. In this embodiment, second intent data corresponding to all of the multiple keywords can be queried from the intent cache data, or second intent data corresponding to some of the keywords can be queried from the intent cache data. In this embodiment, by calculating the similarity between text data and cached corpus using a word vector model, a fuzzy matching mechanism is implemented, accelerating the data matching speed.
[0082] Optionally, in one embodiment, the process of querying the second intent data corresponding to the keywords can be as follows: keywords corresponding to the intents are predefined, and intent cache data containing these keywords can be directly queried. For example, the corpus of "play nursery rhymes" can be precisely matched with keywords such as "nursery rhymes" and "play," thereby quickly locating the intent "play children's songs." This method is fast and efficient.
[0083] In one exemplary embodiment, the time at which the first intent data is obtained and the time at which the second intent data is queried may also be determined; if the time at which the first intent data is obtained is earlier than the time at which the second intent data is queried, the target intent data may be determined based on the first intent data; if the time at which the first intent data is obtained is later than the time at which the second intent data is queried, the target intent data may be determined based on the second intent data.
[0084] To better understand the process of improving the response speed of voice interaction described above, the implementation flow of the method for improving the response speed of voice interaction will be further described below with reference to optional embodiments, but this is not intended to limit the technical solution of the embodiments of this application.
[0085] Optionally, in one embodiment, such as Figure 6 As shown, a process for improving the response speed of voice interaction is also proposed, which specifically includes:
[0086] Step 1: The user initiates a voice command.
[0087] Step 2: Record audio using the device.
[0088] Step 3: Perform speech recognition (ASR) on the audio stream sent by the device in the cloud.
[0089] Step 4, Natural Speech Processing (NLP).
[0090] Step 7: Use intent to cache the results.
[0091] Step 5, skill processing.
[0092] Step 6: Generate the text to be broadcast.
[0093] Step 7, Text-to-Speech (TTS).
[0094] Step 8: The device plays audio based on the audio stream sent from the cloud.
[0095] Step 9: The user hears a voice announcement.
[0096] In this embodiment, the speech recognition stage can be performed by a speech recognition program to convert speech commands into text data, and the intent parsing stage can be performed by an intent parsing program to convert the obtained text data into intent data. The intent data represents the core concept data corresponding to the text data. For example, if the text data is "turn on the TV", the corresponding intent data could be "turn on" or "TV".
[0097] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0098] Figure 7 This is a structural block diagram of a device for improving the response speed of voice interaction according to an embodiment of this application; as shown... Figure 7 As shown, it includes:
[0099] Module 72 is used to obtain text data obtained after recognizing the voice interaction commands of the target object;
[0100] The query module 74 is used to perform intent parsing on the text data to obtain first intent data, and to query the second intent data corresponding to the text data from a preset intent cache library;
[0101] The determination module 76 is used to perform compensation processing on the second intent data based on the first intent data to obtain third intent data when it is determined that the first intent data and the second intent data are inconsistent, and to determine the target intent data based on the third intent data.
[0102] The aforementioned device acquires text data obtained after recognizing voice interaction commands for a target object; performs intent parsing on the text data to obtain first intent data, and queries a preset intent cache library for second intent data corresponding to the text data; if the first intent data and the second intent data are inconsistent, performs compensation processing on the second intent data based on the first intent data to obtain third intent data, and determines the target intent data based on the third intent data. This technical solution solves the problem of slow response speed in voice interaction. By parallel calling of the intent parsing program and querying the preset intent cache library, the intent of user voice commands can be parsed quickly and accurately, effectively improving the accuracy and response speed of voice interaction command processing, and enhancing the efficiency and accuracy of voice interaction. Furthermore, when the first intent data and the second intent data are inconsistent, compensation processing, combined with user history and current intent recognition results, improves the flexibility and intelligence of intent recognition, thereby enhancing the user experience.
[0103] In an exemplary embodiment, the query module is further configured to: perform natural language processing on the text data using an intent parsing program to obtain the first intent data; perform text parsing on the preprocessed text data to obtain entity words; input the entity words into an intent recognition model to obtain the intent category output by the intent recognition model, wherein the intent recognition model is used to map the input words to predefined intent categories; and generate the first intent data according to the default intent framework corresponding to the entity words and the intent categories.
[0104] In an exemplary embodiment, the determining module is further configured to: send a plurality of second intent data obtained from the query to the target object, and receive fourth intent data selected by the target object from the plurality of second intent data; calculate a first intent confidence between the first intent data and the fourth intent data, and a second intent confidence between the second intent data and the fourth intent data; and, if it is determined that the first intent confidence satisfies a preset matching condition, update the second intent data based on the first intent data to obtain the third intent data.
[0105] In an exemplary embodiment, the determining module is further configured to: after determining the target intent data based on the third intent data, further send a plurality of queried second intent data to the target object, and receive fourth intent data selected by the target object from the plurality of second intent data; calculate the third intent confidence level between the target intent data and the fourth intent data; if it is determined that the third intent confidence level does not meet a preset matching condition, generate an inquiry statement based on the target intent data, and send the inquiry statement to the target object, wherein the inquiry statement is used to ask the target object whether it approves the target intent data; and determine whether to adjust the target intent data based on the target object's response statement based on the inquiry statement.
[0106] In an exemplary embodiment, the query module is further configured to: before querying the second intent data corresponding to the text data from the preset intent cache library, further obtain historical high-frequency corpus with an interaction frequency higher than a preset frequency from historical interaction data, and historical intent data corresponding to the historical high-frequency corpus; establish the preset intent cache library based on the historical high-frequency corpus and the historical intent data corresponding to the historical high-frequency corpus; classify the historical high-frequency corpus in the preset intent cache library according to the object behavior of the target object to obtain historical behavior corpus corresponding to different object behaviors; querying the second intent data corresponding to the text data from the preset intent cache library includes: determining the target behavior corpus belonging to the target object from the historical behavior corpus corresponding to different object behaviors, and querying the second intent data corresponding to the text data from the historical intent data corresponding to the target behavior corpus.
[0107] In an exemplary embodiment, the query module is further configured to: obtain a first text vector corresponding to the text data, and obtain a second text vector of cached data in the preset intent cache library; calculate the cosine similarity between the first text vector and the second text vector using a word vector model; obtain intent cache data from the cached data whose cosine similarity exceeds a preset threshold; split the text data to obtain multiple keywords, and query second intent data corresponding to the multiple keywords from the intent cache data.
[0108] In one exemplary embodiment, the determining module is further configured to: determine the time at which the first intent data is obtained and the time at which the second intent data is queried; if the time at which the first intent data is obtained is earlier than the time at which the second intent data is queried, determine the target intent data based on the first intent data; if the time at which the first intent data is obtained is later than the time at which the second intent data is queried, determine the target intent data based on the second intent data.
[0109] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.
[0110] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:
[0111] S1, Obtain the text data obtained after recognizing the voice interaction commands of the target object;
[0112] S2, perform intent parsing on the text data to obtain first intent data, and query the second intent data corresponding to the text data from the preset intent cache library;
[0113] S3, if it is determined that the first intent data and the second intent data are inconsistent, compensation processing is performed on the second intent data based on the first intent data to obtain the third intent data, and the target intent data is determined based on the third intent data.
[0114] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0115] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0116] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0117] S1, Obtain the text data obtained after recognizing the voice interaction commands of the target object;
[0118] S2, perform intent parsing on the text data to obtain first intent data, and query the second intent data corresponding to the text data from the preset intent cache library;
[0119] S3, if it is determined that the first intent data and the second intent data are inconsistent, compensation processing is performed on the second intent data based on the first intent data to obtain the third intent data, and the target intent data is determined based on the third intent data.
[0120] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0121] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0122] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0123] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for improving response speed of voice interaction, characterized in that, The method comprises: obtaining text data obtained after recognizing voice interaction instructions of a target object; performing intent analysis on the text data to obtain first intent data, and querying second intent data corresponding to the text data from a preset intent cache library; in a case where it is determined that the first intent data and the second intent data are inconsistent, performing compensation processing on the second intent data based on the first intent data to obtain third intent data, and determining target intent data according to the third intent data; performing compensation processing on the second intent data based on the first intent data to obtain third intent data, comprising: sending the queried multiple second intent data to the target object, and receiving fourth intent data selected by the target object from the multiple second intent data; respectively calculating a first intent confidence between the first intent data and the fourth intent data, and a second intent confidence between the second intent data and the fourth intent data; in a case where it is determined that the first intent confidence satisfies a preset matching condition, updating the second intent data based on the first intent data to obtain the third intent data.
2. The method for improving response speed of voice interaction according to claim 1, characterized in that, performing intent analysis on the text data to obtain first intent data, comprising: using an intent analysis program to perform natural language processing on the text data to obtain the first intent data; performing text analysis on the preprocessed text data to obtain entity words, inputting the entity words into an intent recognition model to obtain an intent category output by the intent recognition model, wherein the intent recognition model is used to map the input words to a predefined intent category; generating the first intent data according to a default intent framework corresponding to the entity words and the intent category.
3. The method for improving response speed of voice interaction according to claim 1, characterized in that, After determining the target intent data according to the third intent data, the method further comprises: sending the queried multiple second intent data to the target object, and receiving fourth intent data selected by the target object from the multiple second intent data; calculating a third intent confidence between the target intent data and the fourth intent data; in a case where it is determined that the third intent confidence does not satisfy a preset matching condition, generating an inquiry statement based on the target intent data and sending the inquiry statement to the target object, wherein the inquiry statement is used to inquire whether the target object approves the target intent data; determining whether to adjust the target intent data according to a reply statement of the target object based on the inquiry statement.
4. The method for improving response speed of voice interaction according to claim 1, characterized in that, Before querying the second intent data corresponding to the text data from the preset intent cache library, the method further comprises: obtaining historical high-frequency corpus with an interaction frequency higher than a preset frequency from historical interaction data, and historical intent data corresponding to the historical high-frequency corpus; establishing the preset intent cache library according to the historical high-frequency corpus and the historical intent data corresponding to the historical high-frequency corpus; classifying the historical high-frequency corpus according to object behaviors of the target object in the preset intent cache library to obtain historical behavior corpus corresponding to different object behaviors; querying second intent data corresponding to the text data from a preset intent cache library, comprising: determining target behavior corpus belonging to the target object from the historical behavior corpus corresponding to the different object behaviors, and querying second intent data corresponding to the text data from historical intent data corresponding to the target behavior corpus.
5. The method for improving response speed of voice interaction according to claim 1, characterized in that, querying second intent data corresponding to the text data from a preset intent cache library, comprising: obtaining a first text vector corresponding to the text data, and obtaining a second text vector of cache data in the preset intent cache library; calculating the cosine similarity between the first text vector and the second text vector using a word vector model; obtaining intent cache data with a cosine similarity exceeding a preset threshold from the cache data; splitting the text data to obtain a plurality of keywords, and querying second intent data corresponding to the plurality of keywords from the intent cache data.
6. The method for improving response speed of voice interaction according to claim 1, wherein, The method further comprises: determining the time when the first intent data is obtained and the time when the second intent data is queried; in a case where it is determined that the time when the first intent data is obtained is earlier than the time when the second intent data is queried, determining the target intent data according to the first intent data; in a case where it is determined that the time when the first intent data is obtained is later than the time when the second intent data is queried, determining the target intent data according to the second intent data.
7. An apparatus for improving response speed of voice interaction, the apparatus comprising: comprise: a obtaining module, configured to obtain text data obtained after recognizing a voice interaction instruction of a target object; a querying module, configured to perform intent analysis on the text data to obtain first intent data, and query second intent data corresponding to the text data from a preset intent cache library; a determining module, configured to, in a case where it is determined that the first intent data and the second intent data are inconsistent, perform compensation processing on the second intent data based on the first intent data to obtain third intent data, and determine target intent data according to the third intent data; The determining module is further configured to send the plurality of second intent data queried to the target object, and receive fourth intent data selected by the target object from the plurality of second intent data; calculate a first intent confidence between the first intent data and the fourth intent data, and a second intent confidence between the second intent data and the fourth intent data; in a case where it is determined that the first intent confidence satisfies a preset matching condition, update the second intent data based on the first intent data to obtain the third intent data.
8. A computer readable storage medium, characterized in that, The computer-readable storage medium comprises a stored program, wherein the program executes the method described in any one of claims 1 to 6 when running. 9.An electronic device comprising a memory and a processor, the electronic device characterized by, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 6 by the computer program. The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 6 by the computer program.
Citation Information
Patent Citations
Data validity determination method and device, storage medium and electronic device
CN112714020A
Interaction response method and device based on intention recognition, equipment and storage medium
CN116541493A