Model training method, dialect recognition method, device, server and storage medium

Through the joint training method, the encoder and the attention module are used to process the speech recognition model, which solves the problems of dialect recognition accuracy and large calculation amount in the existing technology, and achieves simplicity and accuracy of dialect recognition.

CN112634867BActive Publication Date: 2024-10-15PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011453440.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-11
Publication Date
2024-10-15
Estimated Expiration
2040-12-11

AI Technical Summary

Technical Problem

It is difficult for existing speech recognition technology to accurately recognize different dialects, and early models need to train acoustic and language models separately, resulting in large calculations and redundancy.

Method used

A model training method is used to obtain the target text and dialect speech sequences and Mandarin speech sequences, and the encoder, attention module and connection timing classifier are used for joint training to generate a dialect recognition model until the model converges.

Benefits of technology

It simplifies the training process of the dialect recognition model, improves the recognition accuracy, reduces the amount of calculation, and is suitable for the recognition of multiple dialects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112634867B_ABST
    Figure CN112634867B_ABST
Patent Text Reader

Abstract

The present application provides a model training method, a dialect recognition method, an apparatus, a server and a storage medium. The method comprises: obtaining sample data, the sample data comprising a target text and a dialect speech sequence and a Mandarin speech sequence corresponding to the target text; obtaining a first text, a second text and a third text based on a first encoder, a second encoder, a first attention module, a second attention module, a connection time series classifier and a decoder, and according to the dialect speech sequence and the Mandarin speech sequence; then determining a target loss value of a dialect recognition model according to the target text, the first text, the second text and the third text, and determining whether the dialect recognition model has converged according to the target loss value; when it is determined that the dialect recognition model has not converged, updating the model parameters of the dialect recognition model, and continuing to train the updated dialect recognition model until the dialect recognition model converges; the present solution makes the training of the dialect recognition model simpler and more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of speech recognition technology, and in particular to a model training method, a dialect recognition method, a device, a server and a storage medium. Background Art

[0002] In the technical field of speech recognition, dialect recognition has always been a difficult problem. In a given continuous speech, the accent of the dialect is often mixed in all the speech segments, and the strength changes irregularly. In early speech recognition models, the pronunciation library and acoustic model can be adjusted to achieve more accurate dialect recognition, but the adjusted acoustic model is only applicable to the dialects involved in the training data, and it is difficult to ensure that dialects from different types can be accurately recognized. Moreover, early language recognition models need to train acoustic models and language models separately, which brings a lot of redundant calculations. Summary of the invention

[0003] The main purpose of this application is to provide a model training method, a dialect recognition method, a device, a server and a storage medium, aiming to make the training of the dialect recognition model simpler and more accurate, so as to make the subsequent dialect recognition more accurate.

[0004] In a first aspect, the present application provides a model training method, which is used to train a dialect recognition model. The method is applied to a server, and the dialect recognition model includes a first encoder, a second encoder, a first attention module, a second attention module, a connection timing classifier, and a decoder. The method includes:

[0005] Acquire sample data, wherein the sample data includes a target text and a dialect speech sequence and a Mandarin speech sequence corresponding to the target text;

[0006] Input the dialect speech sequence into the first encoder to obtain a first feature vector, and input the Mandarin speech sequence into the second encoder to obtain a second feature vector;

[0007] Inputting the first feature vector and the second feature vector into the connection time series classifier to obtain a first text;

[0008] Inputting the first feature vector into the first attention module to obtain a first context association vector, and inputting the second feature vector into the second attention module to obtain a second context association vector;

[0009] Inputting the first context association vector and the second context association vector into the decoder to obtain a second text and a third text;

[0010] Determining a target loss value of the dialect recognition model according to the target text, the first text, the second text, and the third text;

[0011] Determining whether the dialect recognition model converges according to the target loss value;

[0012] If the dialect recognition model has not converged, the model parameters of the dialect recognition model are updated, and the updated dialect recognition model is continuously trained until the dialect recognition model converges.

[0013] In a second aspect, the present application also provides a dialect recognition method, comprising:

[0014] Acquire speech information to be recognized, and extract a speech feature sequence from the speech information to obtain a speech feature sequence corresponding to the speech information;

[0015] The speech feature sequence is input into a preset dialect recognition model to obtain a text corresponding to the speech information, wherein the preset dialect recognition model is trained by the model training method described in the specification.

[0016] In a third aspect, the present application further provides a model training device, wherein the dialect recognition model includes a first encoder, a second encoder, a first attention module, a second attention module, a connection timing classifier and a decoder, and the model training device includes: an acquisition module and a model training module, wherein:

[0017] The acquisition module is used to acquire sample data, wherein the sample data includes a target text and a dialect speech sequence and a Mandarin speech sequence corresponding to the target text;

[0018] The model training module is used to:

[0019] Input the dialect speech sequence into the first encoder to obtain a first feature vector, and input the Mandarin speech sequence into the second encoder to obtain a second feature vector;

[0020] Inputting the first feature vector and the second feature vector into the connection time series classifier to obtain a first text;

[0021] Inputting the first feature vector into the first attention module to obtain a first context association vector, and inputting the second feature vector into the second attention module to obtain a second context association vector;

[0022] Inputting the first context association vector and the second context association vector into the decoder to obtain a second text and a third text;

[0023] Determining a target loss value of the dialect recognition model according to the target text, the first text, the second text, and the third text;

[0024] Determining whether the dialect recognition model converges according to the target loss value;

[0025] If the dialect recognition model has not converged, the model parameters of the dialect recognition model are updated, and the updated dialect recognition model is continuously trained until the dialect recognition model converges.

[0026] In a fourth aspect, the present application also provides a server, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the model training method as described above or the steps of the dialect recognition method as described above are implemented.

[0027] In a fifth aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the model training method as described above or the steps of the dialect recognition method as described above are implemented.

[0028] The present application provides a model training method, a dialect recognition method, an apparatus, a server, and a storage medium. The present application obtains sample data; inputs a dialect speech sequence into a first encoder to obtain a first feature vector, and inputs a Mandarin speech sequence into a second encoder to obtain a second feature vector; inputs the first feature vector and the second feature vector into a connection time series classifier to obtain a first text; inputs the first feature vector into a first attention module to obtain a first context association vector, and inputs the second feature vector into a second attention module to obtain a second context association vector; inputs the first context association vector and the second context association vector into a decoder to obtain a second text and a third text; then determines a target loss value of a dialect recognition model according to a target text, a first text, a second text, and a third text; determines whether the dialect recognition model converges according to the target loss value; if the dialect recognition model does not converge, updates the model parameters of the dialect recognition model, and continues to train the updated dialect recognition model until the dialect recognition model converges. The dialect recognition model of this scheme adopts a joint training method. The dialect speech sequence and Mandarin speech sequence corresponding to the same target text are input into the dialect recognition model for training. The attention mechanism and connection temporal classification model training can achieve monotonic alignment between input and output, making the trained dialect recognition model more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0030] Figure 1 A schematic diagram of the steps of a model training method provided in an embodiment of the present application;

[0031] Figure 2 for Figure 1 A flowchart of the sub-steps of the model training method in ;

[0032] Figure 3 A schematic diagram of a model training provided in an embodiment of the present application;

[0033] Figure 4 A schematic diagram of the steps of a dialect recognition method provided in an embodiment of the present application;

[0034] Figure 5 A schematic block diagram of a model training device provided in an embodiment of the present application;

[0035] Figure 6 A schematic block diagram of the structure of a server provided in an embodiment of the present application.

[0036] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0038] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0039] The embodiment of the present application provides a model training method, a dialect recognition method, a device, a server and a storage medium. The model training method can be applied to a server, which can be a single server or a server cluster composed of multiple single servers.

[0040] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0041] Please refer to Figure 1 , Figure 1 A schematic flowchart of the steps of a model training method provided in an embodiment of the present application.

[0042] like Figure 1 As shown, the model training method is used to train a dialect recognition model, and the method includes steps S101 to S108.

[0043] Step S101: Acquire sample data, wherein the sample data includes a target text and a dialect speech sequence and a Mandarin speech sequence corresponding to the target text.

[0044] The sample data includes a target text and a dialect speech sequence and a Mandarin speech sequence corresponding to the target text. The target text is a text text, for example, the text text is "What time is it in the morning now?" The dialect speech sequence is a plurality of speech features extracted from the dialect speech corresponding to the target text, and the Mandarin speech sequence is a speech feature extracted from the Mandarin speech corresponding to the target text. The dialect can be Sichuan dialect, Hakka dialect, Gan dialect, Hunan dialect, Fujian dialect, Jin dialect, Cantonese dialect, etc. The above speech features include Mel Frequency Cepstrum Coefficient (MFCC), fundamental frequency contour features, duration features, energy features, etc., which are not specifically limited in this application.

[0045] In one embodiment, the dialect speech sequence and the Mandarin speech sequence can be determined by: obtaining the dialect speech corresponding to the target text; sampling the dialect speech according to a sampling window of a preset size for each Chinese character syllable in the dialect speech in units of frames to obtain a dialect syllable sequence; extracting the speech features of each syllable in the dialect syllable sequence, and arranging the speech features of each syllable to obtain the dialect speech sequence. Similarly, obtaining the Mandarin speech corresponding to the target text; sampling the Mandarin speech according to a sampling window of a preset size for each Chinese character syllable in the Mandarin speech in units of frames to obtain a Mandarin syllable sequence; extracting the speech features of each syllable in the Mandarin syllable sequence, and arranging the speech features of each syllable to obtain the Mandarin speech sequence.

[0046] Step S102: input the dialect speech sequence into the first encoder to obtain a first feature vector, and input the Mandarin speech sequence into the second encoder to obtain a second feature vector.

[0047] Among them, the dialect recognition model includes a first encoder, a second encoder, a first attention module, a second attention module, a connection timing classifier and a decoder. The first encoder and the second encoder include a first preset number of neural networks, the decoder includes a second preset number of neural networks, and the connection timing classifier includes a third preset number of neural networks.

[0048] Among them, the first preset number, the second preset number and the third preset number can be selected according to actual conditions, and the embodiment of the present application does not make specific limitations on this. For example, the first preset number can be 3, the second preset number can be 2, and the third preset number can be 2. The neural network can be selected according to actual conditions. For example, the neural network is a bidirectional long short-term memory network.

[0049] In one embodiment, the dialect speech sequence is input into a first encoder to obtain a first feature vector, and the Mandarin speech sequence is input into a second encoder to obtain a second feature vector. Optionally, the first encoder includes a three-layer bidirectional long short-term memory network, and the second encoder includes a three-layer bidirectional long short-term memory network, and the model parameters of the bidirectional long short-term memory network in the first encoder and the bidirectional long short-term memory network in the second encoder are different.

[0050] Step S103: input the first feature vector and the second feature vector into the connection time series classifier to obtain a first text.

[0051] Among them, the connectionist temporal classification (CTC) includes a third preset number of neural networks, and the third preset number can be set according to actual conditions. For example, the third preset number can be 2, and the neural network can be selected as a bidirectional long short-term memory network. Then the connectionist temporal classifier includes a double-layer bidirectional long short-term memory network.

[0052] In one embodiment, the first feature vector and the second feature vector are input into a connection time sequence classifier to obtain a first text. Specifically, the first feature vector is input into a connection time sequence classifier, which uses a character set π=(π1, π2, ..., π T ) obtains a text including a blank placeholder ∈, removes the blank placeholder ∈ in the text including the blank placeholder ∈, and obtains a first text.

[0053] Step S104: input the first feature vector into the first attention module to obtain a first context association vector, and input the second feature vector into the second attention module to obtain a second context association vector.

[0054] In one embodiment, the first feature vector is input into the first attention module to obtain a first context association vector. Specifically, an attention allocation parameter is determined according to the position and context content of each sub-feature vector in the first feature vector, an attention score corresponding to each sub-feature vector is determined according to the attention allocation parameter, each sub-first context association vector is determined according to the attention score corresponding to each sub-feature vector and each sub-feature vector, and the first context association vector is obtained according to each sub-first context association vector.

[0055] In one embodiment, the second feature vector is input into the second attention module to obtain a second context association vector. Specifically, according to the position and context content of each sub-feature vector in the second feature vector, an attention allocation parameter is determined, according to the attention allocation parameter, an attention score corresponding to each sub-feature vector is determined, according to the attention score corresponding to each sub-feature vector and each sub-feature vector, each sub-second context association vector is determined, and according to each sub-second context association vector, the second context association vector is obtained.

[0056] It should be noted that the specific method for generating the second context association vector may refer to the specific method for generating the first context association vector, and the specific method for generating the second context association vector will not be described in detail herein.

[0057] Step S105: input the first context association vector and the second context association vector into the decoder to obtain a second text and a third text.

[0058] Among them, the decoder includes a second preset number of neural networks, and the second preset number can be set according to actual conditions. For example, the second preset number can be 2. The neural network can be selected as a bidirectional long short-term memory network, and the decoder includes a double-layer bidirectional long short-term memory network.

[0059] In one embodiment, the decoder includes a feedforward network and a recursive network, and the first context association vector is input into the feedforward network and the recursive network to obtain the second text. Similarly, the second context association vector is input into the feedforward network and the recursive network to obtain the third text. The text output by the decoder can be accurately and quickly determined through the feedforward network and the recursive network.

[0060] Step S106: Determine a target loss value of the dialect recognition model according to the target text, the first text, the second text and the third text.

[0061] Among them, the target loss function of the dialect recognition model is determined by the first loss function of the first attention module or the second attention module, the second loss function of the connection time series classifier and the third loss function of the encoder.

[0062] In one embodiment, if Figure 2 As shown, step S106 includes sub-steps S1061 to S1064.

[0063] Sub-step S1061: determining a first loss value based on the first loss function, according to the target text and the second text.

[0064] Exemplarily, the target text and the second text are substituted into the first loss function to calculate the first loss value. The first loss function is:

[0065]

[0066] Among them, L1 is the first loss value, x is the dialect speech sequence, y * For the second output text, For each character in the second output text, For each character in the second output text, a first loss value is determined based on the first loss function and according to the target text and the second text.

[0067] Sub-step S1062: Based on the second loss function, determine a second loss value according to the target text and the first text.

[0068] Exemplarily, the target text and the first text are substituted into the second loss function, so that the second loss value can be calculated. The second loss function is L2 is the second loss value, and y * is the first text, the x is the target text, the The calculation formula can be α t (u) is the forward variable, indicating all Tail The probability of the prefix; β t (u) is the backward variable, indicating all Start The probability of the suffix is ​​determined based on the second loss function and the second loss value according to the target text and the first text.

[0069] Sub-step S1063: Based on the third loss function, determine a third loss value according to the second text and the third text.

[0070] Exemplarily, the second text and the third text are substituted into the third loss function, so as to calculate the third loss value. The third loss function is:

[0071]

[0072] The U is the position number of the character, the y u is the text corresponding to position number u in the second text, the y u ′ is the text corresponding to the position number u in the third text, and based on the third loss function and according to the second text and the third text, a third loss value is determined.

[0073] Sub-step S1064: determining a target loss value of the dialect recognition model according to the first loss value, the second loss value and the third loss value.

[0074] Exemplarily, according to the first loss value, the second loss value and the third loss value, the minimum value of the target loss function is determined; the minimum value of the target loss function is determined as the target loss value of the dialect recognition model. Wherein, according to the first loss value, the second loss value and the third loss value, the method for determining the minimum value of the target loss function can be: obtaining the target loss function, wherein the target loss function is L=μ1L1+μ2L2+μ3L3, L is the target loss value, μ1 is the first parameter, μ2 is the second parameter, μ3 is the third parameter, L1 is the first loss value, L2 is the second loss value and L3 is the third loss value, μ1+μ2+μ3=1; based on the target loss function and the first loss value, the second loss value and the third loss value, determine the target values ​​of the first parameter, the second parameter and the third parameter that minimize the target loss function, and then the first loss value, the second loss value, the third loss value, based on the target values ​​of the first parameter, the second parameter and the third parameter, determine the target loss value of the dialect recognition model.

[0075] Step S107: Determine whether the dialect recognition model converges according to the target loss value.

[0076] Exemplarily, it is determined whether the target loss value is greater than a preset threshold; if it is determined that the target loss value is greater than the preset threshold, it is determined that the dialect recognition model has not converged; if it is determined that the target loss value is less than or equal to the preset threshold, it is determined that the dialect recognition model has converged. The preset threshold can be determined according to actual conditions, and this application does not make specific limitations on this.

[0077] Step S108: If the dialect recognition model has not converged, the model parameters of the dialect recognition model are updated, and the updated dialect recognition model is continuously trained until the dialect recognition model converges.

[0078] When it is determined that the dialect recognition model has not converged, the model parameters of the dialect recognition model are updated, and the updated dialect recognition model is continuously trained until the dialect recognition model converges. Figure 3As shown, the dialect recognition model includes a first encoder, a second encoder, a first attention module, a second attention module, a connection time series classifier and a decoder. The dialect speech sequence X1 corresponding to the target text is input into the first encoder to obtain a first feature vector h1, and the Mandarin speech sequence X2 corresponding to the target text is input into the second encoder to obtain a second feature vector h2. The first feature vector h1 and the second feature vector h2 are input into the connection time series classifier to obtain a first text Y1 and a fourth text Y2. The first feature vector h1 is input into the first attention module to obtain a first context association vector a1, and the second feature vector h2 is input into the second attention module to obtain a second context association vector a2; the first context association vector a1 and the second context association vector a2 are input into the decoder to obtain a second text Y3 and a third text Y4; according to the target text, the first text Y1, the second text Y2 and the third text Y3, the target loss value of the dialect recognition model can be determined, and then based on the target loss value, it can be determined whether to continue training the dialect recognition model.

[0079] The model training method provided in the above embodiment obtains sample data; inputs the dialect speech sequence into the first encoder to obtain the first feature vector, and inputs the Mandarin speech sequence into the second encoder to obtain the second feature vector; inputs the first feature vector and the second feature vector into the connection time series classifier to obtain the first text; inputs the first feature vector into the first attention module to obtain the first context association vector, and inputs the second feature vector into the second attention module to obtain the second context association vector; inputs the first context association vector and the second context association vector into the decoder to obtain the second text and the third text; then determines the target loss value of the dialect recognition model according to the target text, the first text, the second text and the third text; determines whether the dialect recognition model converges according to the target loss value; if the dialect recognition model does not converge, updates the model parameters of the dialect recognition model, and continues to train the updated dialect recognition model until the dialect recognition model converges. The dialect recognition model of this scheme adopts a joint training method. The dialect speech sequence and Mandarin speech sequence corresponding to the same target text are input into the dialect recognition model for training. The attention mechanism and connection temporal classification model training can achieve monotonic alignment between input and output, making the trained dialect recognition model more accurate.

[0080] like Figure 4 As shown, Figure 4 A schematic flowchart of the steps of the dialect recognition method provided in an embodiment of the present application.

[0081] like Figure 4 As shown, the dialect recognition method includes steps S201 to S202.

[0082] Step S201: Acquire speech information to be recognized, and extract a speech feature sequence from the speech information to obtain a speech feature sequence corresponding to the speech information.

[0083] The voice information to be recognized is obtained, and a voice feature sequence is extracted from the voice information to obtain a voice feature sequence corresponding to the voice information. The method of obtaining the voice information to be recognized can be determined according to actual conditions, and this application does not make specific restrictions on this. For example, the voice information to be recognized is the voice information received by the terminal.

[0084] In one embodiment, each Chinese character syllable in the speech information is sampled according to a sampling window of a preset size in units of frames to obtain a speech information sequence; the speech features of each syllable in the speech information sequence are extracted, and the speech features of each syllable are arranged to obtain a speech feature sequence.

[0085] Step S202: input the speech feature sequence into a preset dialect recognition model to obtain text corresponding to the speech information, wherein the preset dialect recognition model is obtained by training using a model training method.

[0086] The speech feature sequence is input into a preset dialect recognition model to obtain text corresponding to the speech information, wherein the preset dialect recognition model is trained by a model training method. By inputting the speech feature sequence into the preset dialect recognition model, the text corresponding to the speech information can be quickly obtained.

[0087] The dialect recognition method provided in the above embodiment obtains the voice information to be recognized, and extracts the voice feature sequence of the voice information to obtain the voice feature sequence corresponding to the voice information; the voice feature sequence is input into the preset dialect recognition model to obtain the text corresponding to the voice information, and the text corresponding to the voice information can be quickly obtained.

[0088] Please refer to Figure 5 , Figure 5 A schematic block diagram of a model training device provided in an embodiment of the present application.

[0089] like Figure 5 As shown, the model training device includes a first encoder, a second encoder, a first attention module, a second attention module, a connection time series classifier and a decoder. The model training device 300 includes: an acquisition module 310 and a model training module 320, wherein:

[0090] The acquisition module 310 is used to acquire sample data, wherein the sample data includes a target text and a dialect speech sequence and a Mandarin speech sequence corresponding to the target text;

[0091] The model training module 320 is used to:

[0092] Input the dialect speech sequence into the first encoder to obtain a first feature vector, and input the Mandarin speech sequence into the second encoder to obtain a second feature vector;

[0093] Inputting the first feature vector and the second feature vector into the connection time series classifier to obtain a first text;

[0094] Inputting the first feature vector into the first attention module to obtain a first context association vector, and inputting the second feature vector into the second attention module to obtain a second context association vector;

[0095] Inputting the first context association vector and the second context association vector into the decoder to obtain a second text and a third text;

[0096] Determining a target loss value of the dialect recognition model according to the target text, the first text, the second text, and the third text;

[0097] Determining whether the dialect recognition model converges according to the target loss value;

[0098] If the dialect recognition model has not converged, the model parameters of the dialect recognition model are updated, and the updated dialect recognition model is continuously trained until the dialect recognition model converges.

[0099] In one embodiment, the model training module 320 is further used to:

[0100] Based on the first loss function, determining a first loss value according to the target text and the second text;

[0101] Based on the second loss function, determining a second loss value according to the target text and the first text;

[0102] Based on the third loss function, determining a third loss value according to the second text and the third text;

[0103] A target loss value of the dialect recognition model is determined based on the first loss value, the second loss value and the third loss value.

[0104] In one embodiment, the model training module 320 is further used to:

[0105] Determining a minimum value of the objective loss function according to the first loss value, the second loss value, and the third loss value;

[0106] The minimum value of the target loss function is determined as the target loss value of the dialect recognition model.

[0107] In one embodiment, the model training module 320 is further used to:

[0108] Determining whether the target loss value is greater than a preset threshold;

[0109] If it is determined that the target loss value is greater than a preset threshold, it is determined that the dialect recognition model has not converged;

[0110] If it is determined that the target loss value is less than or equal to a preset threshold, it is determined that the dialect recognition model has converged.

[0111] See also Figure 6 , Figure 6 A schematic block diagram of the structure of a server provided in an embodiment of the present application.

[0112] like Figure 6 As shown, the server includes a processor, a memory, and a communication interface connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0113] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any model training method or dialect recognition method.

[0114] The processor is used to provide computing and control capabilities to support the operation of the entire server.

[0115] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any model training method or dialect recognition method.

[0116] The server also includes a network interface, which is used for network communication. Those skilled in the art will appreciate that Figure 6 The structure shown in the figure is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied. The specific server may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0117] It should be understood that the bus is, for example, an I2C (Inter-integrated Circuit) bus, the memory may be a Flash chip, a read-only memory (ROM) disk, a CD, a USB flash drive or a mobile hard disk, etc., the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0118] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0119] Acquire sample data, wherein the sample data includes a target text and a dialect speech sequence and a Mandarin speech sequence corresponding to the target text;

[0120] Input the dialect speech sequence into the first encoder to obtain a first feature vector, and input the Mandarin speech sequence into the second encoder to obtain a second feature vector;

[0121] Inputting the first feature vector and the second feature vector into the connection time series classifier to obtain a first text;

[0122] Inputting the first feature vector into the first attention module to obtain a first context association vector, and inputting the second feature vector into the second attention module to obtain a second context association vector;

[0123] Inputting the first context association vector and the second context association vector into the decoder to obtain a second text and a third text;

[0124] Determining a target loss value of the dialect recognition model according to the target text, the first text, the second text, and the third text;

[0125] Determining whether the dialect recognition model converges according to the target loss value;

[0126] If the dialect recognition model has not converged, the model parameters of the dialect recognition model are updated, and the updated dialect recognition model is continuously trained until the dialect recognition model converges.

[0127] In one embodiment, the first encoder and the second encoder include a first preset number of neural networks, the decoder includes a second preset number of neural networks, the connection time classifier includes a third preset number of neural networks, and the neural network includes a bidirectional long short-term memory network.

[0128] In one embodiment, the target loss function of the dialect recognition model is determined by the first loss function of the first attention module or the second attention module, the second loss function of the connection time series classifier and the third loss function of the encoder.

[0129] In one embodiment, when the processor determines the target loss value of the dialect recognition model according to the target text, the first text, the second text, and the third text, it is configured to implement:

[0130] Based on the first loss function, determining a first loss value according to the target text and the second text;

[0131] Based on the second loss function, determining a second loss value according to the target text and the first text;

[0132] Based on the third loss function, determining a third loss value according to the second text and the third text;

[0133] A target loss value of the dialect recognition model is determined based on the first loss value, the second loss value and the third loss value.

[0134] In one embodiment, when the processor determines the target loss value of the dialect recognition model according to the first loss value, the second loss value, and the third loss value, it is configured to implement:

[0135] Determining a minimum value of the objective loss function according to the first loss value, the second loss value, and the third loss value;

[0136] The minimum value of the target loss function is determined as the target loss value of the dialect recognition model.

[0137] In one embodiment, when determining whether the dialect recognition model has converged according to the target loss value, the processor is configured to implement:

[0138] Determining whether the target loss value is greater than a preset threshold;

[0139] If it is determined that the target loss value is greater than a preset threshold, it is determined that the dialect recognition model has not converged;

[0140] If it is determined that the target loss value is less than or equal to a preset threshold, it is determined that the dialect recognition model has converged.

[0141] In one embodiment, the processor is used to run a computer program stored in the memory, and further implements the following steps:

[0142] Acquire speech information to be recognized, and extract a speech feature sequence from the speech information to obtain a speech feature sequence corresponding to the speech information;

[0143] The speech feature sequence is input into a preset dialect recognition model to obtain a text corresponding to the speech information, wherein the preset dialect recognition model is obtained by training using a model training method.

[0144] It should be noted that technical personnel in the relevant field can clearly understand that, for the convenience and conciseness of description, the specific working process of the server described above can refer to the corresponding process in the aforementioned model training method embodiment or the corresponding process in the dialect recognition method embodiment, and will not be repeated here.

[0145] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the various embodiments of the model training method or the various embodiments of dialect recognition of the present application.

[0146] The computer-readable storage medium may be an internal storage unit of the server described in the foregoing embodiment, such as a hard disk or memory of the server. The computer-readable storage medium may also be an external storage device of the server, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the server.

[0147] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0148] It should also be understood that the term "and / or" used in the specification of this application and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system 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 system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0149] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific implementation mode of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A model training method, characterized in that: The model training method is used to train a dialect recognition model, the method is applied to a server, the dialect recognition model includes a first encoder, a second encoder, a first attention module, a second attention module, a connection timing classifier and a decoder, and the method includes: Acquire sample data, wherein the sample data includes a target text and a dialect speech sequence and a Mandarin speech sequence corresponding to the target text; Input the dialect speech sequence into the first encoder to obtain a first feature vector, and input the Mandarin speech sequence into the second encoder to obtain a second feature vector; Inputting the first feature vector and the second feature vector into the connection time series classifier to obtain a first text; Inputting the first feature vector into the first attention module to obtain a first context association vector, and inputting the second feature vector into the second attention module to obtain a second context association vector; Inputting the first context association vector and the second context association vector into the decoder to obtain a second text and a third text; Determine a target loss value of the dialect recognition model according to the target text, the first text, the second text, and the third text, wherein the target loss function is determined by a first loss function of the first attention module or the second attention module, a second loss function of the connection time series classifier, and a third loss function of the encoder; Determining whether the dialect recognition model converges according to the target loss value; If the dialect recognition model has not converged, updating the model parameters of the dialect recognition model, and continuing to train the updated dialect recognition model until the dialect recognition model converges; The step of determining the target loss value of the dialect recognition model according to the target text, the first text, the second text, and the third text includes: Based on the first loss function, determining a first loss value according to the target text and the second text; Based on the second loss function, determining a second loss value according to the target text and the first text; Based on the third loss function, determining a third loss value according to the second text and the third text; A target loss value of the dialect recognition model is determined based on the first loss value, the second loss value and the third loss value.

2. The model training method according to claim 1, characterized in that: The first encoder and the second encoder include a first preset number of neural networks, the decoder includes a second preset number of neural networks, the connection timing classifier includes a third preset number of neural networks, and the neural network includes a bidirectional long short-term memory network.

3. The model training method according to claim 2, characterized in that: Determining a target loss value of the dialect recognition model according to the first loss value, the second loss value, and the third loss value includes: Determining a minimum value of the objective loss function according to the first loss value, the second loss value, and the third loss value; The minimum value of the target loss function is determined as the target loss value of the dialect recognition model.

4. The model training method according to any one of claims 1 to 3, characterized in that: Determining whether the dialect recognition model converges according to the target loss value includes: Determining whether the target loss value is greater than a preset threshold; If it is determined that the target loss value is greater than a preset threshold, it is determined that the dialect recognition model has not converged; If it is determined that the target loss value is less than or equal to a preset threshold, it is determined that the dialect recognition model has converged.

5. A dialect recognition method, characterized in that: include: Acquire speech information to be recognized, and extract a speech feature sequence from the speech information to obtain a speech feature sequence corresponding to the speech information; The speech feature sequence is input into a preset dialect recognition model to obtain text corresponding to the speech information, wherein the preset dialect recognition model is trained by the model training method according to any one of claims 1 to 4.

6. A model training device, characterized in that: The dialect recognition model includes a first encoder, a second encoder, a first attention module, a second attention module, a connection time sequence classifier and a decoder, and the model training device includes: an acquisition module and a model training module, wherein: The acquisition module is used to acquire sample data, wherein the sample data includes a target text and a dialect speech sequence and a Mandarin speech sequence corresponding to the target text; The model training module is used to: Input the dialect speech sequence into the first encoder to obtain a first feature vector, and input the Mandarin speech sequence into the second encoder to obtain a second feature vector; Inputting the first feature vector and the second feature vector into the connection time series classifier to obtain a first text; Inputting the first feature vector into the first attention module to obtain a first context association vector, and inputting the second feature vector into the second attention module to obtain a second context association vector; Inputting the first context association vector and the second context association vector into the decoder to obtain a second text and a third text; Determine a target loss value of the dialect recognition model according to the target text, the first text, the second text, and the third text, wherein the target loss function is determined by the first loss function of the first attention module or the second attention module, the second loss function of the connection time series classifier, and the third loss function of the encoder; Determining whether the dialect recognition model converges according to the target loss value; If the dialect recognition model has not converged, updating the model parameters of the dialect recognition model, and continuing to train the updated dialect recognition model until the dialect recognition model converges; Wherein, determining the target loss value of the dialect recognition model according to the target text, the first text, the second text and the third text includes: Based on the first loss function, determining a first loss value according to the target text and the second text; Based on the second loss function, determining a second loss value according to the target text and the first text; Based on the third loss function, determining a third loss value according to the second text and the third text; A target loss value of the dialect recognition model is determined based on the first loss value, the second loss value and the third loss value.

7. A server, characterized in that: The server includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the model training method as described in any one of claims 1 to 4 are implemented or the steps of the dialect recognition method as described in claim 5 are implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the model training method according to any one of claims 1 to 4 are implemented or the steps of the dialect recognition method according to claim 5 are implemented.