Text error correction method and electronic device
Through the combination of the intention recognition model and the error correction model, the problems of multiple words, missing words and typos in the text after speech recognition are solved, and high accuracy correction of intentions and slots are achieved.
Patent Information
- Application Number
- CN202011565185.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-25
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2040-12-25
AI Technical Summary
In the prior art, when processing texts after speech recognition, it is difficult to effectively correct the problems of multiple words, missing words and typos, especially when the recognized attribute information range is inaccurate, the error correction logic cannot be correctly executed.
A text error correction method is adopted to identify the intent and slots of the text through the intent recognition model, and select the corresponding general error correction model or domain error correction model for error correction based on the intent.
When there are multiple words, missing words and typos in the identified text, or if the identified attribute information range is inaccurate, text error correction can still be carried out with high accuracy to ensure the accuracy of the identification intention and slot.
Smart Images

Figure CN114692639B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of error correction, and in particular to a text error correction method and electronic device. Background Art
[0002] With the popularization of smart devices and the development of natural language processing technology, voice input has become an increasingly important means of human-computer interaction due to its convenience and speed. However, due to the complexity and diversity of language and the influence of surrounding noise, the results of voice recognition often deviate greatly from what the user actually wants to input. This requires further error correction processing of the text after voice recognition before it can be applied to actual systems.
[0003] For further error correction processing of the text after speech recognition, one solution is to perform search intent recognition on the text after speech recognition, and after determining the corresponding attribute information, perform error correction by calculating the similarity between the attribute information and the words in the candidate vocabulary. The candidate vocabulary maintenance format is a mapping vocabulary from error-prone words to error correction words. The error-prone words in the vocabulary are matched in turn through the text similarity function, and the error correction word corresponding to the error-prone word with the highest similarity is selected as the error correction result. However, when text errors cause errors in intent recognition, this solution cannot correctly execute the error correction logic. At the same time, this solution uses an error-prone dictionary to delimit the erroneous words. When the attribute information range extracted by the intent recognition method is inaccurate and the extracted words are not included in the error-prone dictionary, it cannot provide error correction capabilities.
[0004] Another solution is to perform dictionary matching on the text after intent recognition, identify the prefix words of the dictionary matching words, define the possible intent results corresponding to the combination of the prefix words and the fields to which the dictionary matching words belong as error correction rules, and execute the rules to determine whether the possible intent results identified by the dictionary match the intent output by the model. When the results do not match, modify the intent recognition results and output the correct recognition results. Similarly, when there are typos, extra words, or missing words in the recognized text that cause the dictionary to be unable to match, the error correction capability of this solution for intent will not take effect. Summary of the invention
[0005] The present application provides a text error correction method and electronic device, which can solve the problem that when there are multiple words, missing words and wrong words in the recognized text, making it impossible to correct the error, or when the recognized attribute information range is inaccurate, making it impossible to correct the error, the recognized information can still be corrected with high accuracy to ensure the accuracy of the recognition intent and slots.
[0006] In a first aspect, a text correction method is provided, which is applied to an electronic device and includes: receiving a first text; identifying the intent and slot of the first text using an intent recognition model; selecting a corresponding error correction model for error correction based on the intent, the error correction model including a general error correction model and / or a domain error correction model; and outputting a target text after error correction.
[0007] The solution provided by the present application is that the electronic device selects the corresponding error correction model for error correction based on the intent recognized by the intent recognition model. When there are multiple words, missing words, and wrong words in the recognized text, which makes it impossible to correct the errors, or when the recognized attribute information range is inaccurate, which makes it impossible to correct the errors, the intent and slots can still be corrected uniformly to ensure the accuracy of the recognized intent and slots.
[0008] In conjunction with the first aspect, in some possible implementations, selecting a corresponding error correction model according to the intent to perform error correction includes:
[0009] If the intent does not have a corresponding domain error correction model, use the general error correction model to perform error correction;
[0010] If the intent has a corresponding domain error correction model, the domain error correction model is used for error correction.
[0011] The domain error correction model of the present application may include error correction models for multiple domains, and corresponding domain error correction models may be used for error correction in different domains. For example, the domain error correction model may include multiple domains such as audio and video domain, location domain, name domain, etc., without limitation.
[0012] Of course, in some embodiments, the domain error correction model can also be obtained based on category or type classification without limitation.
[0013] It should also be noted that there is no restriction on the division of the above fields. The audio and video fields can be divided into one category, and the audio and video fields can be corrected using the error correction model for all intents belonging to the audio and video fields; the audio and video fields can also be divided into two separate categories, and the audio field error correction model can be used to correct the intent belonging to the audio field, and the video field error correction model can be used to correct the intent belonging to the video field; there is no restriction. In addition, the fields included in the error correction model of this field can be updated regularly or irregularly to improve the error correction capability.
[0014] The solution provided by the present application uses a general error correction model to perform error correction when there is no corresponding domain error correction model for the intention of the first text recognized by the electronic device. When there is a corresponding domain error correction model for the intention of the first text recognized by the electronic device, error correction is performed using the corresponding domain error correction model, which can further ensure the accuracy of the recognized intent and slot.
[0015] In combination with the first aspect, in some possible implementations, the method further includes: outputting a response of the target text.
[0016] The response to the target text in the present application can be information related to the target text. For example, the target text in the embodiment of the present application is "Play The Wandering Earth", and the response to the target text is a video related to The Wandering Earth, such as Video 1: The movie of The Wandering Earth; Video 2: The behind-the-scenes footage of The Wandering Earth; Video 3: Celebrity information about The Wandering Earth; Video 4: The MV about The Wandering Earth; Video 5: A documentary about The Wandering Earth, etc.
[0017] The solution provided in the present application, in addition to outputting the above-mentioned corrected target text, can also output a response to the target text, that is, information related to the target text, from which the user can select the required information, thereby improving the user experience.
[0018] In conjunction with the first aspect, in some possible implementations, outputting the error-corrected target text includes:
[0019] The target text is output according to the error correction result and the confidence value.
[0020] According to the solution provided by the present application, the electronic device can output the target text according to the error correction result and the confidence value, which can further ensure the accuracy of the recognition intention and the slot.
[0021] In conjunction with the first aspect, in some possible implementations, the identifying the intent and slot of the first text by using the intent recognition model includes:
[0022] Using the intent recognition model to recognize the intent and slot of the first text, and obtain a first confidence value;
[0023] The selecting a corresponding error correction model to perform error correction according to the intention includes:
[0024] Selecting a corresponding error correction model according to the intention to perform error correction and obtaining a second confidence value;
[0025] Outputting the target text according to the error correction result and the confidence value includes:
[0026] Using the intention recognition model to identify the intention and slot of a second text, and obtaining a third confidence value, the second text being a text after error correction of the first text or a text after slot replacement of the first text after error correction;
[0027] The target text is output according to the first confidence value, the second confidence value, and the third confidence value.
[0028] The solution provided in the present application is that the electronic device outputs the target text according to the first confidence value corresponding to the first text recognized by the intention recognition model, the second confidence value corresponding to the first text corrected by the error correction model, and the third confidence value corresponding to the second text recognized by the intention recognition model, thereby further ensuring the accuracy of the recognized intent and slot.
[0029] In combination with the first aspect, in some possible implementations, if the domain error correction model is selected for error correction, outputting the target text according to the first confidence value, the second confidence value, and the third confidence value includes:
[0030] If the third confidence value is greater than or equal to the first confidence value, determining a first joint error correction confidence value of the second text according to the first confidence value and the second confidence value, the second text being a text obtained by slot replacement of the first text after error correction, and the first joint error correction confidence value including a plurality of confidence values;
[0031] Output the target text corresponding to the maximum confidence value among the first joint error correction confidence values.
[0032] In the solution provided by the present application, when the electronic device chooses to use the domain error correction model for error correction, if the third confidence value is greater than or equal to the first confidence value, the target text corresponding to the maximum confidence value in the first joint error correction confidence value is output. Since the third confidence value is greater than or equal to the first confidence value, it can be considered that the error correction result after the first text is corrected is correct. Therefore, the second confidence value and the first confidence value can be used to determine the first joint error correction confidence value of the second text, and the target text corresponding to the maximum confidence value is output to ensure the accuracy of the recognized intent and slot.
[0033] In combination with the first aspect, in some possible implementations, the multiple confidence values included in the first joint error correction confidence value are obtained by multiplying the confidence values with the same intention in the first confidence value and the second confidence value.
[0034] In combination with the first aspect, in some possible implementations, the method further includes:
[0035] If the third confidence value is less than the first confidence value, reducing the second confidence value;
[0036] Determining a second joint error correction confidence value of the second text according to the first confidence value and the reduced second confidence value, wherein the second joint error correction confidence value includes a plurality of confidence values;
[0037] Output the target text corresponding to the maximum confidence value among the second joint error correction confidence values.
[0038] The solution provided by the present application is that when the electronic device chooses to use the domain error correction model for error correction, if the third confidence value is less than the first confidence value, the target text corresponding to the maximum confidence value in the second joint error correction confidence value is output, and the second joint error correction confidence is determined based on the first confidence value and the reduced second confidence value. Since the third confidence value is less than the first confidence value, it can be considered that the error correction result after the first text is corrected is incorrect. Therefore, the second joint error correction confidence value of the second text can be determined using the reduced second confidence value and the first confidence value, and the target text corresponding to the maximum confidence value is output, so as to avoid recognition errors caused by incorrect error correction as much as possible.
[0039] In combination with the first aspect, in some possible implementations, the multiple confidence values included in the second joint error correction confidence value are obtained by multiplying the first confidence value and the reduced second confidence value having the same confidence value as the first confidence value.
[0040] In combination with the first aspect, in some possible implementations, if the general error correction model is selected for error correction, outputting the target text according to the first confidence value, the second confidence value, and the third confidence value includes:
[0041] Determining a third joint error correction confidence value of the second text according to the second confidence value and the third confidence value, wherein the second text is a text after error correction of the first text;
[0042] Output the target text corresponding to the maximum confidence value between the first confidence value and the third joint error correction confidence value.
[0043] The solution provided by the present application is that the electronic device chooses to use a universal error correction model for error correction, determines a third joint error correction confidence value of the second text based on the second confidence value and the third confidence value, and outputs the target text corresponding to the largest confidence value. This can achieve error correction even when there is no corresponding domain error correction model for the recognized intent, so as to further improve the accuracy of the recognized intent and slot.
[0044] In combination with the first aspect, in some possible implementations, the third joint error correction confidence value is obtained by multiplying the second confidence value and the third confidence value.
[0045] In combination with the first aspect, in some possible implementations, if the second confidence value and the third confidence value respectively include multiple confidence values, then the third joint error correction confidence value includes multiple confidence values, and the multiple confidence values included in the third joint error correction confidence value are obtained by multiplying the confidence values with the same intention in the second confidence value and the third confidence value.
[0046] In the solution provided by the present application, when the second confidence value and the third confidence value respectively include multiple confidence values, the multiple confidence values included in the third joint error correction confidence value are obtained by multiplying the confidence values with the same intention in the second confidence value and the third confidence value, which can further ensure the accuracy of the identified intention and slot.
[0047] In a second aspect, a device is provided, which is included in an electronic device, and has the function of implementing the electronic device behavior in the above aspects and possible implementations of the above aspects. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions.
[0048] In a third aspect, an electronic device is provided, comprising: one or more processors; a memory; one or more applications; and one or more computer programs. The one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the electronic device, the electronic device executes the text error correction method in any possible implementation of the first aspect.
[0049] In a fourth aspect, a chip system is provided, comprising at least one processor, wherein when program instructions are executed in the at least one processor, the function of the text error correction method in any possible implementation of the first aspect described above is implemented on the electronic device.
[0050] In a fifth aspect, a computer storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the text error correction method in any possible implementation of the first aspect.
[0051] In a sixth aspect, a computer program product is provided. When the computer program product is run on an electronic device, the electronic device executes the text error correction method in any possible design of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0053] Figure 2It is a schematic diagram of the software structure of an electronic device provided in an embodiment of the present application.
[0054] Figure 3 It is a schematic diagram of a group of GUIs provided in an embodiment of the present application.
[0055] Figure 4 It is a schematic flow chart of a text error correction method provided in an embodiment of the present application.
[0056] Figure 5 It is a schematic flowchart of another text error correction method provided in an embodiment of the present application.
[0057] Figure 6 It is a schematic flow chart of another text error correction method provided in an embodiment of the present application.
[0058] Figure 7 It is a schematic block diagram of another electronic device provided in an embodiment of the present application.
[0059] Figure 8 It is a schematic block diagram of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0061] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0062] The present application provides a text error correction method. The electronic device recognizes the content input by the user by combining the intent recognition model and the error correction model. When there are problems such as multiple words, missing words and wrong words in the recognized text, which make it impossible to correct the error, or when the recognized attribute information range is inaccurate and makes it impossible to correct the error, the intent and slot can still be corrected uniformly to ensure the accuracy of the recognized intent and slot.
[0063] The text error correction method provided in the embodiments of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0064] For example, Figure 1 1 shows a schematic diagram of the structure of the electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0065] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0066] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural network processor (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. The recognition of the intent and slot of the original text using the intent recognition model, the error correction of the recognized intent and slot using the error correction model, and the processing of the error correction results in the embodiment of the present application can all be implemented by the processor 110.
[0067] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0068] A memory may also be provided in the processor 110 for storing instructions and data, for example, it may be used to store the intent recognition model or error correction model (including a domain error correction model and a general error correction model) in the present application. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
[0069] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0070] The charging management module 140 is used to receive charging input from a charger, where the charger can be a wireless charger or a wired charger.
[0071] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
[0072] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0073] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0074] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0075] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0076] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0077] The display screen 194 is used to display images, videos, etc. In the embodiment of the present application, the text of the user's input voice after recognition and information related to the text can be displayed. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0078] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0079] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0080] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0081] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0082] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When sending voice information, the user can speak by approaching the microphone 170C with his mouth to input the sound signal into the microphone 170C (such as in the embodiment of the present application, the user can input voice through the microphone 170C). The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.
[0083] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0084] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A.
[0085] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0086] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.
[0087] Figure 2 1 is a software structure diagram of the electronic device 100 of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer. The application layer can include a series of application packages.
[0088] like Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, voice assistant (also known as smart voice), etc.
[0089] Optionally, in some embodiments, the voice assistant may also be an application framework layer, and the voice assistant may be called through a preset interface.
[0090] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0091] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0092] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos (such as the video about The Wandering Earth in this application), images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0093] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0094] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0095] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0096] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0097] A 2D graphics engine is a drawing engine for 2D drawings.
[0098] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0099] In order to facilitate understanding of the solution of the present application, the terms involved in the present application are first explained below.
[0100] 1. Text correction
[0101] The main purpose of text error correction is to detect errors in the original text input and correct them based on natural language processing technology. The original text can be the scanned recognition results of text content in books and newspapers, the content in social networks such as Sina Weibo and WeChat Moments, or the user input voice recognized by the automatic speech recognition (ASR) module. These texts will inevitably contain certain errors (or non-standard terms), which will lead to a decrease in the accuracy of subsequent processing (such as text translation, text entity recognition, intent recognition, etc.).
[0102] Based on the target object of error correction, error correction models can be roughly divided into two categories: general error correction models and domain error correction models.
[0103] The correction object of the general error correction model is text with no limited fields. It mainly detects and corrects errors by introducing pronunciation, glyphs, grammar, knowledge base and language model features.
[0104] The correction object of the domain correction model is the text in a limited domain. It mainly obtains the correction text by constructing a domain dictionary or domain library and using a fuzzy matching algorithm.
[0105] 2. Intent Recognition
[0106] Intent recognition (in a broad sense, natural language understanding (NLU)) is one of the important basic capabilities of voice assistants. Its main purpose is to understand the operation that the user wants to perform corresponding to the natural language text description entered by the user, and describe the operation with intent (intent, the corresponding action or field of the operation in the target system) and slot (slot, the parameter required to complete the operation), and convert it into an interface call or application execution action on the corresponding system through the task execution model, and return the corresponding execution result to achieve the effect of initiating the operation through natural language.
[0107] Intent recognition relies on the understanding of semantic information in the natural language sentences input by the user. If the text contains typos, extra words, missing words, etc. due to improper user language or ASR recognition errors, the accuracy of intent recognition will be affected and the voice assistant will not be able to correctly handle the operations the user wants to perform.
[0108] For ease of understanding, the following embodiments of the present application will be described in detail with Figure 1 and Figure 2Taking the mobile phone with the shown structure as an example, the text error correction method provided by the embodiments of the present application will be specifically described in conjunction with the accompanying drawings.
[0109] Figure 3 A group of GUIs of the mobile phone is shown. Among them, from Figure 3 (a) in Figure 3 to (d) in shows the error correction method when the voice assistant in the mobile phone recognizes the voice errors issued by the user.
[0110] Refer to Figure 3 the GUI shown in (a) in. This GUI is the desktop of the mobile phone. After the mobile phone detects the operation that the user clicks on the icon 301 of the voice assistant on the desktop, the voice assistant can be started, and the GUI shown in Figure 3 (b) in is displayed. This GUI can be called the voice input interface.
[0111] Refer to Figure 3 the GUI shown in (b) in. The rectangular frame with multiple vertical bars shown in the figure can be called the "voice recognition frame" and is used to recognize the voice input by the user.
[0112] In the actual scenario, the multiple vertical bars in this "voice recognition frame" can be continuously in dynamic change. The vertical bars shown in the figure are only exemplary representations and should not cause special limitations to the present application.
[0113] Figure 3 (b) in also shows the text that the user may or often uses the voice assistant to recognize, such as "Wake me up at 8 o'clock tomorrow morning", "Turn on the flashlight", "Turn up the sound to the maximum", etc. shown in the figure.
[0114] After starting the voice assistant, the user can input "Play The Wandering Earth" by voice. If the user's pronunciation is relatively standard and clear, the voice assistant can accurately recognize the voice input by the user, that is, the recognized text is "Play The Wandering Earth", then the GUI shown in Figure 3 (c) in is displayed; if the user's pronunciation is partial to dialect or unclear, the voice assistant may misrecognize the voice input by the user. For example, the recognized text may be "Play Fang The Wandering Earth" or "Play Liu Nang The Wandering Earth", then the GUI shown in Figure 3 (d) in is displayed.
[0115] Refer to Figure 3In the GUI shown in (c) of FIG. 1 , the upper right corner of the figure shows the text after the correct recognition. At this time, since the text recognized by the voice assistant is correct, the mobile phone interface can display multiple videos about The Wandering Earth found by the user (such as Video 1: The Wandering Earth movie; Video 2: The Wandering Earth highlights; Video 3: The Wandering Earth celebrity information; Video 4: The Wandering Earth MV; Video 5: The Wandering Earth documentary, etc.). For the multiple videos displayed, the user can further select the video he wants to play.
[0116] See also Figure 3 In the GUI shown in (d) in the figure, the text after the recognition error is displayed in the upper right corner, such as "play the Wandering Earth" or "play the Wandering Earth". At this time, the voice assistant searches based on the recognized text and does not find relevant content. The mobile phone interface can display: "No relevant content found, try playing the Wandering Earth that I found", as well as multiple videos about the Wandering Earth found for the user (such as video 1: the movie of the Wandering Earth; video 2: the highlights of the Wandering Earth; video 3: celebrity information about the Wandering Earth; video 4: the MV about the Wandering Earth; video 5: the documentary about the Wandering Earth, etc.). For the multiple videos displayed, the user can further select the video he wants to play.
[0117] The following is combined with Figure 4 The internal implementation process and judgment logic of the electronic device in the embodiment of the present application are introduced. Figure 4 An internal algorithm flow chart of an electronic device provided in an embodiment of the present application is shown.
[0118] S410: Receive original text input by a user.
[0119] The original text in the embodiment of the present application can be the text after the user's voice is recognized by the ASR module, or it can be the text after scanning the text in books and newspapers, or it can be the text of social networks (such as Weibo, WeChat Moments), without limitation.
[0120] Regarding the content of the user's voice input, during the process of the ASR module recognizing the user's voice input, the content of the user's voice input may be correctly recognized, or recognition errors may occur due to the user's pronunciation problem.
[0121] For example, suppose the user inputs the voice: "Play The Wandering Earth". If the user's pronunciation is standard and clear, the text correctly recognized by the ASR module is "Play The Wandering Earth"; if the user's pronunciation is not standard or clear, the ASR module may mistakenly recognize it as: "Play Fang The Wandering Earth" or "Play Liu Nang Earth".
[0122] S420: Identify the intent and slots of the original text using an intent recognition model.
[0123] The intent recognition model in this application can be a training model, a statistical model, a network model, etc., and there is no limitation on this.
[0124] As described above, the text input by the user can be described as the operation that the user wants to perform. The operation can be represented by intent and slot, and the intent can be understood as the action or field corresponding to the operation, and the slot can be understood as the parameter required to complete the operation.
[0125] For example, if the user inputs the voice: "Play The Wandering Earth", and the ASR module correctly recognizes the user's input voice, then the corresponding intention after identification by the intent recognition model may be playing video or playing music, and the corresponding slot is The Wandering Earth.
[0126] For another example, if the user inputs the voice still as: "Play The Wandering Earth", but the ASR module mistakenly recognizes it as: "Play The Wandering Earth", then after using the intent recognition model to identify the corresponding intent, it may be web search or making a phone call, and the corresponding slot is The Wandering Earth.
[0127] For another example, if the user inputs the voice still as: "Play The Wandering Earth", but the ASR module mistakenly recognizes it as: "Play The Wandering Earth", then the intent recognition model will identify the corresponding intent as playing video or playing music, and the corresponding slot is The Wandering Earth.
[0128] S430: Use the error correction model to correct the identified intent and slot to obtain an error correction result.
[0129] The error correction model in this application may include a general error correction model and a domain error correction model. As mentioned above, the error correction object of the general error correction model is text without domain limitation, while the object of the domain error correction model is text with limited domain.
[0130] It should be noted that the domain error correction model may include error correction models for multiple domains, and corresponding domain error correction models may be used for error correction in different domains. For example, the domain error correction model may include multiple domains such as audio and video domain, location domain, and name domain, without limitation.
[0131] Of course, in some embodiments, the domain error correction model can also be obtained based on category or type classification without limitation.
[0132] If the intent identified by the intent recognition model is in the audio and video field, the error correction model in the audio and video field is used to correct it; if the intent identified by the intent recognition model is in the location field, the error correction model in the location field is used to correct it. Of course, in some embodiments, if the intent identified by the intent recognition model is web search, no domain error correction model is available.
[0133] It should also be noted that there is no restriction on the division of the above-mentioned fields. The audio and video fields can be divided into one category, and the error correction model of the audio and video field can be used to correct errors for those that are intended to belong to the audio and video field. The audio and video fields can also be divided into two separate categories, and the error correction model of the audio field can be used to correct errors for those that are intended to belong to the audio field, and the error correction model of the video field can be used to correct errors for those that are intended to belong to the video field. There is no restriction.
[0134] In addition, the fields included in the field error correction model can be updated regularly or irregularly to improve the error correction capability.
[0135] like Figure 5 As shown, when the error correction model is used to correct the identified intent and slot in step S430, steps S431 to S433 may be included.
[0136] S431, determining whether the intent of the original text identified by the intent recognition model has a corresponding domain error correction model.
[0137] If yes, execute step S432, that is, the domain error correction model can be used for error correction; if no, execute step S433, that is, the general error correction model can be used for error correction.
[0138] The two possible situations mentioned above will be explained below respectively.
[0139] Solution 1: There is an available domain error correction model, and the domain error correction model is used for error correction
[0140] Assume that the user inputs the voice "Play The Wandering Earth", and the ASR module recognizes it as "Play The Wandering Earth". The intent recognition model is used to identify the intent and slot of the text recognized by the ASR module.
[0141] During the recognition process using the intent recognition model, if the keyword "play" is matched, the intent may be recognized as music playback or video playback, and a corresponding confidence value may be given.
[0142] For example, if the recognized intent is music playing, the recognition result is: <Intent: music playing, slot: Streaming Earth, confidence value: 0.7>;
[0143] If the recognized intent is video playback, the recognition result is: <Intent: video playback, slot: stream capsule earth, confidence value: 0.7>.
[0144] After the intent recognition model completes the recognition, the error correction model corrects the above recognition results. At this time, the recognized intent includes music playback and video playback. There is an available domain error correction model. Therefore, you can choose to use the domain error correction model for error correction.
[0145] For those intended to play music, the corresponding slot is input into the audio domain error correction model, and the audio domain error correction model outputs the error correction result: "The Wandering Earth Theme Song" and the corresponding confidence value 0.5.
[0146] For the intention of video playback, the corresponding slot is input into the video domain error correction model, and the video domain error correction model outputs the error correction result: "The Wandering Earth" and the corresponding confidence value 0.9.
[0147] Solution 2: No domain error correction model is available, so use a general error correction model for error correction
[0148] Assume that the user inputs the voice "play The Wandering Earth", and the ASR module recognizes it as "play Fang The Wandering Earth". The intent recognition model is used to identify the intent and slot of the text recognized by the ASR module.
[0149] During the recognition process using the intent recognition model, if the keyword "play" is not matched, the intent may be mistakenly recognized as a web search or a phone call, and a corresponding confidence value may be given.
[0150] For example, if the recognized intent is web search, the recognition result is: <Intent: web search, slot: The Wandering Earth, confidence value: 0.5>;
[0151] If the recognized intention is to make a phone call, the recognition result is: <Intent: Make a phone call, slot: The Wandering Earth, confidence value: 0.3>.
[0152] After the intent recognition model completes the recognition, the error correction model corrects the above recognition results. At this time, since the recognized intent is web search or making a phone call, there is no available domain error correction model. Therefore, you can choose to use the general error correction model for error correction.
[0153] The general error correction model adopts an error-prone dictionary implementation method to correct the text recognized by the ASR module, and gives the corrected text and the corresponding confidence value. For example, the corrected text is "Play The Wandering Earth" and the corresponding confidence value is 0.9.
[0154] It should be understood that the numerical values in Scheme 1 and Scheme 2 are for illustrative purposes only and may also be other numerical values, and should not constitute any particular limitation to the present application.
[0155] S440: Process the error correction result using a post-processing module to obtain a judgment result.
[0156] S450: Reorder the obtained results.
[0157] In the embodiments of the present application, the post-processing module processes the error correction using the domain error correction model in the above-mentioned solution one and the error correction using the general error correction model in the above-mentioned solution two in different ways. Please see below for details.
[0158] Solution 1:
[0159] For the corrections made using the domain correction model, since the domain correction model corrects the slots, the slots in the corrected text can be replaced with random entities in the domain and re-input into the intent recognition model for intent and slot recognition. If the confidence value after re-recognition is greater than or equal to the confidence value obtained by correcting the slots of the original text using the domain correction model, the correction result can be considered correct; otherwise, the correction result can be considered incorrect.
[0160] As described in the above step S430, for the intention in the music field, the text corrected by the audio field correction model is "Play The Wandering Earth Theme Song". In this case, random entities in the music field (such as Seven-Li Fragrant Osmanthus) can be used to replace "The Wandering Earth Theme Song" and "Play Seven-Li Fragrant Osmanthus" can be input into the intention recognition model for re-recognition.
[0161] The confidence value obtained by correcting the slots of the original text using the audio domain error correction model is 0.5. If the confidence value of "play Seven-Li Fragrance" re-identified by the intent recognition model is greater than or equal to 0.5 (such as the confidence value of "play Seven-Li Fragrance" re-identified by the intent recognition model is 0.6), then the correction of "play The Wandering Earth" to "play The Wandering Earth's theme song" is considered correct.
[0162] For intents in the video domain, the text corrected by the video domain correction model is "Play The Wandering Earth". Then, "The Wandering Earth" can be replaced by a random entity (Wolf Warrior) in the video domain, and "Play Wolf Warrior" can be input into the intent recognition model for re-recognition. If the confidence value after re-recognition is greater than or equal to the confidence value of the original text slot corrected by the domain correction model, the above correction result can be considered correct; otherwise, the above correction result can be considered wrong.
[0163] Similarly, the confidence value obtained by correcting the slots of the original text using the video field error correction model is 0.9. If the confidence value of "Play Wolf Warrior" re-identified by the intent recognition model is greater than or equal to 0.9 (such as the confidence value of "Play Wolf Warrior" re-identified by the intent recognition model is 1.0), then the correction of "Play The Wandering Earth" to "Play The Wandering Earth" is considered correct.
[0164] Under the condition that the above process is determined to be correct, for different fields, the confidence values of the original text and the confidence values of the corrected text in their respective fields are processed to obtain a joint correction result.
[0165] Similarly, the processing in the present application can be understood as processing the confidence value obtained by correcting the slots of the original text using the error correction model and the confidence value obtained by recognizing the original text using the intent recognition model. The processing may include taking the average of the two confidence values (including the arithmetic mean, the root mean square average, the weighted average, etc.), or multiplying the two confidence values, etc., without limitation.
[0166] For example, taking the multiplication of these two confidence values, for the intention of music playback, the confidence value obtained using the error correction model is 0.5, and the confidence value obtained by recognizing the original text using the intent recognition model is 0.7. The confidence value after joint error correction is 0.35.
[0167] For the intent of video playback, the confidence value obtained by using the error correction model is 0.9, and the confidence value obtained by using the intent recognition model to recognize the original text is 0.7. The confidence value after joint error correction is 0.63.
[0168] Finally, the obtained results can be sorted and the intent and slot results with the highest confidence values can be output.
[0169] The result here can be understood as the confidence value after joint error correction, including: the confidence value after joint error correction of the intent of music playback is 0.35, and the confidence value after joint error correction of the intent of video playback is 0.63. Since the confidence value is ranked as 0.63>0.35, the text and related videos of the intent of video playback and the slot of The Wandering Earth can be output.
[0170] The above embodiment illustrates the situation that the error correction result is correct. In some embodiments, the error correction result may be wrong. If the error correction result is wrong, the weight of the confidence value after error correction can be adjusted according to a preset rule, and then the sorting process is performed.
[0171] For example, if the intent is in the music field, and the text corrected by the audio field correction model is "Play The Wandering Earth Theme Song", then "The Wandering Earth Theme Song" can be replaced by a random entity in the music field (such as Seven-Li Fragrant Osmanthus) and "Play Seven-Li Fragrant Osmanthus" can be input into the intent recognition model for re-recognition.
[0172] The confidence value obtained by correcting the slots of the original text using the audio domain error correction model is 0.5. If the confidence value of "play Seven-Li Fragrance" re-identified by the intent recognition model is less than 0.5 (such as the confidence value of "play Seven-Li Fragrance" re-identified by the intent recognition model is 0.4), then it is considered that the correction of "play The Wandering Earth" to "play The Wandering Earth's theme song" is wrong.
[0173] Therefore, the weight of the confidence value 0.5 obtained by correcting the original text using the audio domain error correction model can be reduced. For example, its weight can be reduced to 0.8. At this time, the result after joint error correction is (1.0*0.7)*(0.8*0.5)=0.28.
[0174] Similarly, for intent in the video field, the text corrected by the video field error correction model is "Play The Wandering Earth". In this case, we can use random entities in the video field (such as Wolf Warrior) to replace "The Wandering Earth" and input "Play Wolf Warrior" into the intent recognition model for re-recognition.
[0175] The confidence value obtained by correcting the original text using the video field error correction model is 0.9. If the confidence value of "Play Wolf Warrior" re-identified by the intent recognition model is less than 0.9 (such as the confidence value of "Play Wolf Warrior" re-identified by the intent recognition model is 0.8), then it is considered that the correction of "Play The Wandering Earth" to "Play The Wandering Earth" is wrong.
[0176] Therefore, the weight of the confidence value 0.9 obtained by correcting the original text using the video domain error correction model can be reduced. For example, its weight can be reduced to 0.8. At this time, the result after joint error correction is (1.0*0.7)*(0.8*0.9)=0.504.
[0177] Finally, the obtained results can be sorted, and the intent and slot results with the highest confidence value are output. Since 0.504>0.28, the output intent is video playback, and the slot is the text and related videos of The Wandering Earth.
[0178] Option 2:
[0179] Regarding the error correction performed using the general error correction model, since the general error correction model corrects the intent, the corrected text needs to be re-input into the intent recognition model for intent and slot recognition.
[0180] As described above, the text corrected by the general error correction model is "Play The Wandering Earth". The corrected text is input into the intent recognition model for recognition to obtain the recognition result. For example, the recognition result is: <Intent: Video playback, slot: The Wandering Earth, confidence value: 0.9>.
[0181] After obtaining the recognition result (ie, confidence value) of the corrected text, the result can be processed together with the result after error correction using the general error correction model to obtain a joint error correction result.
[0182] The processing in the embodiment of the present application can be understood as processing the confidence value 0.9 obtained by recognizing the corrected text using the intention recognition model and the confidence value 0.9 obtained using the general error correction model. The processing may include taking the average of the two confidence values (including the arithmetic mean, the root mean square average, the weighted average, etc.), or multiplying the two confidence values, etc., without limitation.
[0183] Exemplarily, taking the multiplication of these two confidence values as an example, the result after joint error correction is 0.81.
[0184] Finally, the obtained results can be sorted and the intent and slot results with the highest confidence values can be output.
[0185] The result here can be understood as all the confidence values in the recognition process, including: the confidence value of 0.5 for the intention of web search, the confidence value of 0.3 for the intention of making a phone call, and the confidence value of 0.81 after joint error correction for the intention of video playback. Since the confidence values are ranked as follows: 0.81>0.5>0.3, the text and related videos of the intent of video playback and the slot of The Wandering Earth can be output.
[0186] The above shows the error correction processing performed when there are typos in the text recognized by the ASR module. The embodiments of the present application can also be applied to the situation where the text recognized by the ASR module contains multiple words or missing words relative to the voice input by the user. The specific error correction process is similar to the above and will not be repeated here.
[0187] The text error correction method provided by the present application is that the electronic device selects the corresponding error correction model for error correction based on the intent recognized by the intent recognition model, that is, when the recognized intent has no corresponding domain error correction model, the general error correction model is selected for error correction; when the recognized intent has a corresponding domain error correction model, the domain error correction model and the general error correction model are selected for error correction. When there are multiple words, missing words, and wrong words in the recognized text, which makes it impossible to correct the error, or when the recognized attribute information range is inaccurate, which makes it impossible to correct the error, the intent and slot can still be corrected uniformly to ensure the accuracy of the recognized intent and slot.
[0188] The following describes a process of a text error correction method provided by this application.
[0189] See also Figure 6 , Figure 6 A schematic flow chart of a text error correction method 600 is shown. The method flow chart can be Figure 1 The electronic device shown performs.
[0190] like Figure 6 As shown, the method 600 may include:
[0191] S610: Receive a first text.
[0192] The first text in the embodiment of the present application may be the original text in the above step S410. As described in step S410, the original text (i.e., the first text) may be the text after the user's voice input is recognized by the ASR module, or may be the text after scanning the text in books and newspapers, or may be the text in social networks (such as Weibo, WeChat Moments), without limitation.
[0193] S620: Identify the intent and slot of the first text using an intent recognition model.
[0194] In the embodiment of the present application, the intent recognition model is used to recognize the intent and slot of the first text. Please refer to the description of step S420 above. For the sake of brevity, it will not be repeated here.
[0195] S630: Select a corresponding error correction model for error correction according to the intent, where the error correction model includes a general error correction model and / or a domain error correction model.
[0196] Optionally, in some embodiments, if the intent has a corresponding domain error correction model, the domain error correction model is used for error correction; if the intent has no corresponding domain error correction model, the general error correction model is used for error correction.
[0197] If the domain error correction model is used for error correction, the specific error correction process can refer to the content of solution one in the above step S431; if the general error correction model is used for error correction, the specific error correction process can refer to the content of solution two in the above step S431; it will not be repeated here.
[0198] In addition, after the error correction is completed, the error correction result can be processed using a post-processing module, and the processing method is different for different error correction models.
[0199] Solution 1:
[0200] If the domain error correction model is selected for error correction, outputting the target text according to the first confidence value, the second confidence value, and the third confidence value includes:
[0201] If the third confidence value is greater than or equal to the first confidence value, determine the first joint error correction confidence value of the second text according to the first confidence value and the second confidence value, the second text is the text after slot replacement of the first text after error correction, and the first joint error correction confidence value includes multiple confidence values; output the target text corresponding to the largest confidence value in the first joint error correction confidence values.
[0202] Optionally, in some embodiments, the multiple confidence values included in the first joint error correction confidence value are obtained by multiplying the confidence values with the same intention in the first confidence value and the second confidence value.
[0203] Optionally, in some embodiments, the method further comprises:
[0204] If the third confidence value is less than the first confidence value, reduce the second confidence value; determine the second joint error correction confidence value of the two texts according to the first confidence value and the reduced second confidence value, wherein the second joint error correction confidence value includes multiple confidence values; output the target text corresponding to the maximum confidence value in the second joint error correction confidence value.
[0205] Optionally, in some embodiments, the second joint error correction confidence value includes multiple confidence values obtained by multiplying the first confidence value and the reduced second confidence value having the same confidence value.
[0206] In an embodiment of the present application, for error correction performed using a domain error correction model, the output target text can be determined based on the size of the third confidence value and the first confidence value and the joint error correction confidence value (such as the above-mentioned first joint error correction confidence value and the second joint error correction confidence value). The specific process can refer to the contents of Solution 1 in the above-mentioned steps S440 and S450, which will not be repeated here.
[0207] Option 2:
[0208] If the universal error correction model is selected for error correction, outputting the target text according to the first confidence value, the second confidence value, and the third confidence value includes:
[0209] Determine a third joint error correction confidence value of the second text according to the second confidence value and the third confidence value, wherein the second text is the text after error correction of the first text; and output a target text corresponding to the maximum confidence value of the first confidence value and the third joint error correction confidence value.
[0210] Optionally, in some embodiments, the third joint error correction confidence value is obtained by multiplying the second confidence value and the third confidence value.
[0211] Optionally, in some embodiments, if the second confidence value and the third confidence value respectively include multiple confidence values, then the third joint error correction confidence value includes multiple confidence values, and the multiple confidence values included in the third joint error correction confidence value are obtained by multiplying the confidence values with the same intention in the second confidence value and the third confidence value.
[0212] In an embodiment of the present application, for error correction performed using a general error correction model, the output target text can be determined based on the size of the third joint error correction confidence value and the first confidence value. The specific process can refer to the contents of Solution 2 in the above steps S440 and S450, which will not be repeated here.
[0213] S640, outputting the target text after error correction.
[0214] The target text after error correction is the text corresponding to the maximum confidence value. For example, in the above scheme 1, after error correction using the domain error correction model, the target text corresponding to its confidence value is 0.63, and in the above scheme 2, after error correction using the general error correction model, the target text corresponding to its confidence value is 0.81.
[0215] S650: Output a response of the target text.
[0216] The target text response may be information related to the target text, such as Figure 3 (c) or Figure 3 The target text of (d) is "play The Wandering Earth", and the response to the target text is a video related to The Wandering Earth, such as Figure 3 (c) or Figure 3 As shown in (d): Video 1: The movie of The Wandering Earth; Video 2: Behind-the-scenes footage of The Wandering Earth; Video 3: Celebrity information about The Wandering Earth; Video 4: MV about The Wandering Earth; Video 5: Documentary about The Wandering Earth, etc.
[0217] The solution provided by the present application is that the electronic device selects the corresponding error correction model for error correction based on the intent recognized by the intent recognition model. When there are multiple words, missing words, and wrong words in the recognized text, which makes it impossible to correct the errors, or when the recognized attribute information range is inaccurate, which makes it impossible to correct the errors, the intent and slots can still be corrected uniformly to ensure the accuracy of the recognized intent and slots.
[0218] It is understandable that, in order to realize the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.
[0219] In this embodiment, the electronic device can be divided into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0220] In the case of dividing each functional module into corresponding functional modules, Figure 7 A possible schematic diagram of the composition of the electronic device 700 involved in the above embodiment is shown. Figure 7 As shown, the electronic device 700 may include: a receiving unit 710 , an identification unit 720 , a selection unit 730 and an output unit 740 .
[0221] The receiving unit 710 may be used to support the electronic device 700 in executing the above-mentioned step S610, etc., and / or other processes of the technology described herein.
[0222] The identification unit 720 may be used to support the electronic device 700 to execute the above-mentioned step S620 and the like, and / or other processes of the technology described herein.
[0223] The selection unit 730 may be used to support the electronic device 700 to execute the above-mentioned step S630, etc., and / or other processes for the technology described herein.
[0224] The output unit 740 may be used to support the electronic device 700 in executing the above steps S640 , S650 , etc., and / or other processes for the technology described herein.
[0225] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0226] The electronic device provided in this embodiment is used to execute the above-mentioned text error correction method, and thus can achieve the same effect as the above-mentioned implementation method.
[0227] In the case of using integrated units, the electronic device may include a processing module, a storage module and a communication module. Among them, the processing module can be used to control and manage the actions of the electronic device, for example, it can be used to support the electronic device to execute the steps performed by the above-mentioned various units. The storage module can be used to support the electronic device to execute and store program codes and data, etc. The communication module can be used to support the communication between the electronic device and other devices.
[0228] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.
[0229] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a Figure 1 Device of the structure shown.
[0230] Figure 8 Another possible schematic diagram of the composition of the electronic device 800 involved in the above embodiment is shown. Figure 8 As shown, the electronic device 800 may include a communication unit 810 , an input unit 820 , a processing unit 830 , an output unit 840 , a peripheral interface 850 , a storage unit 860 , and a power supply 870 .
[0231] The communication unit 810 is used to establish a communication channel so that the electronic device 800 can connect to a remote server through the communication channel and download media data from the remote server. The communication unit 810 may include communication modules such as a WLAN module, a Bluetooth module, an NFC module, a baseband module, and a radio frequency (RF) circuit corresponding to the communication module, which is used to perform wireless local area network communication, Bluetooth communication, NFC communication, infrared communication and / or cellular communication system communication, such as wideband code division multiple access (W-CDMA) and / or high speed downlink packet access (HSDPA). The communication module 810 is used to control the communication of various components in the electronic device and can support direct memory access.
[0232] The input unit 820 can be used to implement user interaction with the electronic device and / or input information into the electronic device. In a specific embodiment of the present invention, the input unit can be a touch panel, or other human-computer interaction interfaces, such as physical input keys, microphones, etc., or other external information acquisition devices, such as cameras, etc.
[0233] The processing unit 830 is the control center of the electronic device, and can use various interfaces and lines to connect various parts of the entire electronic device, and execute various functions of the electronic device and / or process data by running or executing software programs and / or modules stored in the storage unit, and calling data stored in the storage unit.
[0234] The output unit 840 includes but is not limited to an image output unit and a sound output unit. The image output unit is used to output text, pictures and / or videos. In a specific embodiment of the present invention, the touch panel used by the input unit 820 can also be used as a display panel of the output unit 840. For example, when the touch panel detects a touch or proximity gesture operation on it, it is transmitted to the processing unit to determine the type of touch event, and then the processing unit provides corresponding visual output on the display panel according to the type of touch event. Although in Figure 8 In the embodiment, the input unit 820 and the output unit 840 are two independent components to realize the input and output functions of the electronic device, but in some embodiments, the touch panel and the display panel can be integrated to realize the input and output functions of the electronic device. For example, the image output unit can display various graphical user interfaces as virtual control components, including but not limited to windows, scroll bars, icons and clipboards, for users to operate by touch.
[0235] In the above embodiment, outputting the target text after error correction in step S640 and outputting the response of the target text in step S650 can be implemented by the output unit 840 .
[0236] The storage unit 860 may be used to store software programs and modules. The processing unit executes various functional applications of the electronic device and realizes data processing by running the software programs and modules stored in the storage unit.
[0237] This embodiment also provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the text error correction method in the above-mentioned embodiment.
[0238] This embodiment also provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the above-mentioned related steps to implement the text error correction method in the above-mentioned embodiment.
[0239] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes the text error correction method in the above-mentioned method embodiments.
[0240] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.
[0241] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0242] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0243] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0244] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0245] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks or optical disks.
[0246] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A text error correction method, characterized in that: The method is applied to an electronic device, comprising: receiving a first text; Using an intent recognition model to recognize the intent and slot of the first text; Selecting a corresponding error correction model to perform error correction according to the intention, wherein the error correction model includes a general error correction model and / or a domain error correction model; Output the target text after error correction; The outputting of the error-corrected target text includes: Outputting the target text according to the error correction result and the confidence value; The identifying the intent and slot of the first text by using the intent recognition model includes: Using the intent recognition model to recognize the intent and slot of the first text, and obtain a first confidence value; The selecting a corresponding error correction model to perform error correction according to the intention includes: Selecting a corresponding error correction model according to the intention to perform error correction and obtain a second confidence value; Outputting the target text according to the error correction result and the confidence value includes: Using the intention recognition model to identify the intention and slot of a second text, and obtaining a third confidence value, the second text being a text after error correction of the first text or a text after slot replacement of the first text after error correction; outputting the target text according to the first confidence value, the second confidence value and the third confidence value; If the domain error correction model is selected for error correction, outputting the target text according to the first confidence value, the second confidence value, and the third confidence value includes: If the third confidence value is greater than or equal to the first confidence value, determining a first joint error correction confidence value of the second text according to the first confidence value and the second confidence value, the second text being a text obtained by slot replacement of the first text after error correction, and the first joint error correction confidence value including a plurality of confidence values; Output the target text corresponding to the maximum confidence value among the first joint error correction confidence values.
2. The method according to claim 1, characterized in that: The selecting a corresponding error correction model to perform error correction according to the intention includes: If the intent does not have a corresponding domain error correction model, use the general error correction model to perform error correction; If the intent has a corresponding domain error correction model, the domain error correction model is used for error correction.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Output the target text response.
4. The method according to claim 1 or 2, characterized in that: The multiple confidence values included in the first joint error correction confidence value are obtained by multiplying the confidence values with the same intention in the first confidence value and the second confidence value.
5. The method according to claim 1 or 2, characterized in that: The method further comprises: If the third confidence value is less than the first confidence value, reducing the second confidence value; Determining a second joint error correction confidence value of the second text according to the first confidence value and the reduced second confidence value, wherein the second joint error correction confidence value includes a plurality of confidence values; Output the target text corresponding to the maximum confidence value among the second joint error correction confidence values.
6. The method according to claim 5, characterized in that The second joint error correction confidence value includes multiple confidence values obtained by multiplying the first confidence value and the reduced second confidence value having the same confidence value as the first confidence value.
7. The method according to claim 1 or 2, characterized in that: If the universal error correction model is selected for error correction, outputting the target text according to the first confidence value, the second confidence value, and the third confidence value includes: Determining a third joint error correction confidence value of the second text according to the second confidence value and the third confidence value, wherein the second text is a text after error correction of the first text; Output the target text corresponding to the maximum confidence value between the first confidence value and the third joint error correction confidence value.
8. The method according to claim 7, characterized in that The third joint error correction confidence value is obtained by multiplying the second confidence value and the third confidence value.
9. The method according to claim 7, characterized in that: If the second confidence value and the third confidence value respectively include multiple confidence values, then the third joint error correction confidence value includes multiple confidence values, and the multiple confidence values included in the third joint error correction confidence value are obtained by multiplying the confidence values with the same intention in the second confidence value and the third confidence value.
10. An electronic device, characterized in that: include: one or more processors; one or more memories; The one or more memories store one or more computer programs, and the one or more computer programs include instructions, which, when executed by the one or more processors, enable the electronic device to perform the method as claimed in any one of claims 1 to 9.
11. A chip system, characterized in that: The chip system includes at least one processor, and when program instructions are executed in the at least one processor, the function of the method according to any one of claims 1 to 9 is implemented on the electronic device.
12. A computer storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 9.
13. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Speech recognition error correction method and device based on artificial intelligence and storage medium
CN107220235A
Intention recognition method and device, computer equipment and storage medium
CN109800407A