Intention recognition method, electronic equipment and storage medium
By performing intent recognition on speech information that has not undergone silence detection in advance during the speech recognition process, and comparing text labels when speech information after silence detection arrives, the problem of excessively long response time in the existing technology is solved, resulting in faster response time and a better user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHENGDU BOSS INNOVATION TECH CO LTD
- Filing Date
- 2024-10-29
- Publication Date
- 2026-05-01
Smart Images

Figure CN121963718A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing, and more specifically, to an intent recognition method, an electronic device, and a storage medium. Background Technology
[0002] Various smart devices will be equipped with AI smart assistants to provide users with intelligent dialogue and to control various smart devices.
[0003] Existing speech recognition solutions, during user-interaction speech recognition, require waiting for silence detection to complete after the user finishes speaking, which can take several hundred milliseconds, before requesting the speech recognition service. The service only returns the result after accurately recognizing the user's intent. This long response time negatively impacts the user experience. Summary of the Invention
[0004] The purpose of this invention is to provide an intent recognition method, an electronic device, and a readable storage medium that can shorten the response time of intelligent dialogue.
[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0006] In a first aspect, embodiments of this application provide an intent recognition method, the method comprising:
[0007] Receive first voice information input by the user, wherein the first voice information is voice information without silence detection;
[0008] Intent recognition is performed based on the first voice information to obtain the intent information corresponding to the first voice information;
[0009] Receive second voice information input by the user, wherein the second voice information is voice information after silence detection;
[0010] Compare the text identifier of the first voice information with the text identifier of the second voice information;
[0011] When the text identifier of the first voice information is the same as the text identifier of the second voice information, the intent information corresponding to the first voice information is output as the intent information of the second voice information.
[0012] When the text identifier of the first voice information is inconsistent with the text identifier of the second voice information, the semantic information of the first voice information and the semantic information of the second voice information are determined respectively.
[0013] When the semantic information of the first voice information is consistent with the semantic information of the second voice information, the intent information of the first voice information is output as the intent information of the second voice information.
[0014] In an optional implementation, the first voice information includes multiple components; the step of performing intent recognition based on the first voice information to obtain intent information corresponding to the first voice information includes:
[0015] Perform intent recognition on multiple first speech information to obtain intent information corresponding to the multiple first speech information;
[0016] The step of comparing the text identifier of the first voice information with the text identifier of the second voice information includes:
[0017] Determine the first text identifier for each of the first voice information;
[0018] Determine the second text identifier of the second voice information;
[0019] Compare the second text identifier with each of the first text identifiers;
[0020] The step of determining the semantic information of the first voice information and the semantic information of the second voice information respectively when the text identifier of the first voice information is inconsistent with the text identifier of the second voice information includes:
[0021] When all the first text identifiers and the second text identifiers are inconsistent, determine the first semantic information corresponding to each of the first voice information, and determine the second semantic information corresponding to the second voice information.
[0022] The step of outputting the intent information of the first voice information as the intent information of the second voice information when the semantic information of the first voice information is inconsistent with the semantic information of the second voice information includes:
[0023] The second semantic information is matched sequentially with the first semantic information corresponding to each of the first voice messages according to the time order in which each of the first voice messages is received;
[0024] Obtain the first target semantic information corresponding to the second semantic information from each of the first semantic information;
[0025] The intent information corresponding to the first speech information corresponding to the first target semantic information is determined and output as the intent information of the second speech information.
[0026] In an optional implementation, the step of determining the intent information corresponding to the first speech information corresponding to the first target semantic information and outputting it as the intent information of the second speech information includes:
[0027] Obtain the resource information corresponding to the first target semantic information from the resource library;
[0028] The resource information is output as the intent information of the second voice information.
[0029] In an optional implementation, the method further includes:
[0030] In the process of intent recognition based on the first voice information, if the response time of intent recognition of the first voice information exceeds the preset response time, then intent recognition is performed based on the second voice information to obtain the intent information corresponding to the second voice information.
[0031] Output the intent information of the second voice message.
[0032] In an optional implementation, the method further includes:
[0033] During the process of intent recognition based on the first voice information, if the intent recognition of the first voice information is not completed, the process waits for the intent information of the first voice information.
[0034] After the intent recognition of the first voice information is completed, the intent information of the first voice information is output as the intent information of the second voice information.
[0035] In an optional implementation, the method further includes:
[0036] When the semantic information of the first voice information is inconsistent with the semantic information of the second voice information, the intent recognition is performed based on the second voice message to obtain the intent information corresponding to the second voice information.
[0037] Output the intent information corresponding to the second voice information.
[0038] In an optional implementation, the step of receiving second voice information input by the user includes:
[0039] Receive voice input from the user while the user speaks;
[0040] If no other voice information is received from the user within a preset time period, the voice information input by the user will be used as the second voice information.
[0041] In an optional implementation, the step of performing intent recognition based on the first voice information to obtain intent information corresponding to the first voice information includes:
[0042] Convert the first voice information into text information;
[0043] Retrieve the intent information corresponding to the text information from the database;
[0044] Determine the degree of matching between the text information and each intent information;
[0045] The intent information with the highest matching degree is obtained as the intent information of the first speech information.
[0046] Secondly, embodiments of this application provide an intent recognition device, the device comprising:
[0047] The receiving module is used to receive first voice information input by the user, wherein the first voice information is voice information without silence detection;
[0048] The intent recognition module is used to perform intent recognition based on the first voice information to obtain the intent information corresponding to the first voice information.
[0049] The receiving module is also used to: receive second voice information input by the user, wherein the second voice information is voice information after silence detection;
[0050] The comparison module is used to compare the text identifier of the first voice information with the text identifier of the second voice information;
[0051] The output module is used to output the intent information corresponding to the first voice information as the intent information of the second voice information when the text identifier of the first voice information is consistent with the text identifier of the second voice information.
[0052] The determining module is used to determine the semantic information of the first voice information and the semantic information of the second voice information respectively when the text identifier of the first voice information is inconsistent with the text identifier of the second voice information.
[0053] The output module is further configured to output the intent information of the first voice information as the intent information of the second voice information when the semantic information of the first voice information is consistent with the semantic information of the second voice information.
[0054] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of an intent recognition method.
[0055] Fourthly, embodiments of this application provide a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of an intent recognition method.
[0056] This application has the following beneficial effects:
[0057] This application receives first voice information input by the user, wherein the first voice information is voice information without silence detection. Based on the first voice information, intent recognition is performed to obtain the intent information corresponding to the first voice information. Then, second voice information input by the user is received, and the text identifiers of the first and second voice information are compared. If the text identifiers of the first and second voice information match, the intent information corresponding to the first voice information is output as the intent information of the second voice information. If the text identifiers of the first and second voice information do not match, the semantic information of the first and second voice information is determined separately. If the semantic information of the first and second voice information matches, the intent information of the first voice information is output as the intent information of the second voice information. By performing semantic understanding and data retrieval on the user-input voice information in advance, the end-to-end response time is shortened, thereby improving the user experience. Attached Figure Description
[0058] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0059] Figure 1 This is a sequence diagram of the execution of the intent recognition process in the prior art;
[0060] Figure 2 A block diagram of an electronic device provided in an embodiment of the present invention;
[0061] Figure 3 One of the flowcharts for an intent recognition method provided in an embodiment of the present invention;
[0062] Figure 4 A second flowchart of an intent recognition method provided in an embodiment of the present invention;
[0063] Figure 5 A flowchart of an intent recognition method provided in an embodiment of the present invention;
[0064] Figure 6 This is a structural block diagram of an intent recognition device provided in an embodiment of the present invention.
[0065] Icons: 100 - Electronic device; 110 - Intent recognition device; 120 - Memory; 130 - Processor; 111 - Receiver module; 112 - Intent recognition module; 113 - Comparison module; 114 - Output module; 115 - Determination module. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0067] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0068] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0069] In the description of this invention, it should be noted that if terms such as "upper," "lower," "inner," or "outer" are used to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship in which the product of this invention is usually placed, they are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.
[0070] Furthermore, the terms "first" and "second" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.
[0071] In the description of this application, it should also be noted that, unless otherwise expressly specified and limited, the terms "set up," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0072] Through extensive research, the inventors discovered that during speech recognition, the request to the speech recognition service should only be sent after the silence detection process has ended, i.e., after determining that the user has finished speaking. Once the speech recognition service recognizes the user's intent, it then invokes relevant services to construct the response. The timing diagram of the entire process is as follows: Figure 1 As shown, when a user outputs the voice message "I want to listen to Andy Lau's songs," three voice packets are sent to the speech recognition service during the voice packet collection process. Upon arrival of each packet, the speech recognition service parses it into text. The parsing results of the three packets are shown in steps 1.1, 1.2, and 1.3 of the diagram above. When the user's third voice packet arrives and no new voice packets arrive, the speech recognition service determines that the user has finished speaking after the silence duration meets the condition. It then sends the voice text of the voice request (step 1.4) to the semantic scheduling service. Based on the voice request text information in step 1.4, the semantic scheduling service internally obtains candidate results, sorts them, and optimizes them to construct the optimal intent request response, thus obtaining the response data and returning the final result to the end user.
[0073] The aforementioned speech recognition has the following problems: 1. During the entire user interaction process, the user requests voice packets multiple times, but only after the last request meets the conditions does the speech recognition service begin to be requested. From the time the user begins speaking until the speech recognition service receives the user's complete voice text, the semantic scheduling service cannot do anything, resulting in wasted time. 2. The existing speech recognition can only perform final semantic recognition after receiving the user's last voice packet. However, in reality, the complete intent may be recognized even with incomplete speech, but due to background noise or other interference factors, the speech recognition service only recognizes the user's sentence as finished at the very end, causing the semantic scheduling service to be underutilized. 3. The speech recognition service is very busy, while the semantic scheduling service is very idle, resulting in a severe imbalance in resource utilization. 4. The user has to wait a long time from the start of speaking to obtaining the final recognition result, resulting in a poor user experience.
[0074] In view of the above-mentioned problems, this embodiment provides an intent recognition method, electronic device and storage medium, which can shorten the end-to-end response time by performing semantic understanding and data retrieval on the user's input voice information in advance. The solution provided in this embodiment will be described in detail below.
[0075] This embodiment provides an electronic device capable of identifying intent. In one possible implementation, the electronic device can be a user terminal, such as, but not limited to, a server, smartphone, personal computer (PC), tablet computer, personal digital assistant (PDA), and mobile internet device (MID).
[0076] Please refer to Figure 2 , Figure 1This is a schematic diagram of the structure of the electronic device 100 provided in the embodiments of this application. The electronic device 100 may further include... Figure 2 The more or fewer components shown, or having the same Figure 2 The different configurations shown. Figure 2 The components shown can be implemented using hardware, software, or a combination thereof.
[0077] The electronic device 100 includes an intent recognition device 110, a memory 120, and a processor 130.
[0078] The components of the memory 120 and processor 130 are electrically connected directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The intent recognition device 110 includes at least one software function module that can be stored in the memory 120 in the form of software or firmware or embedded in the operating system (OS) of the electronic device 100. The processor 130 is used to execute executable modules stored in the memory 120, such as the software function modules and computer programs included in the intent recognition device 110.
[0079] The memory 120 may be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory 120 is used to store programs, and the processor 130 executes the programs after receiving execution instructions.
[0080] Please refer to Figure 3 , Figure 3 For application Figure 2 The flowchart below shows an intent recognition method for an electronic device 100, and the method includes a detailed description of each step.
[0081] S201: Receive the first voice information input by the user.
[0082] The first voice information is the voice information that has not undergone silence detection.
[0083] S202: Perform intent recognition based on the first voice information to obtain the intent information corresponding to the first voice information.
[0084] S203: Receive second voice information input by the user.
[0085] The second voice information is the voice information after silence detection.
[0086] S204; Compare the text identifier of the first voice information with the text identifier of the second voice information.
[0087] S205: When the text identifier of the first voice information is consistent with the text identifier of the second voice information, the intent information corresponding to the first voice information is output as the intent information of the second voice information.
[0088] S206: When the text identifier of the first voice information is inconsistent with the text identifier of the second voice information, determine the semantic information of the first voice information and the semantic information of the second voice information respectively.
[0089] S207: When the semantic information of the first speech information is consistent with the semantic information of the second speech information, the intent information of the first speech information is output as the intent information of the second speech information. It should be noted that the first speech information is speech information without silence detection. For example: after a user says "I want to listen to Andy Lau's songs," if the speech recognition service has already detected "I want to listen to Andy Lau's songs" before performing silence detection, then "I want to listen to Andy Lau's songs" can be used as the first speech information. After the user says "I want to listen to Andy Lau's songs" and the speech recognition service performs silence detection, then "I want to listen to Andy Lau's songs" is used as the second speech information.
[0090] Silence detection is a method to determine whether a user has finished speaking. After determining whether the user has finished speaking, a preset time is waited. If no new voice information is detected within the preset time, it means that the voice information input is complete. After the voice information input is complete, the speech recognition service and semantic scheduling service will perform intent recognition on the user's input voice information and return the intent recognition result to the user.
[0091] It should be noted that the preset duration can be set to 200ms, 300ms, and 400ms, etc., and this application embodiment does not impose specific limitations on this.
[0092] If the speech recognition service detects "I want to listen to Andy Lau's songs" before performing silence detection, then "I want to listen to Andy Lau's songs" can be used as the first speech information, and the main identifier of the first speech information can be set to A, and the secondary identifier can be set to B.
[0093] The secondary identifier of the first voice information represents the voice text corresponding to the first voice information.
[0094] The primary and secondary identifiers of the first voice information can be used as text identifiers for the first voice information.
[0095] For multiple voice packets generated during a single user interaction, when sending requests to the semantic service, multiple requests within the same interaction can be identified using the same session_id. The session_id can be used as the primary identifier to cache all requests within the same interaction. Since a single interaction will generate multiple requests, i.e., multiple voice texts corresponding to multiple voice messages, each voice text needs its own data to be cached. Therefore, the voice text is used as a secondary identifier in the cache.
[0096] After the silence detection is performed on "I want to listen to Andy Lau's songs", the second voice information becomes "I want to listen to Andy Lau's songs". At this time, the main identifier of the second voice information is still A, and the secondary identifier is still B. The main identifier and secondary identifier of the second voice information can be used as the text identifier of the second voice information.
[0097] If the first voice message is "I want to listen to Andy Lau's songs", and the text identifier of the first voice message is A as the primary identifier and B as the secondary identifier, and the second voice message is "I want to listen to Andy Lau's songs", and the primary identifier of the second voice message is A as the secondary identifier and B as the secondary identifier, then the text identifier of the first voice message is consistent with the text identifier of the second voice message. At this time, the intent information corresponding to the first voice message can be used as the intent information of the second voice message, and the intent information can be output to the user.
[0098] There are several ways to perform intent recognition on the first speech information. In one implementation: the first speech information is converted into text information, the intent information corresponding to the text information is obtained from the database, the matching degree between the text information and each intent information is determined, and the intent information with the highest matching degree is obtained as the intent information of the first speech information.
[0099] In another example, when a user says "I want to listen to Andy Lau's songs", "I want to listen", "I want to listen to Andy Lau", and "I want to listen to Andy Lau's songs" can all be used as the first voice information.
[0100] The intent information corresponding to each first voice message can be determined in advance. That is, when the first voice message is "I want to listen", it corresponds to the first intent information; when the first voice message is "I want to listen to Andy Lau", it corresponds to the second intent information; and when the first voice message is "I want to listen to Andy Lau's songs", it corresponds to the third intent information.
[0101] When the first voice message includes "I want to listen", "I want to listen to Andy Lau", and "I want to listen to Andy Lau's songs", the main identifier for this voice interaction can be set to A, the secondary identifier for the first voice message "I want to listen" can be set to B1, the secondary identifier for "I want to listen to Andy Lau" can be set to B2, and the secondary identifier for "I want to listen to Andy Lau's songs" can be set to B3. The secondary identifiers and the main identifier constitute the text identifier for the first voice message.
[0102] When the second voice message is "I want to listen to Andy Lau's songs", the main identifier of the second voice message is A and the secondary identifier is B3. Based on the second voice message, the first voice message from the previous round is obtained from each of the first voice messages, that is, the first voice message "I want to listen to Andy Lau's songs" without silence detection. The main identifier and secondary identifier of the first voice message are compared with the main identifier and secondary identifier of the second voice message. When the main identifier and secondary identifier of the first voice message are consistent with the main identifier and secondary identifier of the second voice message, it is considered that the text identifier of the first voice message is consistent with the text identifier of the second voice message. At this time, the third intent information corresponding to the first voice message "I want to listen to Andy Lau's songs" is used as the intent information of the second voice message, and the intent information is output to the user.
[0103] The aforementioned intent recognition method involves performing semantic understanding on the first speech information immediately after the user finishes speaking. After silence detection is completed, the second speech information is obtained. At this point, the audio-visual text of the first and second speech information may not have changed at all, so the returned result will definitely be consistent. In this case, the previous intent information, i.e., the intent information of the first speech information, can be used as the result and returned directly.
[0104] Analyzing and statistically processing logs from speech streaming recognition in typical domains revealed that in 27.69% of cases, the text information accompanying the first and second speech messages matched. This means that 27.69% of requests have the potential to save at least 500ms using the aforementioned intent recognition strategy.
[0105] To enable error tolerance, when both the first and second voice messages are "I want to listen to Andy Lau's songs", a response time for intent recognition of the first voice message "I want to listen to Andy Lau's songs" is determined. This response time is compared with a preset response time. If the response time is greater than or equal to the preset response time, intent recognition can be performed based on the second voice message to obtain the intent information corresponding to the second voice message, and this intent information is then output to the user terminal.
[0106] It should be noted that the preset response time can be set to 100ms, 200ms, 300ms, etc., and this application embodiment does not impose specific limitations on it.
[0107] If an error occurs during the intent recognition process of the first voice information, the intent recognition of the first voice information can be performed to obtain the intent information of the second voice information, and the intent information corresponding to the second voice information can be output.
[0108] During the process of intent recognition based on the first voice information, if the intent recognition of the first voice information is not completed, that is, the response time of the first voice information does not exceed the preset response time and the first voice information does not obtain the corresponding intent information, then wait for the intent information of the first voice information. After the intent recognition of the first voice information is completed, the intent information of the first voice information is output as the intent information of the second voice information.
[0109] If the response time of the first voice message does not exceed the preset response time, and the intent recognition of the first voice message is not yet complete, the intent information of the first voice message can be waited for in order to shorten the return result time. If the intent recognition of the first voice message is not yet complete, but is still in progress, the time spent waiting for the intent information of the first voice message is relatively shorter than the time spent re-recognizing the intent of the second voice message. Therefore, even if the intent recognition of the first voice message is not complete during the recognition process, waiting for the intent information of the first voice message will still shorten the response time.
[0110] Another way of intent recognition, such as Figure 4 As shown, it includes the following steps:
[0111] The following explanation assumes that the first voice information contains multiple instances:
[0112] S301: Receives the first voice information input by the user.
[0113] The first voice information is the voice information that has not undergone silence detection.
[0114] When a user says a sentence, such as "I want to listen to Andy Lau's songs," multiple first-person speech messages will be received during the process of saying this sentence, namely "I want to listen," "I want to listen to Andy Lau," and "I want to listen to Andy Lau's songs."
[0115] S302: Perform intent recognition on multiple first speech information to obtain intent information corresponding to the multiple first speech information.
[0116] The intents corresponding to the above-mentioned multiple first speech information are identified respectively, such as the intent information of "I want to listen", the intent information of "I want to listen to Andy Lau", and the intent information of "I want to listen to Andy Lau's songs".
[0117] S303: Receives second voice information input by the user.
[0118] The second voice information is the voice information after silence detection.
[0119] For example, the second voice message, after being silenced, is "I want to listen to Andy Lau's songs".
[0120] S304: Determine the first text identifier for each first voice information.
[0121] S305: Determine the second text identifier of the second voice information.
[0122] S306: Compare the second text identifier with each of the first text identifiers.
[0123] S307: When all the first text identifiers and the second text identifiers are inconsistent, determine the first semantic information corresponding to each first voice information, and determine the second semantic information corresponding to the second voice information.
[0124] When the first voice message includes "I want to listen," "I want to listen to Andy Lau," and "I want to listen to Andy Lau's songs," the main identifier for this voice interaction can be set to A, the secondary identifier for the first voice message "I want to listen" to be B1, the secondary identifier for "I want to listen to Andy Lau" to be B2, and the secondary identifier for "I want to listen to Andy Lau's songs" to be B3. The secondary identifiers and the main identifier constitute the text identifiers for the first voice message; the text identifier for "I want to listen" can be AB1, the text identifier for "I want to listen to Andy Lau" can be AB2, and the text identifier for "I want to listen to Andy Lau's songs" can be AB3. When the text identifier for the second voice message "I want to listen to Andy Lau's songs" is AB4, a comparison shows that the text identifiers for the first and second voice messages are inconsistent.
[0125] The first speech information of each first speech information is determined, and the second semantic information of each second speech information is determined. A semantic table of the first semantic information is generated according to the time sequence of reception of the first speech information. For example, the first semantic information of "I want to listen" is C1, the first semantic information of "I want to listen to Andy Lau" is C2, and the first semantic information of "I want to listen to Andy Lau's songs" is C3. Since "I want to listen" is received first, followed by "I want to listen to Andy Lau," and lastly "I want to listen to Andy Lau's songs," the semantic table of the first semantic information can be obtained as: C1, C2, C3.
[0126] The second semantic information of the second speech information is determined to be C3.
[0127] S308: Match the second semantic information with the first semantic information corresponding to each first voice message in the order in which they are received.
[0128] S309: Obtain the first target semantic information corresponding to the second semantic information from each first semantic information.
[0129] The second semantic information is compared with C1, C2, and C3 in turn.
[0130] S310: Determine the intent information corresponding to the first speech information corresponding to the first target semantic information, and output it as the intent information of the second speech information.
[0131] In the example above, the first semantic that matches the second semantic information is C3. C3 is then used as the first target semantic information, and the intent information corresponding to the first speech information is determined and output as the intent information of the second speech information.
[0132] When the textual identifiers of the first and second voice information are inconsistent, there are multiple ways to recognize the intent. In one such method, such as... Figure 5 As shown, it includes the following steps:
[0133] S401: When the text identifier of the first voice information is inconsistent with the text identifier of the second voice information, determine the semantic information of the first voice information and the semantic information of the second voice information respectively.
[0134] S402: When the semantic information of the first speech information is consistent with the semantic information of the second speech information, the intent information of the first speech information is output as the intent information of the second speech information.
[0135] When the first voice message is "I want to listen to Andy Lau" and the second voice message is "I want to listen to Andy Lau's songs", the main identifiers of the first and second voice messages are the same, but the secondary identifiers are different. Therefore, the text identifiers of the first and second voice messages are inconsistent.
[0136] The semantic information of the first voice message "I want to listen to Andy Lau" and the second voice message "I want to listen to Andy Lau's songs" are determined. The semantic information of the first voice message "I want to listen to Andy Lau's songs" is "I want to listen to Andy Lau's songs", and the semantic information of the second voice message "I want to listen to Andy Lau's songs" is also "I want to listen to Andy Lau's songs". Therefore, the semantic information of the first voice message "I want to listen to Andy Lau" and the second voice message "I want to listen to Andy Lau's songs" are the same. The intention information of the first voice message "I want to listen to Andy Lau" can be directly used as the intention information of the second voice message "I want to listen to Andy Lau's songs", so there is no need to perform intention recognition on the second voice message "I want to listen to Andy Lau's songs".
[0137] By pre-fetching the first voice message "I want to hear Andy Lau," processing can begin hundreds of milliseconds earlier, allowing the message to be returned to the user hundreds of milliseconds earlier, thus shortening the response time.
[0138] In another example, when the first voice information includes "I want to listen", "I want to listen to Andy Lau", and "I want to listen to Andy Lau's songs", semantic recognition and intent recognition can be performed on "I want to listen", "I want to listen to Andy Lau", and "I want to listen to Andy Lau's songs" respectively, and the semantic information and intent information corresponding to "I want to listen", "I want to listen to Andy Lau", and "I want to listen to Andy Lau's songs" respectively can be obtained. Upon receiving the second voice message, if the second voice message is "I want to listen to Andy Lau's songs," the system can sequentially match the second voice message with the text identifiers of "I want to listen," "I want to listen to Andy Lau," and "I want to listen to Andy Lau's songs." If the text identifier of the second voice message differs from that of the first voice message "I want to listen," the system determines the semantic information of the second voice message and matches it with the first voice message "I want to listen." If the semantic information is inconsistent, the system matches the text identifier of the first voice message "I want to listen to Andy Lau" with the text identifier of the second voice message. If the text identifier of the first voice message "I want to listen to Andy Lau" is inconsistent with that of the second voice message, the system determines whether the semantic information of the second voice message is consistent with the semantic information of the first voice message "I want to listen to Andy Lau." If the semantic information of the second voice message is the same as that of the first voice message "I want to listen to Andy Lau," the system uses the intent information of the first voice message "I want to listen to Andy Lau" as the intent information of the second voice message and outputs it to the user.
[0139] In the implementation method of determining the intent information corresponding to the first speech information corresponding to the first target semantic information and outputting it as the intent information of the second speech information, the resource information corresponding to the first target semantic information is obtained from the resource library, and the resource information is output as the intent information of the second speech information.
[0140] By using the aforementioned intent recognition method, data is retrieved in advance. When the first voice message corresponding to the first target semantic information is "I want to listen to Andy Lau," the corresponding music genre is analyzed in advance based on the first voice message, and the artist is identified as Andy Lau. Before the second voice message arrives, music resources for Andy Lau can be retrieved from the music service in advance, obtaining the intent information of the first voice message corresponding to the first target semantic information. After receiving the second voice message, if the textual identifiers of the first and second voice messages are inconsistent, but the semantic information of the first and second voice messages is consistent, the music resource data result for Andy Lau corresponding to the first voice message is directly returned to the user. This can save some of the time spent accessing external music services.
[0141] By analyzing and statistically analyzing the logs of speech streaming recognition in typical fields, the statistical results show that the percentage of cases with consistent semantic information is 45.9%.
[0142] If there is no semantic information in the first speech information that is consistent with the semantic information of the second speech information, then the intent can be identified based on the second speech message to obtain the intent information corresponding to the second speech information, and the intent information corresponding to the second speech information can be output.
[0143] To enable fault tolerance, if an error occurs during the intent recognition process of the first voice information, intent recognition can be performed on the first voice information to obtain the intent information of the second voice information, and the intent information corresponding to the second voice information can be output.
[0144] During the process of intent recognition based on the first voice information, if the intent recognition of the first voice information is not completed, that is, the response time of the first voice information does not exceed the preset response time and the first voice information does not obtain the corresponding intent information, then wait for the intent information of the first voice information. After the intent recognition of the first voice information is completed, the intent information of the first voice information is output as the intent information of the second voice information.
[0145] If the response time of the first voice message does not exceed the preset response time, and the intent recognition of the first voice message is not yet complete, the intent information of the first voice message can be waited for in order to shorten the return result time. If the intent recognition of the first voice message is not yet complete, but is still in progress, the time spent waiting for the intent information of the first voice message is shorter than the time spent re-recognizing the intent of the second voice message. Therefore, even if the intent recognition of the first voice message is not complete during the recognition process, waiting for the intent information of the first voice message will still shorten the response time.
[0146] Please refer to Figure 6 This application embodiment also provides an application for Figure 2 The intention recognition device 110 of the electronic device 100 includes:
[0147] The receiving module 111 is used to receive first voice information input by the user, wherein the first voice information is voice information without silence detection;
[0148] The intent recognition module 112 is used to perform intent recognition based on the first voice information to obtain intent information corresponding to the first voice information;
[0149] The receiving module 111 is further configured to: receive second voice information input by the user, wherein the second voice information is voice information after silence detection;
[0150] Comparison module 113 is used to compare the text identifier of the first voice information with the text identifier of the second voice information;
[0151] The output module 114 is used to output the intent information corresponding to the first voice information as the intent information of the second voice information when the text identifier of the first voice information is consistent with the text identifier of the second voice information.
[0152] The determining module 115 is used to determine the semantic information of the first voice information and the semantic information of the second voice information respectively when the text identifier of the first voice information and the text identifier of the second voice information are inconsistent.
[0153] The output module 114 is further configured to output the intent information of the first voice information as the intent information of the second voice information when the semantic information of the first voice information is consistent with the semantic information of the second voice information.
[0154] This application also provides an electronic device 100, which includes a processor 130 and a memory 120. The memory 120 stores computer-executable instructions, which, when executed by the processor 130, implement the intent recognition method.
[0155] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor 130, implements the intent recognition method.
[0156] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0157] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part. If the function is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.
[0158] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0159] The above descriptions are merely various embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An intent recognition method, characterized in that, The method includes: Receive first voice information input by the user, wherein the first voice information is voice information without silence detection; Intent recognition is performed based on the first voice information to obtain the intent information corresponding to the first voice information; Receive second voice information input by the user, wherein the second voice information is voice information after silence detection; Compare the text identifier of the first voice information with the text identifier of the second voice information; When the text identifier of the first voice information is consistent with the text identifier of the second voice information, the intent information corresponding to the first voice information is output as the intent information of the second voice information. When the text identifier of the first voice information is inconsistent with the text identifier of the second voice information, the semantic information of the first voice information and the semantic information of the second voice information are determined respectively. When the semantic information of the first voice information is consistent with the semantic information of the second voice information, the intent information of the first voice information is output as the intent information of the second voice information.
2. The method according to claim 1, characterized in that, The first voice information includes multiple components; the step of performing intent recognition based on the first voice information to obtain intent information corresponding to the first voice information includes: Perform intent recognition on multiple first speech information to obtain intent information corresponding to the multiple first speech information; The step of comparing the text identifier of the first voice information with the text identifier of the second voice information includes: Determine the first text identifier for each of the first voice information; Determine the second text identifier of the second voice information; Compare the second text identifier with each of the first text identifiers; The step of determining the semantic information of the first voice information and the semantic information of the second voice information respectively when the text identifier of the first voice information is inconsistent with the text identifier of the second voice information includes: When all the first text identifiers and the second text identifiers are inconsistent, determine the first semantic information corresponding to each of the first voice information, and determine the second semantic information corresponding to the second voice information. The step of outputting the intent information of the first voice information as the intent information of the second voice information when the semantic information of the first voice information is inconsistent with the semantic information of the second voice information includes: The second semantic information is matched sequentially with the first semantic information corresponding to each of the first voice messages according to the time order in which each of the first voice messages is received; Obtain the first target semantic information corresponding to the second semantic information from each of the first semantic information; The intent information corresponding to the first speech information corresponding to the first target semantic information is determined and output as the intent information of the second speech information.
3. The method according to claim 2, characterized in that, The step of determining the intent information corresponding to the first speech information corresponding to the first target semantic information and outputting it as the intent information of the second speech information includes: Obtain the resource information corresponding to the first target semantic information from the resource library; The resource information is output as the intent information of the second voice information.
4. The method according to claim 1, characterized in that, The method further includes: During the process of intent recognition based on the first voice information, if the response time of intent recognition of the first voice information exceeds the preset response time, then intent recognition is performed based on the second voice information to obtain the intent information corresponding to the second voice information. Output the intent information of the second voice message.
5. The method according to claim 1, characterized in that, The method further includes: During the process of intent recognition based on the first voice information, if the intent recognition of the first voice information is not completed, the process waits for the intent information of the first voice information. After the first voice information completes the intent recognition, the intent information of the first voice information is output as the intent information of the second voice information.
6. The method according to claim 1, characterized in that, The method further includes: When the semantic information of the first voice information is inconsistent with the semantic information of the second voice information, the intent recognition is performed based on the second voice message to obtain the intent information corresponding to the second voice information. Output the intent information corresponding to the second voice information.
7. The method according to claim 1, characterized in that, The step of receiving the second voice information input by the user includes: Receive voice input from the user while the user speaks; If no other voice information is received from the user within a preset time period, the voice information input by the user will be used as the second voice information.
8. The method according to claim 1, characterized in that, The step of performing intent recognition based on the first voice information to obtain intent information corresponding to the first voice information includes: Convert the first voice information into text information; Retrieve the intent information corresponding to the text information from the database; Determine the matching degree between the text information and each of the intent information; The intent information with the highest matching degree is obtained as the intent information of the first voice information.
9. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method according to any one of claims 1-8.
10. A readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1-8.