Method and apparatus for training a model
By using pinyin information instead of Chinese character information, combined with self-attention and recurrent neural networks, the pinyin category determination model is trained, which solves the problem of homophone and near-phone recognition errors in Chinese speech recognition, and improves the accuracy and model performance of speech recognition.
Patent Information
- Application Number
- CN202010315469.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-21
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-04-21
AI Technical Summary
Among existing Chinese speech recognition technologies, the recursive neural network model has a low accuracy in translating Chinese speech and is easily affected by complex interference such as far-field environment, background noise, and accent, resulting in homophone or near-phonetic recognition errors.
Pinyin information is used instead of Chinese character information as the modeling unit, and the pinyin category determination model is trained through machine learning algorithms, including phonetic feature extraction sub-model, pinyin feature extraction sub-model and pinyin category determination sub-model, using self-attention structure and recurrent neural network. Joint training,merges homophone categories to improve recognition accuracy.
It improves the model's recognition effect on homophones and near-phonemes, reduces the difficulty of model training, and improves the accuracy and performance of speech recognition.
Smart Images

Figure CN113555009B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, specifically to the field of speech recognition, and in particular to a method and device for training a model. Background Art
[0002] With the rapid development of artificial intelligence and Internet of Things technology, the trend of terminal devices towards the Artificial Intelligence Internet of Things (AIoT) has become increasingly apparent. Automatic Speech Recognition (ASR) technology transcribes the voice signals collected by terminal devices into text content, and is one of the important information portals for AIoT. The accuracy and real-time performance of terminal speech recognition technology are important prerequisites for determining the performance of the final application service.
[0003] In the prior art, for the transcription problem of Chinese speech, existing methods all use the Recurrent Neural Network Transducer (RNN-T) model to transcribe speech into Chinese text as the final recognition result, which has a low accuracy rate. In addition, in terminal ASR applications, there may be complex interference factors such as far-field environment, background noise, and accent, which reduce the recognition rate of ASR and easily lead to the recognition errors of homophones or near-phonetic characters. Summary of the invention
[0004] The present application proposes a method, apparatus, device and storage medium for training a model.
[0005] According to a first aspect, the present application provides a method for training a model, the method comprising: obtaining a training sample set, wherein the training samples in the training sample set include speech information, pinyin information corresponding to each piece of speech information, and category information of the pinyin information, and the pinyin information is obtained by annotating each piece of speech information; using a machine learning algorithm, taking the speech information included in the training samples in the training sample set and the pinyin information corresponding to each piece of speech information as input data, and taking the category information of the pinyin information as output data, and training to obtain a pinyin category determination model, wherein the pinyin category determination model comprises a speech feature extraction submodel, a pinyin feature extraction submodel, and a pinyin category determination submodel, the speech feature extraction submodel is used to determine the speech features in the speech information, the pinyin feature extraction submodel is used to determine the pinyin features in the pinyin information, and the pinyin category determination submodel is used to determine the category of the pinyin information based on the speech features determined by the speech feature extraction submodel and the pinyin features determined by the pinyin feature extraction submodel.
[0006] In some embodiments, the pinyin category determination model is obtained by jointly training a speech feature extraction sub-model constructed by a self-attention structure and a pinyin feature extraction sub-model constructed by a recursive neural network.
[0007] In some embodiments, the pinyin information is obtained by the following conversion method: marking each voice message with Chinese characters to obtain the Chinese character information of each voice message; converting the Chinese character information of each voice message to obtain the pinyin information corresponding to each voice message.
[0008] In some embodiments, the method also includes: pre-training the pinyin category determination model to obtain parameters of the speech feature extraction sub-model in the pre-trained pinyin category determination model; initializing the parameters of the pinyin category determination model based on the parameters of the speech feature extraction sub-model obtained by pre-training.
[0009] In a second aspect, the present application provides a method for generating information, the method comprising: obtaining target voice information and target pinyin information corresponding to each target voice information, wherein the target pinyin information is obtained based on labeling each target voice information; inputting the target voice information and the target pinyin information into a trained pinyin category determination model to generate pinyin category information of the target pinyin information, wherein the pinyin category determination model is trained by a method as claimed in one of claims 1-4.
[0010] In a third aspect, the present application provides an apparatus for training a model, the apparatus comprising: a sample acquisition unit, configured to acquire a training sample set, wherein the training samples in the training sample set include speech information, pinyin information corresponding to each piece of speech information, and category information of the pinyin information, and the pinyin information is obtained by annotating each piece of speech information; a model training unit, configured to use a machine learning algorithm, taking the speech information included in the training samples in the training sample set and the pinyin information corresponding to each piece of speech information as input data, and taking the category information of the pinyin information as output data, to train a pinyin category determination model, wherein the pinyin category determination model comprises a speech feature extraction submodel, a pinyin feature extraction submodel, and a pinyin category determination submodel, the speech feature extraction submodel being used to determine speech features in speech information, the pinyin feature extraction submodel being used to determine pinyin features in pinyin information, and the pinyin category determination submodel being used to determine the category of the pinyin information based on the speech features determined by the speech feature extraction submodel and the pinyin features determined by the pinyin feature extraction submodel.
[0011] In some embodiments, the pinyin category determination model in the model training unit is obtained by jointly training a speech feature extraction sub-model constructed by a self-attention structure and a pinyin feature extraction sub-model constructed by a recursive neural network.
[0012] In some embodiments, the pinyin information in the sample acquisition unit is converted by the following units: a marking unit, configured to mark each voice message with Chinese characters to obtain the Chinese character information of each voice message; a conversion unit, configured to convert the Chinese character information of each voice message to obtain the pinyin information corresponding to each voice message.
[0013] In some embodiments, the device also includes: a pre-training unit, configured to pre-train the pinyin category determination model to obtain parameters of the speech feature extraction sub-model in the pre-trained pinyin category determination model; an initialization unit, configured to initialize the parameters of the pinyin category determination model based on the parameters of the speech feature extraction sub-model obtained by pre-training.
[0014] In a fourth aspect, the present application provides a device for generating information, the device comprising: a target acquisition unit, configured to acquire target voice information and target pinyin information corresponding to each target voice information, wherein the target pinyin information is obtained based on labeling each target voice information; an information generation unit, configured to input the target voice information and the target pinyin information into a trained pinyin category determination model to generate pinyin category information of the target pinyin information, wherein the pinyin category determination model is trained by the method described in any implementation method in the first aspect.
[0015] In a fifth aspect, the present application provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in any implementation manner in the first aspect.
[0016] In a sixth aspect, the present application provides a non-transitory computer-readable storage medium storing computer instructions, characterized in that the computer instructions are used to enable a computer to execute a method as described in any implementation manner in the first aspect.
[0017] According to the technology of the present application, pinyin information is used to replace the existing Chinese character information as the modeling unit, and the homophone categories in the voice information that ultimately needs to be recognized are merged, thereby avoiding the problem of confusion in homophone recognition caused by the existing use of Chinese character information for voice recognition, improving the model's recognition effect on homophones, and improving the accuracy of voice recognition results; since the homophone categories in the voice information are merged, the number of output pinyin categories is greatly reduced, the difficulty of model training is reduced, and the model's discrimination of near-phonetic characters is improved, thereby improving model performance.
[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.
[0020] Figure 1 is a schematic diagram of a first embodiment of a method for training a model according to the present application;
[0021] Figure 2 It is a scene diagram that can implement the method for training a model in an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of a second embodiment of a method for training a model according to the present application;
[0023] Figure 4 is a schematic diagram of a first embodiment of a method for generating information according to the present application;
[0024] Figure 5 is a structural schematic diagram of an embodiment of a device for training a model according to the present application;
[0025] Figure 6 is a structural schematic diagram of an embodiment of a device for generating information according to the present application;
[0026] Figure 7 It is a block diagram of an electronic device used to implement the method for training a model in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0028] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0029] Figure 1 A schematic diagram 100 of a first embodiment of a method for training a model according to the present application is shown. The method for training a model comprises the following steps:
[0030] Step 101: Obtain a training sample set.
[0031] In this embodiment, the executor of the method for training the model can obtain a training sample set from other electronic devices or locally through a wired connection or a wireless connection, wherein the training samples in the training sample set include voice information, pinyin information corresponding to each voice information, and category information of the pinyin information. The pinyin information can be obtained by a labeler manually listening to each voice and then annotating each voice with pinyin.
[0032] The above-mentioned pinyin information can be character information obtained by annotating the pinyin and tone combination of each word in the voice information, for example: "nin2 hao3", and the category of the pinyin information can classify the character information of each pinyin as one category, for example: "nin2" is one category, and "hao3" is another category.
[0033] Step 102, using a machine learning algorithm, taking the voice information included in the training samples in the training sample set and the pinyin information corresponding to each voice information as input data, and taking the category information of the pinyin information as output data, to train and obtain a pinyin category determination model.
[0034] In this embodiment, the execution subject can use a machine learning algorithm to train a pinyin category determination model by taking the speech information and the pinyin information corresponding to each piece of speech information included in the training sample set obtained in step 101 as input data and the category information of the pinyin information as output data. The pinyin category determination model includes a speech feature extraction submodel, a pinyin feature extraction submodel and a pinyin category determination submodel, the speech feature extraction submodel is used to determine the speech features in the speech information, the pinyin feature extraction submodel is used to determine the pinyin features in the pinyin information, and the pinyin category determination submodel is used to determine the category of the pinyin information based on the speech features determined by the speech feature extraction submodel and the pinyin features determined by the pinyin feature extraction submodel.
[0035] Here, the above-mentioned execution entity uses a machine learning algorithm to use the speech information included in the training samples in the training sample set and the pinyin information corresponding to each piece of speech information as the input data of the speech feature extraction submodel and the pinyin feature extraction submodel respectively, to obtain the actual output data of the speech feature extraction submodel and the pinyin feature extraction submodel, and then uses the actual output data of the speech feature extraction submodel and the actual output data of the pinyin feature extraction submodel as the input data of the pinyin category determination submodel to obtain the actual output data of the pinyin category determination submodel, and based on the actual output data and expected output data of the pinyin category determination submodel, adjusts the parameters of the pinyin category determination model to obtain a trained pinyin category determination model.
[0036] It should be noted that technical personnel can set the model structure of the speech feature extraction sub-model, pinyin feature extraction sub-model and pinyin category determination sub-model included in the above-mentioned pinyin category determination model according to actual needs, and the embodiments of the present disclosure do not limit this.
[0037] Continue to see Figure 2 , the method 200 for training a model in this embodiment runs in an electronic device 201. The electronic device 201 first obtains a training sample set 202, wherein the training samples in the training sample set include voice information, pinyin information corresponding to each voice information, and category information of the pinyin information, and the pinyin information is obtained by annotating each voice information, and then the electronic device 201 uses a machine learning algorithm, takes the voice information included in the training samples in the training sample set and the pinyin information corresponding to each voice information as input data, and takes the category information of the pinyin information as output data, and trains to obtain a pinyin category determination model 203, wherein the pinyin category determination model includes a voice feature extraction submodel, a pinyin feature extraction submodel, and a pinyin category determination submodel, the voice feature extraction submodel is used to determine the voice features in the voice information, the pinyin feature extraction submodel is used to determine the pinyin features in the pinyin information, and the pinyin category determination submodel is used to determine the category of the pinyin information based on the voice features determined by the voice feature extraction submodel and the pinyin features determined by the pinyin feature extraction submodel.
[0038] The method provided by the above-mentioned embodiment of the present application obtains a training sample set, wherein the training samples in the training sample set include voice information, pinyin information corresponding to each voice information, and category information of the pinyin information, and the pinyin information is obtained by marking each voice information. A machine learning algorithm is used to take the voice information included in the training samples in the training sample set and the pinyin information corresponding to each voice information as input data, and the category information of the pinyin information is taken as output data, and a pinyin category determination model is obtained by training, wherein the pinyin category determination model includes a voice feature extraction sub-model, a pinyin feature extraction sub-model, and a pinyin category determination sub-model, and the voice feature extraction sub-model is used to determine the voice features in the voice information, and the pinyin feature extraction sub-model is used to determine the voice features in the voice information. The model is used to determine the pinyin features in the pinyin information. The pinyin category determination submodel is used to determine the category of the pinyin information based on the speech features determined by the speech feature extraction submodel and the pinyin features determined by the pinyin feature extraction submodel. Pinyin information is used to replace the existing Chinese character information as the modeling unit, and the homophone categories in the speech information that ultimately needs to be recognized are merged, thereby avoiding the problem of confusion in homophone recognition caused by the existing use of Chinese character information for speech recognition, improving the model's recognition effect on homophones, and improving the accuracy of speech recognition results. Since the homophone categories in the speech information are merged, the number of output pinyin categories is greatly reduced, reducing the difficulty of model training, and improving the model's discrimination of near-phonetic characters, thereby improving model performance.
[0039] Further references Figure 3 , which shows a schematic diagram 300 of a second embodiment of a method for training a model. The process of the method includes the following steps:
[0040] Step 301: Obtain a training sample set.
[0041] In this embodiment, the execution entity can obtain a training sample set from other electronic devices or locally through a wired connection or a wireless connection, wherein the training samples in the training sample set include voice information, pinyin information corresponding to each voice information, and category information of the pinyin information, and the pinyin information can be obtained by marking each voice information.
[0042] In some optional implementations of this embodiment, the pinyin information is obtained by the following conversion method: using manual annotation and screening methods, annotating each voice message with Chinese characters to obtain the Chinese character information of each voice message, and using a Chinese character conversion tool (such as Python's pypinyin module) to convert the Chinese character information of each voice message to obtain the pinyin information corresponding to each voice message. The existing voice annotation method using Chinese characters for text annotation eliminates the link of manual pinyin annotation and simplifies the work of personnel.
[0043] Step 302, pre-training the pinyin category determination model to obtain parameters of the speech feature extraction sub-model in the pre-trained pinyin category determination model.
[0044] In this embodiment, the execution subject pre-trains the pinyin category determination model to obtain the parameters of the speech feature extraction sub-model in the pre-trained pinyin category determination model.
[0045] The joint network for transcribing Chinese speech to pinyin has a large number of parameters and involves two types of heterogeneous input data, speech and text. It is often difficult to obtain good training results by directly using training data. By using the existing CTC (Connectionist Temporal Classification) loss function as the pinyin loss function, pre-training is performed to solve the alignment problem from input audio to output pinyin text.
[0046] Step 303, based on the parameters of the speech feature extraction sub-model obtained by pre-training, the parameters of the pinyin category determination model are initialized.
[0047] In this implementation, the execution subject uses the parameters of the speech feature extraction sub-model obtained by pre-training and other random parameters to initialize the pinyin category determination model.
[0048] Step 304, using a machine learning algorithm, taking the voice information included in the training samples in the training sample set and the pinyin information corresponding to each voice information as input data, and taking the category information of the pinyin information as output data, to train and obtain a pinyin category determination model.
[0049] In this embodiment, the execution subject can use a machine learning algorithm to obtain a pinyin category determination model by taking the speech information included in the training samples in the obtained training sample set and the pinyin information corresponding to each piece of speech information as input data and the category information of the pinyin information as output data. The pinyin category determination model includes a speech feature extraction submodel, a pinyin feature extraction submodel and a pinyin category determination submodel, the speech feature extraction submodel is used to determine the speech features in the speech information, the pinyin feature extraction submodel is used to determine the pinyin features in the pinyin information, and the pinyin category determination submodel is used to determine the category of the pinyin information based on the speech features determined by the speech feature extraction submodel and the pinyin features determined by the pinyin feature extraction submodel. The pinyin category determination model is obtained by jointly training a speech feature extraction submodel constructed by a self-attention structure and a pinyin feature extraction submodel constructed by a recursive neural network.
[0050] from Figure 3 It can be seen that Figure 1Compared with the corresponding embodiment, the schematic diagram 300 of the method for training the model in this embodiment optimizes the neural network model structure of the pinyin category determination model by combining the self-attention structure and the recursive neural network structure, thereby improving the temporal feature extraction capability and parallelism of the network structure, and improving the accuracy and real-time performance of the final model. It solves the problem that in the terminal Chinese speech transcription scenario with limited computing resources, the quality of the speech signal is affected by factors such as the far-field environment, background noise, and whether the user's pronunciation is standard, which puts higher requirements on the performance and parallelism of the temporal feature extraction model; by pre-training the pinyin category determination model, the parameters of the speech feature extraction submodel in the pre-trained pinyin category determination model are obtained, and the parameters of the pinyin category determination model are initialized based on the parameters of the speech feature extraction submodel obtained by the pre-training, thereby avoiding the problem that it is difficult to obtain a good training effect by directly using the training data when the model parameters are large and involve two types of heterogeneous input data, speech and text, and solving the problem of alignment from input audio to output pinyin text, thereby improving the accuracy and efficiency of model training.
[0051] Further references Figure 4 , which shows a schematic diagram 400 of an embodiment of a method for generating information of the present application. The method for generating information comprises the following steps:
[0052] Step 401, obtaining target voice information and target pinyin information corresponding to each piece of target voice information.
[0053] In this embodiment, the execution entity can obtain the target voice information from other electronic devices or locally through a wired connection or a wireless connection, and obtain the target pinyin information corresponding to each target voice information locally, wherein the target pinyin information is obtained based on marking each target voice information.
[0054] Step 402, inputting the target speech information and the target pinyin information into the trained pinyin category determination model to generate the pinyin category information of the target pinyin information.
[0055] In this embodiment, the execution entity can input the target voice information and target pinyin information into the trained pinyin category determination model to generate pinyin category information of the target pinyin information. The pinyin category determination model is trained by any of the methods in the above-mentioned method for training the model.
[0056] from Figure 4 It can be seen that Figure 1Compared with the corresponding embodiment, the method for generating information in this embodiment highlights the step of using the trained pinyin category determination model to generate the pinyin category information of the target pinyin information. Therefore, the scheme described in this embodiment can improve the accuracy of the pinyin category information determination.
[0057] Further references Figure 5 , as a response to the above Figure 1 The present application provides an embodiment of a device for training a model, and the device embodiment is similar to Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0058] like Figure 5 As shown, the device 500 for training a model in this embodiment includes: a sample acquisition unit 501 and a model training unit 502, wherein the sample acquisition unit 501 is configured to acquire a training sample set, wherein the training samples in the training sample set include speech information, pinyin information corresponding to each piece of speech information, and category information of the pinyin information, and the pinyin information is obtained by annotating each piece of speech information; the model training unit 502 is configured to use a machine learning algorithm, taking the speech information included in the training samples in the training sample set and the pinyin information corresponding to each piece of speech information as input data, and taking the category information of the pinyin information as output data, to train a pinyin category determination model, wherein the pinyin category determination model includes a speech feature extraction submodel, a pinyin feature extraction submodel, and a pinyin category determination submodel, wherein the speech feature extraction submodel is used to determine the speech features in the speech information, the pinyin feature extraction submodel is used to determine the pinyin features in the pinyin information, and the pinyin category determination submodel is used to determine the category of the pinyin information based on the speech features determined by the speech feature extraction submodel and the pinyin features determined by the pinyin feature extraction submodel.
[0059] In this embodiment, the specific processing of the sample acquisition unit 501 and the model training unit 502 of the device 500 for training the model and the technical effects thereof can be referred to respectively. Figure 1 The relevant descriptions of step 101 to step 102 in the corresponding embodiment are not repeated here.
[0060] In some optional implementations of the present embodiment, the pinyin category determination model in the model training unit is obtained by jointly training a speech feature extraction sub-model constructed by a self-attention structure and a pinyin feature extraction sub-model constructed by a recursive neural network.
[0061] In some optional implementations of this embodiment, the pinyin information in the sample acquisition unit is obtained by converting the following units: a labeling unit, configured to label each voice information with Chinese characters to obtain the Chinese character information of each voice information; a conversion unit, configured to convert the Chinese character information of each voice information to obtain the pinyin information corresponding to each voice information.
[0062] In some optional implementations of the present embodiment, the device also includes: a pre-training unit, configured to pre-train the pinyin category determination model to obtain parameters of the speech feature extraction sub-model in the pre-trained pinyin category determination model; an initialization unit, configured to initialize the parameters of the pinyin category determination model based on the parameters of the speech feature extraction sub-model obtained by pre-training.
[0063] Further references Figure 6 , as a response to the above Figure 4 The present application provides an embodiment of a device for generating information. Figure 4 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0064] like Figure 6 As shown, the device 600 for generating information in this embodiment includes: a target acquisition unit 601 and an information generation unit 602, the target acquisition unit 601 is configured to acquire target voice information and target pinyin information corresponding to each target voice information, wherein the target pinyin information is obtained based on labeling each target voice information; the information generation unit 602 is configured to input the target voice information and the target pinyin information into a trained pinyin category determination model to generate pinyin category information of the target pinyin information, wherein the pinyin category determination model is trained by the method of any embodiment of the method for training a model as described above.
[0065] In this embodiment, the specific processing of the target acquisition unit 601 and the information generation unit 602 of the device for generating information 600 and the technical effects thereof can be referred to in Figure 4 The relevant descriptions of step 401 to step 402 in the corresponding embodiment are not repeated here.
[0066] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
[0067] like Figure 7, is a block diagram of an electronic device for a method for training a model according to an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0068] like Figure 7 As shown, the electronic device includes: one or more processors 701, a memory 702, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 701 is taken as an example.
[0069] The memory 702 is a non-transitory computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable at least one processor to perform the method for training a model provided in the present application. The non-transitory computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to perform the method for training a model provided in the present application.
[0070] The memory 702 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the method for training a model in the embodiment of the present application (for example, the attached Figure 5 The processor 701 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 702, that is, implements the method for training the model in the above method embodiment.
[0071] The memory 702 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device for training the model, etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 702 may optionally include a memory remotely arranged relative to the processor 701, and these remote memories may be connected to the electronic device for training the model via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0072] The electronic device for the method of training a model may further include: an input device 703 and an output device 704. The processor 701, the memory 702, the input device 703 and the output device 704 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0073] The input device 703 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device for training the model, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 704 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.
[0074] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0075] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0076] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0077] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0078] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.
[0079] According to the technical solution of the embodiment of the present application, a training sample set is obtained, wherein the training samples in the training sample set include voice information, pinyin information corresponding to each voice information, and category information of the pinyin information, and the pinyin information is obtained by marking each voice information. A machine learning algorithm is used to take the voice information included in the training samples in the training sample set and the pinyin information corresponding to each voice information as input data, and the category information of the pinyin information is taken as output data, and a pinyin category determination model is obtained by training, wherein the pinyin category determination model includes a voice feature extraction sub-model, a pinyin feature extraction sub-model, and a pinyin category determination sub-model, the voice feature extraction sub-model is used to determine the voice features in the voice information, and the pinyin feature extraction sub-model is used to determine the voice features in the voice information. The sub-model is used to determine the pinyin features in the pinyin information. The pinyin category determination sub-model is used to determine the category of the pinyin information based on the speech features determined by the speech feature extraction sub-model and the pinyin features determined by the pinyin feature extraction sub-model. The pinyin information is used to replace the existing Chinese character information as the modeling unit, and the homophone categories in the speech information that ultimately needs to be recognized are merged, thereby avoiding the problem of confusion in homophone recognition caused by the existing use of Chinese character information for speech recognition, improving the model's recognition effect on homophones, and improving the accuracy of speech recognition results. Since the homophone categories in the speech information are merged, the number of output pinyin categories is greatly reduced, which reduces the training difficulty of the model, improves the model's discrimination of near-phonetic characters, and thus improves the model performance.
[0080] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
[0081] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A method for training a model, the method include: Acquire a training sample set, wherein the training samples in the training sample set include voice information, pinyin information corresponding to each voice information, and category information of the pinyin information, wherein the pinyin information is obtained by annotating each voice information, the pinyin information is character information obtained by annotating the pinyin and tone combination of each word in the voice information, and the category of the pinyin information is to take the character information of each pinyin as one category; By using a machine learning algorithm, the speech information included in the training samples in the training sample set and the pinyin information corresponding to each piece of speech information are taken as input data, and the category information of the pinyin information is taken as output data, and a pinyin category determination model is obtained by training, wherein the pinyin category determination model includes a speech feature extraction submodel, a pinyin feature extraction submodel and a pinyin category determination submodel, the speech feature extraction submodel is used to determine the speech features in the speech information, the pinyin feature extraction submodel is used to determine the pinyin features in the pinyin information, and the pinyin category determination submodel is used to determine the category of the pinyin information based on the speech features determined by the speech feature extraction submodel and the pinyin features determined by the pinyin feature extraction submodel.
2. The method according to claim 1, in, The pinyin category determination model is obtained by jointly training a speech feature extraction sub-model constructed by a self-attention structure and a pinyin feature extraction sub-model constructed by a recursive neural network.
3. The method according to claim 1, in, The pinyin information is obtained by the following conversion method: Mark each voice message with Chinese characters to obtain Chinese character information of each voice message; The Chinese character information of each voice message is converted to obtain the pinyin information corresponding to each voice message.
4. The method according to claim 1, further comprising: include: Pre-training the pinyin category determination model to obtain parameters of the speech feature extraction sub-model in the pre-trained pinyin category determination model; Based on the parameters of the speech feature extraction sub-model obtained through pre-training, the parameters of the pinyin category determination model are initialized.
5. A method for generating information, the method include: Acquire target voice information and target pinyin information corresponding to each piece of target voice information, wherein the target pinyin information is obtained based on marking each piece of target voice information; The target speech information and the target pinyin information are input into a trained pinyin category determination model to generate pinyin category information of the target pinyin information, wherein the pinyin category determination model is trained by the method described in any one of claims 1-4.
6. A device for training a model, the device include: The sample acquisition unit is configured to acquire a training sample set, wherein the training samples in the training sample set include voice information, pinyin information corresponding to each voice information, and category information of the pinyin information, wherein the pinyin information is obtained by annotating each voice information, the pinyin information is character information obtained by annotating the pinyin and tone combination of each word in the voice information, and the category of the pinyin information is to take the character information of each pinyin as one category; The model training unit is configured to use a machine learning algorithm to take the speech information included in the training samples in the training sample set and the pinyin information corresponding to each piece of speech information as input data, and take the category information of the pinyin information as output data, to train a pinyin category determination model, wherein the pinyin category determination model includes a speech feature extraction submodel, a pinyin feature extraction submodel and a pinyin category determination submodel, the speech feature extraction submodel is used to determine the speech features in the speech information, the pinyin feature extraction submodel is used to determine the pinyin features in the pinyin information, and the pinyin category determination submodel is used to determine the category of the pinyin information based on the speech features determined by the speech feature extraction submodel and the pinyin features determined by the pinyin feature extraction submodel.
7. The device according to claim 6, in, The pinyin category determination model in the model training unit is obtained by jointly training a speech feature extraction sub-model constructed by a self-attention structure and a pinyin feature extraction sub-model constructed by a recursive neural network.
8. The device according to claim 6, in, The pinyin information in the sample acquisition unit is obtained by the following unit conversion: The marking unit is configured to mark each voice message with Chinese characters to obtain Chinese character information of each voice message; The conversion unit is configured to convert the Chinese character information of each voice message to obtain the pinyin information corresponding to each voice message.
9. The device according to claim 6, further comprising: include: A pre-training unit is configured to pre-train the pinyin category determination model to obtain parameters of the speech feature extraction sub-model in the pre-trained pinyin category determination model; The initialization unit is configured to initialize the parameters of the pinyin category determination model based on the parameters of the speech feature extraction sub-model obtained through pre-training.
10. A device for generating information, the device include: A target acquisition unit is configured to acquire target voice information and target pinyin information corresponding to each piece of target voice information, wherein the target pinyin information is obtained based on marking each piece of target voice information; The information generation unit is configured to input the target speech information and the target pinyin information into a trained pinyin category determination model to generate pinyin category information of the target pinyin information, wherein the pinyin category determination model is trained by the method described in one of claims 1-4.
11. An electronic device, It is characterized in that include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.
12. A non-transitory computer-readable storage medium storing computer instructions, It is characterized in that The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Voice recognition method based on key words
CN109545190A
Model generation method and device
CN109545192A
Speech recognition method and device and terminal
CN109976702A
Voice recognition method and system
CN110992959A
Method and device for generating voice synthesis model
JP2019200408A
