A data processing method and device
By enumerating numbers, generating finite state diagrams and merging grammar rules, the problem of insufficient accuracy of digital recognition in speech recognition technology is solved, the accuracy of digital recognition is improved, and the risk of identification errors is reduced.
Patent Information
- Application Number
- CN202010456999.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-26
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2040-05-26
AI Technical Summary
Existing voice recognition technology has accuracy problems when identifying numbers, especially in application scenarios such as banks, securities, express delivery and flights, which may lead to identification errors that may cause property damage.
By enumerating all the numbers of preset digits from zero, generating a digital model and converting it into a finite state diagram, obtaining syntax rules and converting it into a finite state diagram of rules, combining finite state diagram of numbers and rules, generating a numeric recognition model to Improve the accuracy of digital recognition.
Through the merger of custom grammatical rules and finite state diagrams, the accuracy of digital recognition is improved, allowing the digital recognition model to identify numbers more accurately and reduce the possibility of identification errors.
Smart Images

Figure CN111797617B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a data processing method and a data processing device. Background Art
[0002] In recent years, with the development of large-scale continuous speech recognition technology, speech recognition technology has been used in more and more application scenarios to improve the efficiency of users in handling things.
[0003] At present, language models are widely used in artificial intelligence technologies such as speech recognition, speech synthesis, machine translation and image recognition. Since numbers are a very critical information, they often need to be accurately judged, especially the numbers involved in application scenarios such as banks, securities, express delivery and flights. Therefore, speech recognition usually requires accurate recognition of numbers, speech synthesis requires accurate reading of numbers, and machine translation requires correct translation of numbers. For example, for the bank's intelligent customer service, if the bank card number reported by the user is incorrectly recognized, it will lead to transfer errors, thereby causing property losses to the user. Summary of the invention
[0004] In view of the above problems, embodiments of the present invention are proposed to provide a data processing method and a corresponding data processing device that overcome the above problems or at least partially solve the above problems.
[0005] The embodiment of the present invention discloses a data processing method, comprising:
[0006] Enumerate all numbers with preset digits starting from zero;
[0007] Generate a digital model based on all the enumerated numbers;
[0008] converting the digital model into a digital finite state diagram;
[0009] Acquire grammatical rules, and convert the grammatical rules into a finite state graph of the rules;
[0010] The finite state graph of the number and the finite state graph of the rule are combined to generate a number recognition model, so as to recognize the number using the number recognition model.
[0011] Optionally, generating a digital model according to all the enumerated numbers includes:
[0012] Classify all the enumerated numbers to obtain multiple types of numbers with different digits;
[0013] Generate multiple digital models according to the multiple types of numbers with different digits;
[0014] The step of converting the digital model into a digital finite state diagram comprises:
[0015] The plurality of digital models are converted into a plurality of digital finite state graphs.
[0016] Optionally, generating multiple digital models according to the multiple types of numbers with different digits includes:
[0017] Generate multiple numerical models and multiple number models according to the multiple types of numbers with different digits;
[0018] Among them, the numerical model has a corresponding quantity unit, and the number model has a corresponding quantity unit.
[0019] Optionally, converting the multiple digital models into multiple digital finite state diagrams includes:
[0020] The plurality of numerical models are converted into a plurality of first finite state graphs, and the plurality of number models are converted into a plurality of second finite state graphs.
[0021] Optionally, the merging of the digital finite state graph and the regular finite state graph to generate a digital recognition model includes:
[0022] The finite state graphs of the multiple digits and the finite state graph of the rule are merged respectively to generate multiple digit recognition models.
[0023] Optionally, the finite state graph of the rule includes a number category and a number length, and the finite state graphs of the multiple numbers and the finite state graph of the rule are respectively merged to generate multiple number recognition models, including:
[0024] Traverse and search for the number categories in the finite state graph of the rule, as well as the corresponding state connection edges and number lengths;
[0025] Deleting the state connection edge from the finite state graph of the rule, and recording the starting point and the end point of the state connection edge;
[0026] Determine a target finite state graph that matches the number category and number length from the finite state graphs of the plurality of numbers;
[0027] Add a first state edge and a second state edge to generate multiple digital recognition models; wherein the first state edge is from the starting point of the state connection edge to the starting point of the target finite state graph, and the first state edge is from the end point of the target finite state graph to the end point of the state connection edge.
[0028] Optionally, it also includes:
[0029] Obtain audio data to be recognized;
[0030] The audio data to be recognized is input into the digital recognition model, and the recognized digital data is output.
[0031] The embodiment of the present invention further discloses a data processing device, including:
[0032] A digital enumeration module is used to enumerate all the numbers of preset digits starting from zero;
[0033] A digital model generation module, used for generating a digital model according to all enumerated numbers;
[0034] A state diagram conversion module, used to convert the digital model into a digital finite state diagram;
[0035] A rule acquisition module, used for acquiring grammatical rules and converting the grammatical rules into a rule finite state graph;
[0036] The recognition model generation module is used to merge the digital finite state graph and the regular finite state graph to generate a digital recognition model so as to recognize numbers using the digital recognition model.
[0037] The embodiment of the present invention further discloses an electronic device, including:
[0038] one or more processors; and
[0039] One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, enable the electronic device to perform one or more steps of the method as described in the embodiments of the present invention.
[0040] The embodiment of the present invention further discloses a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, enables the processors to perform one or more steps of the method described in the embodiment of the present invention.
[0041] The embodiments of the present invention include the following advantages:
[0042] In the embodiment of the present invention, all numbers of preset digits are enumerated from zero, a digital model is generated according to all the enumerated numbers, the digital model is converted into a finite state graph of the number, the grammar rule is obtained, and the grammar rule is converted into a finite state graph of the rule, and the finite state graph of the number and the finite state graph of the rule are combined to generate a digital recognition model. Thus, by generating a finite state graph of the number, the grammar recognition model of the required number is trained, so that the corresponding grammar rule can be customized, so that the accuracy of using the digital recognition model to recognize the number is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a flow chart of steps of an embodiment of a data processing method of the present invention;
[0044] Figure 2is a flowchart of steps of another data processing method embodiment of the present invention;
[0045] Figure 3 It is a structural block diagram of an embodiment of a data processing device of the present invention. DETAILED DESCRIPTION
[0046] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0047] Reference Figure 1 , shows a flow chart of steps of a data processing method embodiment of the present invention, which may specifically include the following steps:
[0048] Step 101, enumerate all numbers of a preset number of digits starting from zero;
[0049] The preset number of digits may be a preset number of natural number digits. For example, if the preset number of digits is 5, all digits from 0 to 99999 are enumerated.
[0050] In an embodiment of the present invention, the maximum value of the number of preset digits may be determined first, and then all digits from 0 to the maximum value may be enumerated. Specifically, the maximum value of the number of preset digits may be 1eN-1, i.e., 10 raised to the power of N minus 1, where N is the preset digit and e is the base of the natural logarithm. For example, when N is 6, substituting N=6 into the above 1eN-1, the maximum value of the number of preset digits, 999999, may be obtained, and then all digits from 0 to 999999 are enumerated.
[0051] Step 102, generating a digital model according to all the enumerated numbers;
[0052] Herein, the digital model may refer to a digital model or function used to identify language data.
[0053] Specifically, training samples of audio data for all enumerated numbers can be obtained, and the initial recognition model can be trained through the training samples to generate the required digital model. In the specific implementation, considering that different people have different ways of reading numbers, for example, for the number "129", some people will read it as "one hundred and twenty-nine", others will read it as "one two nine", and some will read it as "one two nine", therefore, audio data with multiple readings can be obtained as training samples to improve the accuracy of digital model recognition of numbers.
[0054] Step 103, converting the digital model into a digital finite state diagram;
[0055] Finite state diagrams are used to show a finite state machine (specifying the sequence of states an object is in), the events and conditions that cause the object to reach those states, and the actions that occur when those states are reached.
[0056] In the embodiment of the present invention, the digital model can be converted into a digital finite state graph. For example, the digital finite state graph is FST (Finite State Transducers). Each state transition of FST has an output label, called an input-output label pair. Through the input-output label pair, FST can describe the conversion of a set of rules or the conversion of a set of symbol sequences to another set of symbol sequences.
[0057] As an example, the digital model can be converted into a weighted digital finite state graph. Specifically, the digital model can be converted into a digital finite state graph using an existing conversion tool, such as using Openfst to convert the digital model into a digital finite state graph, which is a library for constructing, merging, optimizing and searching weighted finite state machines FST.
[0058] Step 104, obtaining grammatical rules, and converting the grammatical rules into a finite state graph of the rules;
[0059] In an embodiment of the present invention, the grammatical rules may be first obtained, and then Openfst may be used to convert the grammatical rules into a finite state graph of rules in the same manner as the above-mentioned processing method of generating a finite state graph of numbers.
[0060] The grammar rules can be pre-set grammars for reading numbers, that is, the grammar rules can be customized according to the actual application scenarios. Specifically, the grammar rules can include five attributes: preceding context, length or digits, category, following context, and weight, where the preceding context attribute can refer to the content before the number is read, the length or digits attribute can refer to the length or digits of the number read, the category attribute can refer to the category of the read value (such as number category or value category), the following context attribute can be the content after the number is read, and the weight attribute can be the weighted weight of the multiple read numbers.
[0061] As an example, the grammatical rule is expressed as "The last four digits of the mobile phone number are D4(1.0)", where "The last four digits of the mobile phone number are" corresponds to the preceding attribute; "D" corresponds to the category attribute, which indicates that the category is the number category; "4" corresponds to the length attribute; "(space)" corresponds to the succeeding attribute, indicating that the succeeding is empty; and "1.0" corresponds to the weight attribute.
[0062] Step 105, merging the finite state graph of the number and the finite state graph of the rule to generate a number recognition model, so as to recognize the number using the number recognition model.
[0063] In the embodiment of the present invention, after generating the digital finite state graph and the regular finite state graph, the digital finite state graph and the regular finite state graph can be further merged to obtain a digital recognition model. The digital recognition model can be used to recognize audio data and output the numbers in the audio data.
[0064] By generating a finite state diagram of numbers, a grammatical recognition model of the required numbers is trained, so that corresponding grammatical rules can be customized, thereby improving the accuracy of recognizing numbers using the number recognition model.
[0065] In a preferred embodiment of the present invention, step 102 may include the following sub-steps:
[0066] All enumerated numbers are classified to obtain multiple categories of numbers with different digits; and multiple digital models are generated according to the multiple categories of numbers with different digits.
[0067] In the embodiment of the present invention, all the enumerated numbers can be classified according to the number of digits to obtain multiple categories of numbers with different number of digits.
[0068] Specifically, we can classify numbers with only one digit into one category, numbers with two digits into another category, and so on, namely: 0 to 9, 10 to 99, ..., 1e(N-1) to 1eN-1. Each category of numbers can be denoted by Li, that is, L i The formula is satisfied: L i =[10 i-1 , 10 i ), where i represents the number of digits or length of each type of number. As an example, if all the enumerated data are 0 to 99999, these numbers can be divided into five categories: 0 to 9, 10 to 99, 100 to 999, 1000 to 9999, and 10000 to 99999.
[0069] After classifying all the enumerated numbers, a digital model can be generated for each type of number according to the obtained multiple types of numbers with different digits. For example, for the five types of numbers mentioned above, a digital model can be generated for 0 to 9, a digital model for 10 to 99, a digital model for 100 to 999, a digital model for 1000 to 9999, and a digital model for 10000 to 99999.
[0070] The step 103 may include the following sub-steps:
[0071] The plurality of digital models are converted into a plurality of digital finite state graphs.
[0072] In the embodiment of the present invention, after generating a plurality of digital models, each digital model may be converted into a digital finite state graph, and if there are a plurality of digital models, a plurality of digital finite state graphs are generated accordingly.
[0073] In a preferred embodiment of the present invention, generating multiple digital models according to the multiple groups of numbers with different digits includes:
[0074] Generate multiple numerical models and multiple number models according to the multiple types of numbers with different digits;
[0075] Among them, the numerical model has a corresponding quantity unit, and the number model has a corresponding quantity unit.
[0076] Since in some application scenarios, the reading of numbers as numerical values is different from the reading of numbers as numbers, when numbers are used as numerical values, the numbers generally read will have corresponding units of quantity, for example, 129 is read as one hundred and twenty-nine. When numbers are used as numbers, the numbers generally read do not have corresponding units of quantity, for example, 1001 is read as one zero and one. Therefore, in the embodiment of the present invention, in order to further improve the accuracy of number recognition, multiple numerical models and multiple number models can be generated according to multiple groups of numbers with different digits.
[0077] Specifically, for numerical models, a numerical function can be used to transform each type of number, and each type of number can be directly converted in a numerical way to generate a series of numerical values, thereby obtaining a corresponding numerical model. The numerical function can be recorded as VALUE, and the generated numerical model can be recorded as V i , where i represents the number of digits in each category, then V i =VALUE(L i ). For example, when i=2, V2 is: ten, eleven, twelve, thirteen, ..., ninety-eight, ninety-nine.
[0078] For the number model, we can use the number function to transform each type of number, directly transform each type of number in the way of numbers, generate a series of numbers, and thus get a corresponding number model. The number function can be recorded as DIGIT, and the generated numerical model is recorded as D i , where i represents the number of digits in each category, then D i =DIGIT(L i ). For example, when i=2, D2 is: one-zero, one-one, one-two, one-three, ..., nine-eight, nine-nine.
[0079] In a preferred embodiment of the present invention, converting the multiple digital models into multiple digital finite state graphs includes:
[0080] The plurality of numerical models are converted into a plurality of first finite state graphs, and the plurality of number models are converted into a plurality of second finite state graphs.
[0081] Among them, the first finite state diagram can be a finite state diagram corresponding to the numerical model, and the second finite state diagram can be a finite state diagram corresponding to the number model. In an embodiment of the present invention, multiple numerical models can be converted into multiple first finite state diagrams, and multiple number models can be converted into multiple second finite state diagrams. Assuming that there are N types of numbers, N numerical models and N number models will be generated respectively, and then, the N numerical models are converted into N first finite state diagrams, and the N number models are converted into N second finite state diagrams, so that 2N state diagram libraries can be generated in the end.
[0082] In a preferred embodiment of the present invention, the step of combining the digital finite state graph and the regular finite state graph to generate a digital recognition model includes:
[0083] The finite state graphs of the multiple digits and the regular finite state graph are merged respectively to generate multiple digit recognition models.
[0084] In the embodiment of the present invention, the finite state graph of each digit and the regular finite state graph can be used to generate a digit recognition model. As described above, if there are 2N state graph libraries, 2N digit recognition models can be generated.
[0085] In a preferred embodiment of the present invention, the finite state graph of the rule includes a number category and a number length, and the finite state graphs of the multiple numbers and the finite state graphs of the rule are respectively merged to generate multiple number recognition models, including:
[0086] Traverse and search for the number categories, corresponding state connection edges and number lengths in the finite state graph of the rule; delete the state connection edges from the finite state graph of the rule, and record the starting point and the end point of the state connection edges; determine the target finite state graph that matches the number categories and number lengths from the finite state graphs of the multiple numbers; add a first state edge and a second state edge to generate multiple number recognition models; wherein the first state edge is from the starting point of the state connection edge to the starting point of the target finite state graph, and the first state edge is from the end point of the target finite state graph to the end point of the state connection edge.
[0087] The digital category is used to indicate the type of the number, including the value type and the number type. The value type can be recorded as V, and the number type can be recorded as D. The digital length can refer to the number of digits.
[0088] In the embodiment of the present invention, the number categories in the finite state graph of the rule, the corresponding state connection edges and the number length can be traversed, and the state connection edges can be deleted from the finite state graph of the rule, and the starting point and end point of the state connection edges can be recorded. Then, a target finite state graph matching the number category and number length can be determined from the finite state graphs of multiple numbers. For example, if the number category in the finite state graph of the rule is D and the number length is 4, then the finite state graph D4 of the number type, length or number of digits of 4 can be searched as the target finite state graph.
[0089] A first state edge is added, and the first state edge is from the starting point of the state connection edge to the starting point of the target finite state graph, and a second state edge is added, and the second state edge is from the end point of the target finite state graph to the end point of the state connection edge. For example, from the starting point of the state connection edge in the regular finite state graph, a new edge is added to the starting point of D4, and from the end point of D4, a new edge is added to the end point of the state connection edge in the regular finite state graph.
[0090] In a preferred embodiment of the present invention, the method may further include the following steps:
[0091] Acquire the audio data to be recognized; input the audio data to be recognized into the digital recognition model, and output the recognized digital.
[0092] The audio data to be recognized may be audio data that needs to be recognized.
[0093] In the embodiment of the present invention, the audio data to be recognized can be obtained, and the audio data to be recognized can be input into the digital recognition model to output the recognition number. The digital recognition model can recognize the audio data to be recognized and output the recognition number.
[0094] Through the numerical model and the number model, one type is the number representing the numerical value, and the other type is the number representing the number. The numbers are recognized according to two different models, and the feature representation of the number of digits and weights is uniformly used to define the grammatical rules of the number recognition model, so that the accuracy of using the number recognition model to recognize numbers is improved.
[0095] Reference Figure 2 , shows a flow chart of another data processing method embodiment of the present invention, which may specifically include the following steps:
[0096] Step 201, enumerate all numbers of a preset number of digits starting from zero;
[0097] The preset number of digits may be a preset number of natural number digits. For example, if the preset number of digits is 5, all digits from 0 to 99999 are enumerated.
[0098] Step 202, classify all the enumerated numbers to obtain multiple types of numbers with different digits;
[0099] Specifically, all the enumerated numbers can be classified according to the number of digits, and multiple types of numbers with different digits can be obtained, namely: 0 to 9, 10 to 99, ..., 1e(N-1) to 1eN-1. Each type of number can be recorded as Li, that is, L i The formula is satisfied: L i =[10 i-1 , 10 i ).
[0100] Step 203, generating multiple numerical models and multiple number models according to the multiple types of numbers with different digits; wherein the numerical models have corresponding quantity units, and the number models have corresponding quantity units;
[0101] Specifically, for numerical models, a numerical function can be used to transform each type of number, and each type of number can be directly converted in a numerical way to generate a corresponding numerical model. The numerical function can be recorded as VALUE, and the generated numerical model can be recorded as V i , where i represents the number of digits in each category, then V i =VALUE(L i ). For example, when i=2, V2 is: ten, eleven, twelve, thirteen, ..., ninety-eight, ninety-nine.
[0102] For the number model, a number function can be used to transform each type of number. Each type of number can be directly converted in the form of a number to generate a corresponding number model. The number function can be recorded as DIGIT, and the generated numerical model can be recorded as D i , where i represents the number of digits in each category, then D i =DIGIT(L i ). For example, when i=2, D2 is: one-zero, one-one, one-two, one-three, ..., nine-eight, nine-nine.
[0103] Step 204, converting the plurality of numerical models into a plurality of first finite state graphs, and converting the plurality of number models into a plurality of second finite state graphs;
[0104] Among them, the first finite state diagram can be a finite state diagram corresponding to the numerical model, and the second finite state diagram can be a finite state diagram corresponding to the number model. In an embodiment of the present invention, multiple numerical models can be converted into multiple first finite state diagrams, and multiple number models can be converted into multiple second finite state diagrams. Assuming that there are N types of numbers, N numerical models and N number models will be generated respectively, and then, the N numerical models are converted into N first finite state diagrams, and the N number models are converted into N second finite state diagrams, so that 2N state diagram libraries can be generated in the end.
[0105] Step 205, obtaining grammatical rules, and converting the grammatical rules into a finite state graph of the rules;
[0106] The grammar rules may be pre-set grammars for reading numbers, that is, the grammar rules may be customized according to actual application scenarios.
[0107] Specifically, the grammar rules may include five attributes: preceding context, length or digits, category, following context, and weight. Among them, the preceding context attribute may refer to the content before the read number, the length or digits attribute may refer to the length or digits of the read number, the category attribute may refer to the category of the read value (such as number category or value category), the following context attribute may be the content after the read number, and the weight attribute may be the weighted weight of multiple read numbers.
[0108] Step 206, respectively merging the plurality of first finite state graphs and the plurality of second finite state graphs with the regular finite state graph to generate a plurality of number recognition models, so as to recognize numbers using the number recognition models.
[0109] In the embodiment of the present invention, a plurality of first finite state graphs may be merged with the regular finite state graph, and a plurality of second finite state graphs may be merged with the regular finite state graph, to generate a plurality of digital recognition models.
[0110] In a preferred embodiment of the present invention, the finite state graph of the rule includes a number category and a number length, and step 206 may include the following sub-steps:
[0111] Traverse and search for the number categories, corresponding state connection edges and number lengths in the finite state graph of the rule; delete the state connection edges from the finite state graph of the rule, and record the starting point and end point of the state connection edges; determine a target finite state graph that matches the number categories and number lengths from the multiple first finite state graphs and multiple second finite state graphs; add first state edges and second state edges to generate multiple number recognition models; wherein the first state edge is from the starting point of the state connection edge to the starting point of the target finite state graph, and the first state edge is from the end point of the target finite state graph to the end point of the state connection edge.
[0112] In an embodiment of the present invention, the digital categories, corresponding state connection edges and digital lengths in the regular finite state graph can be traversed and searched, and the state connection edges can be deleted from the regular finite state graph, and the starting point and end point of the state connection edges can be recorded. Then, a target finite state graph that matches the digital category and digital length can be determined from multiple first finite state graphs and multiple second finite state graphs. Then, a first state edge is added, and the first state edge is from the starting point of the state connection edge to the starting point of the target finite state graph, and a second state edge is added, and the second state edge is from the end point of the target finite state graph to the end point of the state connection edge.
[0113] In a preferred embodiment of the present invention, it also includes:
[0114] Acquire the audio data to be recognized; input the audio data to be recognized into the digital recognition model, and output the recognized digital.
[0115] In the embodiment of the present invention, the audio data to be recognized can be obtained, and the audio data to be recognized can be input into the digital recognition model to output the recognition number. The digital recognition model can recognize the audio data to be recognized and output the recognition number.
[0116] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0117] Reference Figure 3 , shows a structural block diagram of a data processing device embodiment of the present invention, which may specifically include the following modules:
[0118] A digital enumeration module 301 is used to enumerate all the numbers of a preset number of digits starting from zero;
[0119] A digital model generation module 302 is used to generate a digital model according to all the enumerated numbers;
[0120] A state diagram conversion module 303, used to convert the digital model into a digital finite state diagram;
[0121] A rule acquisition module 304 is used to acquire grammatical rules and convert the grammatical rules into a rule finite state graph;
[0122] The recognition model generation module 305 is used to merge the digital finite state graph and the regular finite state graph to generate a digital recognition model so as to recognize numbers using the digital recognition model.
[0123] In a preferred embodiment of the present invention, the digital model generation module 302 includes:
[0124] The classification submodule is used to classify all the enumerated numbers and obtain multiple types of numbers with different digits;
[0125] A digital model generation submodule, used for generating multiple digital models according to the multiple types of numbers with different digits;
[0126] The state diagram conversion module 303 includes:
[0127] The state diagram conversion submodule is used to convert the multiple digital models into multiple digital finite state diagrams.
[0128] In a preferred embodiment of the present invention, the digital model generation submodule includes:
[0129] A digital model generating unit, used for generating a plurality of numerical models and a plurality of number models according to the plurality of types of numbers with different digits;
[0130] Among them, the numerical model has a corresponding quantity unit, and the number model has a corresponding quantity unit.
[0131] In a preferred embodiment of the present invention, the state diagram conversion submodule includes:
[0132] The state diagram conversion unit is used to convert the multiple numerical models into multiple first finite state diagrams, and convert the multiple number models into multiple second finite state diagrams.
[0133] In a preferred embodiment of the present invention, the recognition model generation module 305 includes:
[0134] The recognition model generation submodule is used to respectively merge the finite state graphs of the multiple digits and the finite state graphs of the rules to generate multiple digit recognition models.
[0135] In a preferred embodiment of the present invention, the finite state diagram of the rule includes a number category and a number length, and the recognition model generation submodule includes:
[0136] A digital category search unit, used for traversing and searching for digital categories in the finite state graph of the rule, and corresponding state connection edges and digital lengths;
[0137] A state connection edge deletion unit, used to delete the state connection edge from the finite state graph of the rule and record the start point and end point of the state connection edge;
[0138] A target finite state diagram determining unit, used to determine a target finite state diagram matching the number category and number length from the finite state diagrams of the plurality of numbers;
[0139] A state edge adding unit is used to add a first state edge and a second state edge to generate multiple digital recognition models; wherein, the first state edge is from the starting point of the state connection edge to the starting point of the target finite state graph, and the first state edge is from the end point of the target finite state graph to the end point of the state connection edge.
[0140] In a preferred embodiment of the present invention, it also includes:
[0141] A data acquisition module, used to acquire audio data to be recognized;
[0142] The digital output module is used to input the audio data to be recognized into the digital recognition model and output the recognized digital data.
[0143] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0144] An embodiment of the present invention further provides an electronic device, including:
[0145] one or more processors; and
[0146] One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, enable the electronic device to perform the steps of the method described in the embodiment of the present invention.
[0147] An embodiment of the present invention further provides a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, enables the processors to perform the steps of the method described in the embodiment of the present invention.
[0148] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0149] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0150] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0151] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0152] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0153] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0154] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0155] The data processing method and the data processing device provided by the present invention are introduced in detail above. The principle and implementation mode of the present invention are explained by using specific examples in this article. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation mode and the scope of application. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A data processing method, characterized in that: include: Enumerate all numbers with preset digits starting from zero; Generate a digital model based on all the enumerated numbers; converting the digital model into a digital finite state diagram; Acquire grammatical rules, and convert the grammatical rules into a finite state graph of the rules; Combining the finite state graph of the number and the finite state graph of the rule to generate a number recognition model, so as to recognize the number using the number recognition model; Obtain audio data to be recognized; Input the audio data to be recognized into the digital recognition model, and output the recognized digital; The step of generating a digital model based on all the enumerated numbers includes: classifying all the enumerated numbers to obtain multiple types of numbers with different digits; generating multiple digital models based on the multiple types of numbers with different digits; the step of converting the digital model into a finite state diagram of a number includes: converting the multiple digital models into a finite state diagram of a number; Generating multiple digital models according to the multiple types of numbers with different digits includes: generating multiple numerical models and multiple number models according to the multiple types of numbers with different digits; wherein the numerical models have corresponding quantity units, and the number models have corresponding quantity units; The converting of the plurality of digital models into a plurality of digital finite state graphs comprises: converting the plurality of numerical models into a plurality of first finite state graphs, and converting the plurality of number models into a plurality of second finite state graphs; The step of merging the digital finite state graph and the regular finite state graph to generate a digital recognition model includes: merging the multiple digital finite state graphs and the regular finite state graphs respectively to generate multiple digital recognition models.
2. The method according to claim 1, characterized in that The finite state graph of the rule includes a number category and a number length, and the finite state graphs of the multiple numbers and the finite state graph of the rule are respectively merged to generate multiple number recognition models, including: Traverse and search for the number categories in the finite state graph of the rule, as well as the corresponding state connection edges and number lengths; Deleting the state connection edge from the finite state graph of the rule, and recording the starting point and the end point of the state connection edge; Determine a target finite state graph that matches the number category and number length from the finite state graphs of the plurality of numbers; Add a first state edge and a second state edge to generate multiple digital recognition models; wherein the first state edge is from the starting point of the state connection edge to the starting point of the target finite state graph, and the first state edge is from the end point of the target finite state graph to the end point of the state connection edge.
3. A data processing device, characterized in that: include: A digital enumeration module is used to enumerate all the numbers of preset digits starting from zero; A digital model generation module, used for generating a digital model according to all enumerated numbers; A state diagram conversion module, used to convert the digital model into a digital finite state diagram; A rule acquisition module, used for acquiring grammatical rules and converting the grammatical rules into a rule finite state graph; A recognition model generation module, used for combining the digital finite state graph and the regular finite state graph to generate a digital recognition model, so as to recognize a number using the digital recognition model; Wherein, the digital recognition model obtains audio data to be recognized; Input the audio data to be recognized into the digital recognition model, and output the recognized digital; The step of generating a digital model based on all the enumerated numbers includes: classifying all the enumerated numbers to obtain multiple types of numbers with different digits; generating multiple digital models based on the multiple types of numbers with different digits; the step of converting the digital model into a finite state diagram of a number includes: converting the multiple digital models into a finite state diagram of a number; Generating multiple digital models according to the multiple types of numbers with different digits includes: generating multiple numerical models and multiple number models according to the multiple types of numbers with different digits; wherein the numerical models have corresponding quantity units, and the number models have corresponding quantity units; The converting of the plurality of digital models into a plurality of digital finite state graphs comprises: converting the plurality of numerical models into a plurality of first finite state graphs, and converting the plurality of number models into a plurality of second finite state graphs; The step of merging the digital finite state graph and the regular finite state graph to generate a digital recognition model includes: merging the multiple digital finite state graphs and the regular finite state graphs respectively to generate multiple digital recognition models.
4. An electronic device, characterized in that: include: one or more processors; and One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, cause the electronic device to perform one or more of the methods of claims 1-2.
5. A computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform one or more of the methods of claims 1-2.
Citation Information
Patent Citations
Method and device for recognizing numerals in speech, computer equipment and storage medium
CN109147767A
Digital conversion method and device
CN109616121A