Text acquisition method, device, storage medium and computer equipment
By calculating the editing distance between different recognized texts and determining the target audio recognition system, the problem of low accuracy of automatic speech recognition in the prior art is solved, and more efficient text acquisition is achieved.
Patent Information
- Application Number
- CN202510305443.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-09
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-08-09
AI Technical Summary
The existing automatic speech recognition technology relies on manually set speech conversion rules, which are low in accuracy and have a long recognition time.
By calculating the editing distance between different recognized texts, the target audio recognition system is determined, and its corresponding recognition text is determined as output text, improving the accuracy of text acquisition.
Improves the accuracy of text acquisition and reduces recognition time.
Smart Images

Figure CN120236587B_ABST
Abstract
Description
Technical Field
[0001] This case is a divisional application of the invention patent application number 202210952021.8, filed on August 9, 2022, entitled "A Text Acquisition Method, Apparatus, Storage Medium, and Computer Device." This application relates to the field of computer technology, and in particular to a text acquisition method, apparatus, storage medium, and computer device. Background Art
[0002] Automatic speech recognition technology is often used in the existing technology to perform speech recognition and convert speech into text content. However, the existing automatic speech recognition technology mainly relies on manually set speech conversion rules, has low accuracy and long recognition time, and needs to propose a speech recognition method with higher accuracy. Summary of the Invention
[0003] The present invention provides a method, device, storage medium, and electronic device for acquiring text, which can determine the target recognized text by calculating the edit distance between different recognized texts, thereby improving the accuracy of text acquisition. The technical solution is as follows:
[0004] In a first aspect, an embodiment of the present application provides a text acquisition method, comprising: acquiring a recognition text set obtained by recognizing a target audio, the recognition text set comprising a plurality of recognition texts obtained by each audio recognition system in an audio recognition system set recognizing the target audio, the audio recognition system set comprising at least three audio recognition systems, and the audio recognition systems in the audio recognition system set corresponding one-to-one to the recognition texts in the recognition text set; acquiring the edit distance between two recognition texts in the recognition text set, and determining a target audio recognition system in the audio recognition system set based on the plurality of edit distances; and determining the target recognition text corresponding to the target audio recognition system in the recognition text set as the output text of the target audio.
[0005] In a second aspect, an embodiment of the present application provides a text acquisition device, comprising: a text set acquisition module, configured to acquire a recognition text set obtained by recognizing a target audio, wherein the recognition text set includes a plurality of recognition texts obtained by each audio recognition system in an audio recognition system set respectively recognizing the target audio, wherein the audio recognition system set includes at least three audio recognition systems, and the audio recognition systems in the audio recognition system set correspond one-to-one to the recognition texts in the recognition text set; a target system determination module, configured to respectively acquire the edit distance between two recognition texts in the recognition text set, and determine a target audio recognition system in the audio recognition system set based on the plurality of edit distances; and an output text determination module, configured to determine a target recognition text corresponding to the target audio recognition system in the recognition text set as the output text of the target audio.
[0006] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the steps of the above method.
[0007] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the above method.
[0008] In an embodiment of the present application, a recognition text set obtained by recognizing a target audio is obtained. The recognition text set includes multiple recognition texts obtained by each audio recognition system in an audio recognition system set respectively recognizing the target audio. The audio recognition system set includes at least three audio recognition systems. The audio recognition systems in the audio recognition system set correspond one-to-one to the recognition texts in the recognition text set. The edit distance between two recognition texts is obtained in the recognition text set. Based on the multiple edit distances, a target audio recognition system is determined in the audio recognition system set. The target recognition text corresponding to the target audio recognition system is determined as the output text of the target audio in the recognition text set. The target recognition text is determined by calculating the edit distance between different recognition texts, thereby improving the accuracy of text acquisition. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0010] Figure 1This is an example diagram of text acquisition provided in an embodiment of the present application;
[0011] Figure 2 This is a flowchart of a text acquisition method provided in an embodiment of the present application;
[0012] Figure 3 This is a flowchart of a text acquisition method provided in an embodiment of the present application;
[0013] Figure 4 This is an example diagram of an editing example acquisition provided in an embodiment of the present application;
[0014] Figure 5 This is a flowchart of a text acquisition method provided in an embodiment of the present application;
[0015] Figure 6 This is a structural diagram of a text acquisition device provided in an embodiment of the present application;
[0016] Figure 7 This is a schematic diagram of the structure of a target system determination module provided in an embodiment of the present application;
[0017] Figure 8 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0019] The text acquisition device can be a terminal device such as a mobile phone, computer, tablet, smartwatch, or in-vehicle device, or a module within the terminal device that implements the text acquisition method. The text acquisition device can acquire target audio and the text content corresponding to the target audio, i.e., the output text of the target audio. The target audio can be audio containing voice information recorded by a user into the terminal device, or it can be audio stored locally on the terminal device or retrieved from the Internet. After acquiring the output text of the target audio, the text acquisition device can display the output text on the terminal device.
[0020] Please also see Figure 1, provides an example diagram of text acquisition for the embodiment of the present application. The text recognition device can obtain the target audio input by the user and use the audio recognition system to recognize the target audio. The audio recognition system is an automatic speech recognition technology (Automatic Speech Recognition, ASR) system that can convert human speech into text. The text recognition device can use each audio recognition system in the audio recognition system set to recognize the target audio separately to obtain multiple recognized texts, such as Figure 1 In the embodiment, the recognized text 1, recognized text 2, ..., recognized text n are represented by a sequence of numbers, where n is an integer greater than or equal to 2, and the audio recognition system set includes at least three audio recognition systems. The text acquisition device can then find a target recognized text among the multiple recognized texts based on the edit distance, determine the target recognized text as the output text, and then control the terminal device to display the output text. The edit distance is a quantitative measure of the degree of difference between two character strings, measured by the minimum number of processing steps required to transform one character string into the other.
[0021] The text acquisition method provided in this application is described in detail below with reference to specific embodiments.
[0022] See Figure 2 , provides a flow chart of a text acquisition method according to an embodiment of the present application. Figure 2 As shown, the method of the embodiment of the present application may include the following steps S101-S103.
[0023] S101: Acquire a recognition text set obtained by recognizing a target audio.
[0024] Specifically, the text acquisition device can use each audio recognition system in the audio recognition system set to recognize the target audio respectively, thereby obtaining multiple recognition texts and saving them in the recognition text set. It can be understood that the audio recognition systems in the audio recognition system set correspond one-to-one to the recognition texts in the recognition text set, and one audio recognition system corresponds to one recognition text.
[0025] S102 : Obtaining edit distances between two recognized texts in the recognized text set respectively, and determining a target audio recognition system in the audio recognition system set based on the multiple edit distances.
[0026] Specifically, the text acquisition device can obtain the edit distance between two recognized texts in the text set respectively to obtain multiple edit distances. For example, if there are three recognized texts in the text set, the text acquisition device can obtain four edit distances. The text acquisition device can determine the target audio recognition system in the audio recognition system set based on these multiple edit distances. For example, if there are n audio recognition systems in total, n recognized texts of the target audio can be obtained, and the edit distance between each two recognized texts can be calculated. An audio recognition system has n-1 corresponding edit distances. Adding the n-1 edit distances can obtain the sum of the edit distances corresponding to the audio recognition system. The edit distance reflects the difference between the recognized texts. The smaller the edit distance, the more similar the two recognized texts are, and the higher the accuracy of the recognized text. The text recognition device can identify the audio recognition system with the smallest sum of edit distances as the target audio recognition system. It can be understood that when performing text recognition on the target audio, the target audio recognition system is the audio recognition system with the highest accuracy in the audio recognition system set.
[0027] S103: Determine the target recognition text corresponding to the target audio recognition system in the recognition text set as the output text of the target audio.
[0028] Specifically, the text acquisition device may determine the target recognition text corresponding to the target audio recognition system in the recognition text set as the output text of the target audio, and the text acquisition device may display the output text on the terminal device.
[0029] In an embodiment of the present application, a recognition text set obtained by recognizing a target audio is obtained. The recognition text set includes multiple recognition texts obtained by each audio recognition system in an audio recognition system set respectively recognizing the target audio. The audio recognition system set includes at least three audio recognition systems. The audio recognition systems in the audio recognition system set correspond one-to-one to the recognition texts in the recognition text set. The edit distance between two recognition texts is obtained in the recognition text set. Based on the multiple edit distances, a target audio recognition system is determined in the audio recognition system set. The target recognition text corresponding to the target audio recognition system is determined as the output text of the target audio in the recognition text set. The target recognition text is determined by calculating the edit distance between different recognition texts, thereby improving the accuracy of text acquisition.
[0030] See Figure 3 , provides a flow chart of a text acquisition method according to an embodiment of the present application. Figure 3 As shown, the method of the embodiment of the present application may include the following steps S201-S205.
[0031] S201: Acquire a recognition text set obtained by recognizing the target audio.
[0032] Specifically, the text acquisition device can use each audio recognition system in the audio recognition system set to recognize the target audio respectively, thereby obtaining multiple recognition texts and saving them in the recognition text set. It can be understood that the audio recognition systems in the audio recognition system set correspond one-to-one to the recognition texts in the recognition text set, and one audio recognition system corresponds to one recognition text.
[0033] S202: Obtain the edit distance between two recognized texts in the recognized text set.
[0034] Specifically, the text acquisition device may respectively acquire the edit distance between two recognized texts in the text set, thereby obtaining multiple edit distances. For example, if there are three recognized texts in the text set, the text acquisition device may obtain four edit distances.
[0035] Optionally, the text acquisition device can obtain the first recognition text corresponding to the first audio recognition system in the recognition text set. The first audio recognition system can be any audio recognition system in the audio recognition system set. The first recognition text is the recognition text obtained after the first audio recognition system recognizes the target audio. The text acquisition device can respectively obtain the first edit distance between the first recognition text and the second recognition text in the recognition text set. The second recognition text is the other recognition text in the recognition text set except the first recognition text. It can be understood that there can be multiple second recognition texts and multiple first edit distances. Please refer to Figure 4 , an example schematic diagram of obtaining edit distance is provided for an embodiment of the present application. The text acquisition device can use the audio recognition system A to obtain the recognized text A corresponding to the target audio. If the audio recognition system A is the first audio recognition system, the recognized text A is the recognized text A corresponding to the first audio recognition system. In addition to the recognized text A, the text set also includes recognized text B, recognized text C,..., recognized text N, etc. The recognized text B, recognized text C,..., and recognized text N are the second recognized texts in the text set. The text acquisition device can calculate the edit distance between the recognized text A and other recognized texts in the text set, such as the edit distance AB between the recognized text A and the recognized text B, the edit distance AC between the recognized text A and the recognized text C, and the edit distance AN between the recognized text A and the recognized text N. The edit distance AB, the edit distance AC,..., and the edit distance AN are the first edit distances corresponding to the first audio recognition system.
[0036] S203: Determine the sum of the edit distances corresponding to each audio recognition system based on the multiple edit distances.
[0037] Specifically, the text acquisition device may determine the sum of the edit distances corresponding to each audio recognition system based on multiple edit distances.
[0038] Optionally, the text acquisition device may add up all the first edit distances to obtain the sum of the edit distances corresponding to the first audio recognition system.
[0039] S204 : Determine a target audio recognition system in the audio recognition system set based on the sum of the edit distances corresponding to the audio recognition systems.
[0040] Specifically, the edit distance reflects the differences between the recognized texts. The smaller the edit distance, the more similar the two recognized texts are, and the higher the accuracy of the recognized texts. The text acquisition device can determine the target audio recognition system in the audio recognition system set based on the sum of the edit distances corresponding to each audio recognition system. It can be understood that when performing text recognition on the target audio, the target audio recognition system is the audio recognition system with the highest accuracy in the audio recognition system set.
[0041] Optionally, the smaller the sum of the edit distances, the higher the accuracy of the audio recognition system. The text acquisition device can determine the minimum sum of the edit distances from the sums of the edit distances corresponding to each audio recognition system, and determine the second audio recognition system corresponding to the minimum sum of the edit distances in the audio recognition system as the target audio recognition system.
[0042] S205: Determine the target recognition text corresponding to the target audio recognition system in the recognition text set as the output text of the target audio.
[0043] Specifically, the text acquisition device may determine the target recognition text corresponding to the target audio recognition system in the recognition text set as the output text of the target audio, and the text acquisition device may display the output text on the terminal device.
[0044] In an embodiment of the present application, a recognition text set obtained by recognizing the target audio is obtained, and the recognition text set includes multiple recognition texts obtained by each audio recognition system in the audio recognition system set respectively recognizing the target audio, the audio recognition system set includes at least three audio recognition systems, and the audio recognition systems in the audio recognition system set correspond one-to-one to the recognition texts in the recognition text set. The edit distance between two recognition texts is obtained in the recognition text set, and the sum of the edit distances corresponding to each audio recognition system is determined based on the multiple edit distances. The audio recognition system with the smallest sum of the edit distances is determined as the target audio recognition system, and the target recognition text corresponding to the target audio recognition system in the recognition text set is determined as the output text of the target audio. The target recognition text is determined by calculating the edit distance between different recognition texts, thereby improving the accuracy of text acquisition.
[0045] See Figure 5, provides a flow chart of a text acquisition method according to an embodiment of the present application. Figure 5 As shown, the method of the embodiment of the present application may include the following steps S301-S306.
[0046] S301: Acquire a recognition text set obtained by recognizing the target audio.
[0047] Specifically, the text acquisition device can use each audio recognition system in the audio recognition system set to recognize the target audio respectively, thereby obtaining multiple recognition texts and saving them in the recognition text set. It can be understood that the audio recognition systems in the audio recognition system set correspond one-to-one to the recognition texts in the recognition text set, and one audio recognition system corresponds to one recognition text.
[0048] S302: Obtain a first recognized text corresponding to the first audio recognition system in the recognized text set, and obtain a first edit distance between the first recognized text and a second recognized text in the recognized text set.
[0049] Specifically, the text acquisition device can obtain the edit distance between two recognized texts in the text set, thereby obtaining multiple edit distances. For example, if there are three recognized texts in the text set, the text acquisition device can obtain four edit distances. The text acquisition device can obtain a first recognized text corresponding to a first audio recognition system in the recognized text set. The first audio recognition system can be any audio recognition system in the audio recognition system set. The first recognized text is the recognized text obtained after the first audio recognition system recognizes the target audio. The text acquisition device can respectively obtain the first edit distance between the first recognized text and a second recognized text in the recognized text set. The second recognized text is the other recognized text in the recognized text set except the first recognized text. It can be understood that there can be multiple second recognized texts and multiple first edit distances.
[0050] S303: Determine the first audio recognition system as a candidate audio recognition system based on a preset threshold and a plurality of first edit distances.
[0051] Specifically, the text acquisition device may determine the first audio recognition system as a candidate audio recognition system based on a preset threshold and multiple first edit distances of the first audio recognition system. The preset threshold is used to determine the text recognition accuracy of the first audio recognition system and determine whether the first audio recognition system can be determined as a candidate audio recognition system.
[0052] Optionally, the edit distance reflects the differences between the recognized texts. The smaller the edit distance, the more similar the two recognized texts are, and the higher the accuracy of the text recognition. The preset threshold may be a distance threshold. When multiple first edit distances of the first audio recognition system are all less than or equal to the distance threshold, the first audio recognition system is determined to be a candidate audio recognition system. The distance threshold may be an initial setting of the text acquisition device or may be set by a user or relevant staff. For example, the text acquisition device can use audio recognition system A to obtain the recognized text A corresponding to the target audio. If audio recognition system A is the first audio recognition system, then the recognized text A is the recognized text A corresponding to the first audio recognition system. If there are three audio recognition systems in the audio recognition system set, namely audio recognition system A, audio recognition system B and audio recognition system C, and the corresponding recognized texts are recognized text A, recognized text B and recognized text C, the text acquisition device can calculate the first editing distance of the first audio recognition system as the editing distance AB between the recognized text A and the recognized text B, and the editing distance AC between the recognized text A and the recognized text C. Therefore, only when the editing distance AB and the editing distance AC are both less than or equal to the distance threshold, can the audio recognition system A be determined as a candidate audio recognition system. On the contrary, if the editing distance AB is greater than the distance threshold, the editing distance AC is greater than the distance threshold, or the editing distance AB and the editing distance AC are both greater than the distance threshold, it means that the audio recognition system A has low recognition accuracy for the target audio, and the audio recognition system A cannot be confirmed as a candidate audio recognition system.
[0053] Optionally, since the edit distance usually increases with the increase of the length of the recognized text, if the distance threshold is still used to determine the candidate audio recognition system when the recognized text is long, the accuracy of the candidate audio recognition system will be reduced. When the length of the recognized text is greater than the length threshold, the preset threshold can be a ratio threshold, that is, the ratio threshold is used to determine the audio recognition system. The text acquisition device can normalize all edit distances, obtain the average text length of multiple recognized texts in the recognized text set, calculate the ratio of the first edit distance and the average text length, and obtain multiple length ratios corresponding to the first audio recognition system. When all the length ratios of the first audio recognition system are less than or equal to the ratio threshold, the text acquisition device can determine that the first audio recognition system is a candidate audio recognition system. The ratio threshold can be an initial setting of the text acquisition device, and can also be set by the user or relevant staff.
[0054] S304: Determine a sum of edit distances corresponding to the candidate audio recognition systems based on the multiple first edit distances.
[0055] Specifically, the text acquisition device may add up the first edit distances corresponding to the candidate audio recognition systems to obtain the sum of the edit distances corresponding to the candidate audio recognition systems.
[0056] S305 : Determine a target audio recognition system from the candidate audio recognition systems based on the sum of the edit distances corresponding to the candidate audio recognition systems.
[0057] Specifically, the text acquisition device can determine the target audio recognition system among all candidate audio recognition systems based on the sum of the edit distances corresponding to each candidate audio recognition system. It can be understood that when performing text recognition on the target audio, the target audio recognition system is the audio recognition system with the highest accuracy in the audio recognition system set.
[0058] Optionally, when there are at least two candidate audio recognition systems, the text acquisition device can determine the minimum edit distance sum among the edit distance sums corresponding to the candidate audio recognition systems, and determine the third audio recognition system corresponding to the minimum edit distance sum in the audio recognition system set as the target audio recognition system. When there are at least two third audio recognition systems, that is, there are two or more audio recognition systems with the minimum edit distance sum, the text acquisition device can randomly determine a third audio recognition system as the target audio recognition system.
[0059] When there is no candidate audio recognition system, that is, the first edit distance of all audio recognition systems is greater than the length threshold, or the length ratio of all audio recognition systems is greater than the ratio threshold, it means that the recognition text recognized by all audio recognition systems is not accurate, and the text acquisition device can discard the target audio and not recognize the target audio.
[0060] It is understandable that when there is no candidate audio recognition system, the text acquisition device can send the target audio to the terminal device of the staff, and the staff can manually annotate the target audio.
[0061] S306: Determine the target recognition text corresponding to the target audio recognition system in the recognition text set as the output text of the target audio.
[0062] Specifically, the text acquisition device may determine the target recognition text corresponding to the target audio recognition system in the recognition text set as the output text of the target audio, and the text acquisition device may display the output text on the terminal device.
[0063] In an embodiment of the present application, a set of recognized texts obtained by recognizing the target audio is obtained. The recognized text set includes multiple recognized texts obtained by each audio recognition system in the audio recognition system set respectively recognizing the target audio. The audio recognition system set includes at least three audio recognition systems. The audio recognition systems in the audio recognition system set correspond one-to-one to the recognized texts in the recognized text set. A first recognized text corresponding to the first audio recognition system and a first edit distance are obtained in the recognized text set. The first audio recognition system is determined as a candidate audio recognition system based on a preset threshold and multiple first edit distances. The preset threshold can be a distance threshold. When the length of the recognized text is too long, the preset threshold can be a ratio threshold. The preset threshold is used to screen the audio recognition system, thereby further improving the accuracy of text acquisition. Based on multiple first edit distances, the sum of the edit distances corresponding to each candidate audio recognition system is determined, and the candidate audio recognition system with the smallest sum of edit distances is determined as the target audio recognition system. In the recognized text set, the target recognized text corresponding to the target audio recognition system is determined as the output text of the target audio. The target recognized text is determined by calculating the edit distances between different recognized texts, thereby improving the accuracy of text acquisition.
[0064] The following will be combined with the Figure 6 -Attached Figure 7 , the text acquisition device provided in the embodiment of the present application is introduced in detail. Figure 6 -Attached Figure 7 The text acquisition device in the present application is used to execute Figure 2-Figure 5 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figure 2-Figure 5 The embodiment shown.
[0065] See Figure 6 , which shows a schematic diagram of the structure of a text acquisition device provided by an exemplary embodiment of the present application. The text acquisition device can be implemented as all or part of the device through software, hardware, or a combination of both. The device 1 includes a text collection acquisition module 11, a target system determination module 12, and an output text determination module 13.
[0066] a text set acquisition module 11, configured to acquire a recognition text set obtained by recognizing a target audio, wherein the recognition text set includes a plurality of recognition texts obtained by each audio recognition system in an audio recognition system set respectively recognizing the target audio, the audio recognition system set including at least three audio recognition systems, and the audio recognition systems in the audio recognition system set corresponding one-to-one to the recognition texts in the recognition text set;
[0067] a target system determination module 12, configured to obtain an edit distance between two recognized texts in the recognized text set, and determine a target audio recognition system in the audio recognition system set based on a plurality of the edit distances;
[0068] For details, please refer to Figure 7 , provides a structural diagram of a target system determination module according to an embodiment of the present application. Figure 7 As shown, the target system determination module 12 may include:
[0069] The edit distance obtaining unit 121 is used to obtain the edit distance between two recognized texts in the recognized text set;
[0070] Optionally, the edit distance acquisition unit 121 is specifically configured to acquire a first recognition text corresponding to a first audio recognition system from the recognition text set, where the first audio recognition system is any audio recognition system in the audio recognition system set;
[0071] A first edit distance between the first recognized text and a second recognized text in the recognized text set is obtained respectively, where the second recognized text is other recognized text in the recognized text set except the first recognized text.
[0072] a distance sum obtaining unit 122, configured to determine the sum of the edit distances corresponding to each of the audio recognition systems based on the plurality of edit distances;
[0073] Optionally, the distance sum acquisition unit 122 may include:
[0074] a candidate system determining subunit 124, configured to determine the first audio recognition system as a candidate audio recognition system based on a preset threshold and a plurality of the first edit distances;
[0075] Optionally, the candidate system determination subunit 124 is specifically configured to obtain an average text length of the plurality of recognized texts in the recognized text set;
[0076] acquiring, based on the average text length and the plurality of first edit distances, a plurality of length ratios corresponding to the first audio recognition system;
[0077] When the plurality of length ratios are all smaller than or equal to a ratio threshold, the first audio recognition system is determined to be a candidate audio recognition system.
[0078] Optionally, the candidate system determining subunit 124 is specifically configured to determine the first audio recognition system as a candidate audio recognition system when a plurality of the first edit distances are all less than or equal to a distance threshold.
[0079] a distance sum obtaining subunit 125 , configured to determine a sum of edit distances corresponding to the candidate audio recognition systems based on the plurality of first edit distances;
[0080] a target system determining unit 123, configured to determine a target audio recognition system in the audio recognition system set based on the sum of the edit distances corresponding to the audio recognition systems;
[0081] Optionally, the target system determining unit 123 is specifically configured to determine a target audio recognition system from the candidate audio recognition systems based on the sum of the edit distances corresponding to the candidate audio recognition systems.
[0082] Optionally, the target system determination unit 123 is specifically configured to, when there are at least two candidate audio recognition systems, determine a minimum edit distance sum among the edit distance sums corresponding to the candidate audio recognition systems, and determine a third audio recognition system corresponding to the minimum edit distance sum in the audio recognition system set as the target audio recognition system;
[0083] When the candidate audio recognition system does not exist, the target audio is discarded.
[0084] Optionally, the target system determination unit 123 is specifically configured to determine a minimum edit distance sum among the edit distance sums corresponding to the audio recognition systems, and determine a second audio recognition system corresponding to the minimum edit distance sum in the audio recognition system set as the target audio recognition system.
[0085] The output text determination module 13 is configured to determine the target recognition text corresponding to the target audio recognition system in the recognition text set as the output text of the target audio.
[0086] In an embodiment of the present application, a set of recognized texts obtained by recognizing the target audio is obtained. The recognized text set includes multiple recognized texts obtained by each audio recognition system in the audio recognition system set respectively recognizing the target audio. The audio recognition system set includes at least three audio recognition systems. The audio recognition systems in the audio recognition system set correspond one-to-one to the recognized texts in the recognized text set. A first recognized text corresponding to the first audio recognition system and a first edit distance are obtained in the recognized text set. The first audio recognition system is determined as a candidate audio recognition system based on a preset threshold and multiple first edit distances. The preset threshold can be a distance threshold. When the length of the recognized text is too long, the preset threshold can be a ratio threshold. The preset threshold is used to screen the audio recognition system, thereby further improving the accuracy of text acquisition. Based on multiple first edit distances, the sum of the edit distances corresponding to each candidate audio recognition system is determined, and the candidate audio recognition system with the smallest sum of edit distances is determined as the target audio recognition system. In the recognized text set, the target recognized text corresponding to the target audio recognition system is determined as the output text of the target audio. The target recognized text is determined by calculating the edit distances between different recognized texts, thereby improving the accuracy of text acquisition.
[0087] It should be noted that the text acquisition device provided in the above embodiment, when executing the text acquisition method, is merely illustrated by the division of the above-mentioned functional modules. 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. In addition, the text acquisition device provided in the above embodiment and the text acquisition method embodiment are based on the same concept. The implementation process is detailed in the method embodiment and will not be repeated here.
[0088] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0089] The present application also provides a computer storage medium that can store multiple instructions, which are suitable for being loaded and executed by a processor as described above. Figure 1-Figure 5 The text acquisition method of the embodiment shown in the figure can be found in the specific execution process. Figure 1-Figure 5 The detailed description of the illustrated embodiment will not be repeated here.
[0090] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor as described above. Figure 1-Figure 5 The text acquisition method of the embodiment shown in the figure can be found in the specific execution process. Figure 1-Figure 5 The detailed description of the illustrated embodiment will not be repeated here.
[0091] Please refer to Figure 8 , which shows a block diagram of the structure of an electronic device provided by an exemplary embodiment of the present application. The electronic device in the present application may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected via the bus 150.
[0092] The processor 110 may include one or more processing cores. The processor 110 utilizes various interfaces and circuits to connect various components within the electronic device. It executes instructions, programs, code sets, or instruction sets stored in the memory 120, as well as accesses data stored in the memory 120, to perform various functions and process data for the terminal 100. Optionally, the processor 110 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 110 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interfaces, and applications; the GPU is responsible for rendering and drawing display content; and the modem handles wireless communications. It is understood that the modem may not be integrated into the processor 110 and may be implemented separately via a communication chip.
[0093] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The operating system may be an Android system, including a system deeply developed based on the Android system, an iOS system developed by Apple, including a system deeply developed based on the iOS system or other systems.
[0094] The memory 120 can be divided into an operating system space and a user space. The operating system runs in the operating system space, and native and third-party applications run in the user space. In order to ensure that different third-party applications can achieve better operating results, the operating system allocates corresponding system resources to different third-party applications. However, the requirements for system resources in different application scenarios in the same third-party application are also different. For example, in the local resource loading scenario, the third-party application has higher requirements for disk reading speed; in the animation rendering scenario, the third-party application has higher requirements for GPU performance. The operating system and the third-party application are independent of each other, and the operating system often cannot perceive the current application scenario of the third-party application in a timely manner, resulting in the operating system being unable to perform targeted system resource adaptation according to the specific application scenario of the third-party application.
[0095] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up data communication between third-party applications and the operating system so that the operating system can obtain the current scenario information of third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.
[0096] The input device 130 is used to receive input commands or data and includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch-sensitive device. The output device 140 is used to output commands or data and includes, but is not limited to, a display device and a speaker. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 may be a touch-sensitive display.
[0097] The touch display screen can be designed as a full screen, a curved screen or a special-shaped screen. The touch display screen can also be designed as a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the present embodiment.
[0098] In addition, those skilled in the art will understand that the structures of the electronic devices shown in the above figures do not limit the electronic devices. The electronic devices may include more or fewer components than shown, or may combine certain components, or arrange the components differently. For example, the electronic devices may also include radio frequency circuits, input units, sensors, audio circuits, wireless fidelity (WiFi) modules, power supplies, Bluetooth modules, and other components, which will not be described in detail here.
[0099] exist Figure 8 In the electronic device shown, the processor 110 may be configured to call a text acquisition application stored in the memory 120 and specifically perform the following operations:
[0100] Obtaining a set of recognized texts obtained by recognizing the target audio, the set of recognized texts comprising a plurality of recognized texts obtained by each audio recognition system in a set of audio recognition systems respectively recognizing the target audio, the set of audio recognition systems comprising at least three audio recognition systems, and the audio recognition systems in the set of audio recognition systems corresponding one-to-one to the recognized texts in the set of recognized texts;
[0101] Obtaining respectively the edit distance between two recognized texts in the recognized text set, and determining a target audio recognition system in the audio recognition system set based on a plurality of the edit distances;
[0102] The target recognition text corresponding to the target audio recognition system is determined in the recognition text set as the output text of the target audio.
[0103] In one embodiment, when the processor 110 obtains the edit distance between two recognized texts in the recognized text set and determines the target audio recognition system in the audio recognition system set based on the multiple edit distances, the processor 110 specifically performs the following operations:
[0104] Obtaining the edit distance between two recognized texts in the recognized text set respectively;
[0105] Determining the sum of the edit distances corresponding to each of the audio recognition systems based on the multiple edit distances;
[0106] A target audio recognition system is determined in the audio recognition system set based on the sum of the edit distances corresponding to the audio recognition systems.
[0107] In one embodiment, when the processor 110 obtains the edit distance between two recognized texts in the recognized text set, the processor 110 specifically performs the following operations:
[0108] Acquire a first recognition text corresponding to a first audio recognition system from the recognition text set, where the first audio recognition system is any audio recognition system in the audio recognition system set;
[0109] A first edit distance between the first recognized text and a second recognized text in the recognized text set is obtained respectively, where the second recognized text is other recognized text in the recognized text set except the first recognized text.
[0110] In one embodiment, when determining a target audio recognition system from the set of audio recognition systems based on the sum of the edit distances corresponding to the audio recognition systems, the processor 110 specifically performs the following operations:
[0111] A minimum edit distance sum is determined among the edit distance sums corresponding to the audio recognition systems, and a second audio recognition system corresponding to the minimum edit distance sum is determined as a target audio recognition system in the audio recognition system set.
[0112] In one embodiment, when determining the sum of the edit distances corresponding to the audio recognition systems based on the multiple edit distances, the processor 110 specifically performs the following operations:
[0113] determining the first audio recognition system as a candidate audio recognition system based on a preset threshold and a plurality of the first edit distances;
[0114] determining a sum of edit distances corresponding to the candidate audio recognition systems based on the plurality of first edit distances;
[0115] When determining a target audio recognition system from the set of audio recognition systems based on the sum of the edit distances corresponding to the audio recognition systems, the following operations are specifically performed:
[0116] A target audio recognition system is determined among the candidate audio recognition systems based on the sum of the edit distances corresponding to the candidate audio recognition systems.
[0117] In one embodiment, when the processor 110 determines the first audio recognition system as a candidate audio recognition system based on a preset threshold and a plurality of the first edit distances, the processor 110 specifically performs the following operations:
[0118] When the plurality of first edit distances are all smaller than or equal to a distance threshold, the first audio recognition system is determined to be a candidate audio recognition system.
[0119] In one embodiment, when the processor 110 determines the first audio recognition system as a candidate audio recognition system based on a preset threshold and a plurality of the first edit distances, the processor 110 specifically performs the following operations:
[0120] Obtaining an average text length of the plurality of recognized texts in the recognized text set;
[0121] acquiring, based on the average text length and the plurality of first edit distances, a plurality of length ratios corresponding to the first audio recognition system;
[0122] When the plurality of length ratios are all smaller than or equal to a ratio threshold, the first audio recognition system is determined to be a candidate audio recognition system.
[0123] In one embodiment, when determining a target audio recognition system among the candidate audio recognition systems based on the sum of the edit distances corresponding to the candidate audio recognition systems, the processor 110 specifically performs the following operations:
[0124] When there are at least two candidate audio recognition systems, determining a minimum edit distance sum among the edit distance sums corresponding to the candidate audio recognition systems, and determining a third audio recognition system corresponding to the minimum edit distance sum in the audio recognition system set as a target audio recognition system;
[0125] When the candidate audio recognition system does not exist, the target audio is discarded.
[0126] In an embodiment of the present application, a set of recognized texts obtained by recognizing the target audio is obtained. The recognized text set includes multiple recognized texts obtained by each audio recognition system in the audio recognition system set respectively recognizing the target audio. The audio recognition system set includes at least three audio recognition systems. The audio recognition systems in the audio recognition system set correspond one-to-one to the recognized texts in the recognized text set. A first recognized text corresponding to the first audio recognition system and a first edit distance are obtained in the recognized text set. The first audio recognition system is determined as a candidate audio recognition system based on a preset threshold and multiple first edit distances. The preset threshold can be a distance threshold. When the length of the recognized text is too long, the preset threshold can be a ratio threshold. The preset threshold is used to screen the audio recognition system, thereby further improving the accuracy of text acquisition. Based on multiple first edit distances, the sum of the edit distances corresponding to each candidate audio recognition system is determined, and the candidate audio recognition system with the smallest sum of edit distances is determined as the target audio recognition system. In the recognized text set, the target recognized text corresponding to the target audio recognition system is determined as the output text of the target audio. The target recognized text is determined by calculating the edit distances between different recognized texts, thereby improving the accuracy of text acquisition.
[0127] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0128] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A text acquisition method, characterized in that: include: Obtaining a set of recognized texts obtained by recognizing the target audio, the set of recognized texts comprising a plurality of recognized texts obtained by each audio recognition system in a set of audio recognition systems respectively recognizing the target audio, the set of audio recognition systems comprising at least three audio recognition systems, and the audio recognition systems in the set of audio recognition systems corresponding one-to-one to the recognized texts in the set of recognized texts; Obtaining respectively the edit distance between two recognized texts in the recognized text set, and determining a target audio recognition system in the audio recognition system set based on a plurality of the edit distances; Determining the target recognition text corresponding to the target audio recognition system in the recognition text set as the output text of the target audio; The obtaining the edit distance between two recognized texts in the recognized text set includes: Acquire a first recognition text corresponding to a first audio recognition system from the recognition text set, where the first audio recognition system is any audio recognition system in the audio recognition system set; respectively obtaining first edit distances between the first recognized text and second recognized texts in the recognized text set, where the second recognized texts are other recognized texts in the recognized text set except the first recognized text; Determining a target audio recognition system from the set of audio recognition systems based on a plurality of the edit distances includes: Determining the sum of the edit distances corresponding to each of the audio recognition systems based on the multiple edit distances; Determining a target audio recognition system from the set of audio recognition systems based on the sum of the edit distances corresponding to the audio recognition systems; The determining the sum of the edit distances corresponding to the respective audio recognition systems based on the plurality of edit distances includes: Determining the first audio recognition system as a candidate audio recognition system based on a preset threshold and a plurality of the first edit distances; wherein the preset threshold is used to determine the text recognition accuracy of the first audio recognition system and to determine whether the first audio recognition system can be determined as a candidate audio recognition system; determining a sum of edit distances corresponding to the candidate audio recognition systems based on the plurality of first edit distances; The determining a target audio recognition system from the set of audio recognition systems based on the sum of the edit distances corresponding to the audio recognition systems includes: A target audio recognition system is determined among the candidate audio recognition systems based on the sum of the edit distances corresponding to the candidate audio recognition systems.
2. The method according to claim 1, characterized in that The smaller the sum of the edit distances is, the higher the accuracy of the corresponding audio recognition system is, and the target audio recognition system is the audio recognition system with the highest accuracy in the audio recognition system set.
3. The method according to claim 1 or 2, characterized in that The determining a target audio recognition system from the set of audio recognition systems based on the sum of the edit distances corresponding to the audio recognition systems includes: A minimum edit distance sum is determined among the edit distance sums corresponding to the audio recognition systems, and a second audio recognition system corresponding to the minimum edit distance sum is determined as a target audio recognition system in the audio recognition system set.
4. The method according to claim 1, wherein The determining the first audio recognition system as a candidate audio recognition system based on a preset threshold and a plurality of the first edit distances includes: When the plurality of first edit distances are all smaller than or equal to a distance threshold, the first audio recognition system is determined to be a candidate audio recognition system.
5. The method according to claim 1, wherein The determining the first audio recognition system as a candidate audio recognition system based on a preset threshold and a plurality of the first edit distances includes: Obtaining an average text length of the plurality of recognized texts in the recognized text set; acquiring, based on the average text length and the plurality of first edit distances, a plurality of length ratios corresponding to the first audio recognition system; When the plurality of length ratios are all smaller than or equal to a ratio threshold, the first audio recognition system is determined to be a candidate audio recognition system.
6. The method according to claim 1, characterized in that The determining a target audio recognition system among the candidate audio recognition systems based on the sum of the edit distances corresponding to the candidate audio recognition systems includes: When there are at least two candidate audio recognition systems, determining a minimum edit distance sum among the edit distance sums corresponding to the candidate audio recognition systems, and determining a third audio recognition system corresponding to the minimum edit distance sum in the audio recognition system set as a target audio recognition system; When the candidate audio recognition system does not exist, the target audio is discarded.
7. The method according to claim 1, characterized in that When the length of the recognized text is greater than a length threshold, the preset threshold is a ratio threshold; otherwise, the preset threshold is a distance threshold.
8. A text acquisition device, characterized in that: include: a text set acquisition module, configured to acquire a recognition text set obtained by recognizing a target audio, wherein the recognition text set includes a plurality of recognition texts obtained by each audio recognition system in an audio recognition system set respectively recognizing the target audio, the audio recognition system set including at least three audio recognition systems, and the audio recognition systems in the audio recognition system set corresponding one-to-one to the recognition texts in the recognition text set; a target system determination module, configured to obtain an edit distance between two recognized texts in the recognition text set, and determine a target audio recognition system in the audio recognition system set based on a plurality of the edit distances; An output text determination module, configured to determine, in the recognition text set, a target recognition text corresponding to the target audio recognition system as an output text of the target audio; an edit distance obtaining unit, configured to obtain, from the set of recognized texts, a first recognized text corresponding to a first audio recognition system, where the first audio recognition system is any audio recognition system in the set of audio recognition systems; respectively obtaining first edit distances between the first recognized text and second recognized texts in the recognized text set, where the second recognized texts are other recognized texts in the recognized text set except the first recognized text; a distance sum obtaining unit, configured to determine the sum of the edit distances corresponding to the respective audio recognition systems based on the plurality of edit distances; The distance sum acquisition unit includes: a candidate system determination subunit, configured to determine the first audio recognition system as a candidate audio recognition system based on a preset threshold and a plurality of the first edit distances; wherein the preset threshold is used to determine the text recognition accuracy of the first audio recognition system and to determine whether the first audio recognition system can be determined as a candidate audio recognition system; a distance sum obtaining subunit, configured to determine a sum of edit distances corresponding to the candidate audio recognition systems based on a plurality of the first edit distances; a target system determining unit, configured to determine a target audio recognition system in the audio recognition system set based on the sum of the edit distances corresponding to the audio recognition systems; The target system determination unit is specifically configured to determine a target audio recognition system among the candidate audio recognition systems based on the sum of the edit distances corresponding to the candidate audio recognition systems.
9. A computer storage medium, characterized in that The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the steps of the method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: processor and memory; The memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
A method and apparatus for controlling audio and text synchronization
CN109275009A
Speech recognition method and device, electronic equipment and readable storage medium
CN112992125A