WO2023030105A1 - 训练自然语言处理模型和自然语言处理的方法、电子设备 - Google Patents
训练自然语言处理模型和自然语言处理的方法、电子设备 Download PDFInfo
- Publication number
- WO2023030105A1 WO2023030105A1 PCT/CN2022/114369 CN2022114369W WO2023030105A1 WO 2023030105 A1 WO2023030105 A1 WO 2023030105A1 CN 2022114369 W CN2022114369 W CN 2022114369W WO 2023030105 A1 WO2023030105 A1 WO 2023030105A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- model
- data
- pinyin
- natural language
- language processing
- Prior art date
Links
- 238000003058 natural language processing Methods 0.000 title claims abstract description 131
- 238000000034 method Methods 0.000 title claims abstract description 102
- 238000012549 training Methods 0.000 title claims abstract description 49
- 230000008569 process Effects 0.000 claims abstract description 22
- 238000006243 chemical reaction Methods 0.000 claims abstract description 20
- 230000006870 function Effects 0.000 claims description 68
- 239000011159 matrix material Substances 0.000 claims description 47
- 238000012545 processing Methods 0.000 claims description 22
- 238000012937 correction Methods 0.000 claims description 21
- 230000000873 masking effect Effects 0.000 claims description 14
- 230000004913 activation Effects 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 4
- 101100512787 Schizosaccharomyces pombe (strain 972 / ATCC 24843) mei2 gene Proteins 0.000 description 10
- 238000010586 diagram Methods 0.000 description 6
- 238000013473 artificial intelligence Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 101100344341 Arabidopsis thaliana MAF5 gene Proteins 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 235000016496 Panda oleosa Nutrition 0.000 description 1
- 240000000220 Panda oleosa Species 0.000 description 1
- 101100512790 Schizosaccharomyces pombe (strain 972 / ATCC 24843) mei3 gene Proteins 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000003909 pattern recognition Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
- G06F16/3344—Query execution using natural language analysis
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L15/00—Speech recognition
- G10L15/08—Speech classification or search
- G10L15/18—Speech classification or search using natural language modelling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
- G06F16/3343—Query execution using phonetics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/126—Character encoding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/151—Transformation
- G06F40/157—Transformation using dictionaries or tables
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/232—Orthographic correction, e.g. spell checking or vowelisation
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L15/00—Speech recognition
- G10L15/06—Creation of reference templates; Training of speech recognition systems, e.g. adaptation to the characteristics of the speaker's voice
- G10L15/063—Training
Definitions
- the present disclosure relates to the technical field of natural language processing, and in particular to a method for training a natural language processing model and natural language processing, an electronic device, and a computer-readable storage medium.
- Natural Language Processing is an important direction in the field of computer science and artificial intelligence. Natural language processing research can realize various theories and methods for effective communication between humans and computers using natural language. For example, natural language processing technology can be used to process various corpus data, such as voice data and text data.
- AI artificial intelligence
- hardware technologies such as AI chips
- smart devices have been widely used in daily life, such as smart home voice control systems, smart speakers, smart conference system meeting record generation, etc.
- a method for training a natural language processing model including:
- the natural language processing model includes a first model and a second model, and the first model is used for pinyin data of the corpus data Performing error correction, the second model is used to perform text conversion on the pinyin data of the corpus data after error correction;
- the natural language processing model is trained to obtain the trained natural language processing model.
- the natural language processing model is trained according to the output information of the natural language processing model, and the trained natural language processing model includes:
- the natural language processing model is trained according to the first loss function and the second loss function.
- the natural language processing model is used to process the corpus data, and the output information obtained includes:
- the pinyin-to-character conversion is performed on the data after pinyin error correction.
- performing embedded coding processing on the pinyin data of the corpus data to obtain embedded vector data includes:
- Embedding coding is performed on the randomly masked pinyin data to obtain embedding vector data.
- performing random masking on the pinyin data of the corpus data includes:
- performing random masking on the at least one pinyin includes:
- the at least one pinyin is covered with a first probability, replaced with a similar pinyin with a second probability, and changed in tone with a third probability.
- the natural language processing model is trained according to the output information of the natural language processing model, and the trained natural language processing model includes:
- the natural language processing model is trained according to the weighted sum of the first loss function and the second loss function.
- calculating the first loss function includes calculating the first loss function using a cross quotient loss function based on the size of the original data dictionary constructed based on the pinyin data of the corpus data; calculating the second loss function includes calculating the second loss function based on The size of the target data dictionary constructed from the corpus data is calculated by using a cross quotient loss function to calculate the second loss function.
- the first model includes N1 encoding modules
- the second model includes N2 encoding modules
- the second model includes an additional Encoding modules, wherein N1 and N2 are positive integers greater than 1, N2>N1, N1 encoding modules are in series relationship, and N2 encoding modules are in series relationship.
- the first model further includes a first fully connected layer and a first activation function layer
- the second model further includes a second fully connected layer and a second activation function layer.
- constructing a similar pinyin set for the pinyin data of the corpus data includes: constructing a similar pinyin set based on fuzzy phonetic correspondences and edit distances.
- performing embedded coding processing on the randomly masked pinyin data to obtain embedded vector data includes:
- the embedding vector data is determined based on the first embedding matrix and the second embedding matrix.
- the first embedding matrix is a word embedding matrix
- the second embedding matrix is a position embedding matrix
- the embedding vector data is linearly related to the first embedding matrix and the second embedding matrix.
- the values of elements in the first embedding matrix and the second embedding matrix are training parameters of the natural language processing model.
- a method for natural language processing including:
- the natural language processing model includes a first model and a second model
- the first model is used for pinyin data of the corpus data Error correction is performed
- the second model is used to perform text conversion on the pinyin data of the corpus data after error correction.
- a method for natural language processing including:
- a method for speech recognition including:
- the natural language processing model includes a first model and a second model, and the first The model is used to correct the pinyin data, and the second model is used to convert the corrected pinyin data into text;
- a text input method including:
- the natural language processing model includes a first model and a second model, and the first model uses For error correction of the pinyin data, the second model is used for text conversion of the error-corrected pinyin data;
- the method further includes: using the method described in any of the foregoing embodiments to train the natural language processing model.
- the method further includes: outputting error-corrected pinyin data.
- an electronic device including: a memory; and a processor coupled to the memory, the processor is configured to execute any of the present disclosure based on instructions stored in the memory. The methods described in some examples.
- a computer-storable medium on which computer program instructions are stored, and when the instructions are executed by a processor, the methods described in any embodiments of the present disclosure are implemented.
- FIG. 1 is a flowchart illustrating a method of training a natural language processing model according to some embodiments of the present disclosure
- FIG. 2 is a schematic diagram illustrating a natural language processing model according to some embodiments of the present disclosure
- FIG. 3 is a flow chart illustrating processing corpus data using a natural language processing model according to some embodiments of the present disclosure
- Fig. 4 is a flow chart showing training the natural language processing model according to the output information of the natural language processing model according to some embodiments of the present disclosure
- Fig. 5 is a schematic diagram illustrating a natural language processing model according to other embodiments of the present disclosure.
- FIG. 6 is a flowchart illustrating a method of natural language processing according to some embodiments of the present disclosure
- FIG. 6A is a flowchart illustrating a method of speech recognition according to some embodiments of the present disclosure
- FIG. 6B is a flowchart illustrating a method for text input according to some embodiments of the present disclosure
- FIG. 7 is a block diagram illustrating an electronic device according to one embodiment of the present disclosure.
- Figure 8 is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure.
- Speech recognition can be roughly divided into five stages: preprocessing, acoustic feature extraction, acoustic model training, language model training, and decoding.
- the acoustic model and the language model are two core modules of the model of the speech recognition system, corresponding to the calculation of the probability of speech to syllable and the calculation of probability of syllable to word respectively.
- the acoustic model can be trained by a deep neural network (DNN, Deep Neural Networks) and other methods after extracting features from a large number of audios that have been marked with text.
- DNN deep neural network
- the optimization of acoustic models relies on a large amount of domain-related, rich in content, and accurately labeled audio.
- the recognition result of the acoustic model directly affects the output of the language model, thereby affecting the accuracy of the final result. Therefore, it is particularly important to correct the recognition results of the acoustic model.
- the correction method known by the inventor all corrects the text obtained by Automatic Speech Recognition (ASR) recognition, such as using the N-gram grammar model (N-Gram) model to screen the text sentence probability of the ASR recognition result to improve ASR recognition
- ASR Automatic Speech Recognition
- N-Gram N-gram grammar model
- the accuracy of the result for example, corrects the text after ASR recognition based on the confusion set and candidate thesaurus.
- processing based on ASR-recognized text requires additional work and is not portable.
- the present disclosure proposes a language model that can be used for ASR and integrates Pinyin error correction and Pinyin-to-text conversion.
- the disclosure can effectively improve the accuracy rate of ASR-based recognition, and the application in other conversion scenarios from pinyin to characters can also improve the conversion accuracy rate.
- the present disclosure can directly use the corpus data set for training the ASR acoustic model to construct the required training corpus without requiring additional manual labeling data sets, which has better versatility.
- FIG. 1 is a flowchart illustrating a method of training a natural language processing model according to some embodiments of the present disclosure.
- the method for training the natural language processing model includes: step S1, obtain the corpus data used for training; Step S3, utilize the natural language processing model, process the corpus data, obtain output information; and step S5, according to the output information of the natural language processing model, train the natural language processing model, and obtain the trained natural language processing model.
- the training corpus data can be obtained by processing the labeled text of the ASR training corpus.
- the label text of ASR training corpus is used as the real label value (also can be referred to as target data) of model prediction result;
- label text is converted into corresponding pinyin, as the input of model (also can be referred to as may be referred to as raw data). For example, if the label text is "Please adjust the temperature of the air conditioner to 20 degrees", the converted pinyin is "qing3 jiang1 kong1 tiao2 de1 wen1 du4 tiao2 dao4 er2 shi1 du4", where the Arabic numerals represent the tones.
- the pinyin here is not limited to the Chinese pinyin, for example, it can also be the Roman alphabet representing Japanese pronunciation.
- the marked text is not limited to Chinese characters, for example, it may also be kana or Chinese characters in Japanese.
- the natural language processing model includes a first model and a second model.
- the first model is used for error correction of the pinyin data of the corpus data.
- the second model is used for character conversion of the error-corrected pinyin data of the corpus data.
- the first model includes N1 encoding modules
- the second model includes N2 encoding modules, wherein N1 and N2 are positive integers greater than 1, the N1 encoding modules are connected in series, and the N2 encoding modules Modules are connected in series.
- the second model also includes an additional encoding module, that is, N2>N1.
- the encoding module adopts, for example, an encoding module of a Transformer model.
- the structure of the natural language processing model according to some embodiments of the present disclosure will be described in detail below with reference to FIG. 2 .
- the first model includes transformer0, transformer1...transformer5, a total of 6 coding modules, which are used to correct the pinyin data "sou3 ji1 mei2 dian4 le5" of the input corpus data to obtain the corrected pinyin data "shou3 ji1 mei2 dian4 le5".
- the second model includes, in addition to the 6 coding modules of the first model, transformer7, transformer8...transformer11, a total of 6 coding modules, that is, the second module includes 12 coding modules, which are used to perform error-corrected pinyin data The text is converted, and the output message "the phone is out of power" is obtained.
- the first 6-layer network is used to correct errors at the input end; all 12-layer networks are used to perform mapping conversion from pinyin to text.
- all 12-layer networks are used to perform mapping conversion from pinyin to text.
- the specific number of layers of the network can be adjusted according to actual needs.
- the corpus data is processed, and the output information obtained includes: step S31, converting the corpus data into pinyin data; step S32, constructing a similar Pinyin collection; step S33, performing embedded coding processing on the pinyin data of the corpus data to obtain embedded vector data; step S34, using the first model to process the embedded vector data to obtain pinyin error-corrected data ; Step S35, using the second model to convert the pinyin error-corrected data into characters.
- step S31 the corpus data for training, that is, the labeled text, can be converted into corresponding pinyin data by using, for example, the pypinyin processing package.
- step S32 for example, a fuzzy sound algorithm can be used to construct a similar pinyin set for the pinyin data.
- the fuzzy sound correspondence may include the initial consonant fuzzy sound correspondence and the final fuzzy sound correspondence.
- the correspondence between initial consonants and fuzzy sounds includes s ⁇ -->sh, c ⁇ -->ch, z ⁇ -->zh, l ⁇ -->n, f ⁇ -->h, r ⁇ -->l, etc. ;
- the corresponding relationship between final and fuzzy sounds includes an ⁇ -->ang, en ⁇ -->eng, in ⁇ -->ing, ian ⁇ -->iang, uan ⁇ -->uang, etc.
- a set of similar pinyin is constructed based on the correspondence between fuzzy sounds and the edit distance.
- Edit distance characterizes the difference between similar strings, such as N-Gram distance.
- the similar pinyin set corresponding to the pinyin 'zhuang' may include: 'zhang', 'chuang', 'zhuan', 'shuang', 'zang' and so on.
- a dictionary for training can also be constructed.
- Dictionaries can include raw data dictionaries and target data dictionaries.
- the original data dictionary can include the collection of all Chinese characters appearing in the corpus data, and the size is src_vocab_size.
- the target data dictionary can include a set of pinyin corresponding to Chinese characters, and the size is tgt_word_size. The construction of similar pinyin sets is mainly for the elements in the original data dictionary.
- Both the original data dictionary and the target data dictionary can include symbols such as PAD, CLS, SEP, MASK, UNK, etc.
- PAD is used to pad and align text.
- CLS and SEP are special markers for the BERT (Bidirectional Encoder Representations from Transformers) model. CLS markers are generally placed at the beginning of the first sentence.
- the SEP tag is used to separate two input sentences, for example, to input sentences A and B, the SEP tag should be added after sentences A and B.
- MASK marks are used to randomly cover data, such as some words in sentences, during model training. Each word in the corpus data can be understood as the smallest unit that each sentence is divided into after a sentence is segmented.
- UNK is used to represent unregistered words, such as unknown characters.
- words can be sorted by word frequency, and then an identification ID is given to the corresponding word according to the sequence position, which can be used for encoding conversion of the input sentence.
- step S33 performing embedded coding processing on the pinyin data of the corpus data, and obtaining the embedding vector data includes: performing random masking processing on at least one pinyin in the pinyin data of the corpus data, to obtain randomly masked pinyin data; The randomly masked pinyin data is subjected to embedded coding processing to obtain embedded vector data.
- performing random masking on the pinyin data of the corpus data includes: randomly determining at least one pinyin to be masked; and performing random masking on the at least one pinyin.
- a certain proportion of characters (Token, which can be the pinyin corresponding to a word) are randomly masked.
- Token which can be the pinyin corresponding to a word
- a sentence can be fed to the model multiple times for parameter learning.
- performing random masking on the at least one pinyin includes: covering the at least one pinyin with a first probability, replacing it with a similar pinyin with a second probability, and changing the tone with a third probability .
- the sum of the first, second and third probabilities may not be 1.
- the at least one pinyin can remain unchanged with a fourth probability.
- the specific ratio of each probability can be adjusted according to the actual situation.
- embedding coding is performed on the randomly masked pinyin data to obtain embedding vector data.
- the randomly masked pinyin data is subjected to an embedding coding process to obtain a first embedding matrix and a second embedding matrix. Then, the embedding vector data is determined according to the first embedding matrix and the second embedding matrix.
- the first embedding matrix is a word embedding matrix
- the second embedding matrix is a position embedding matrix
- the embedding vector data is linearly related to the first embedding matrix and the second embedding matrix.
- X can be the original pinyin data, or the pinyin data after being randomly masked.
- W s may be 0.
- the values of elements in the first embedding matrix and the second embedding matrix are training parameters of the natural language processing model.
- the element values in the word embedding matrix W t are always learnable during training.
- the positional embedding matrix W p can be learned during pre-training, but can remain inconvenient in the training of subsequent tasks such as fine-tuning.
- the aforementioned embedding matrices can be summed as input embedding vector data, denoting h 0 .
- h 0 XW t +W p .
- the input embedding vector data h0 can be used as the input data of the first model.
- step S34 the embedding vector data is processed by using the first model to obtain pinyin error-corrected data.
- the aforementioned embedding vector data h 0 is, for example, the input of the first encoding module of the first model, and the input of other subsequent encoding modules can be based on the embedding vector data h 0 through, for example, the N1-layer Transformer network to obtain the vector data h l of text semantic representation :
- h l is the hidden layer vector, that is, the output of the first layer Transformer network.
- step S35 the pinyin-to-character conversion is performed on the pinyin error-corrected data by using the second model.
- the second model may include N2 encoding modules, for example, an N2-layer Transformer network.
- N2 encoding modules for example, an N2-layer Transformer network.
- training the natural language processing model, and obtaining the trained natural language processing model includes: step S51, using the model prediction value of the first model and the actual The difference between the label values, calculate the first loss function; step S52, use the difference between the model prediction value of the second model and the real label value, calculate the second loss function; step S53, according to the first loss function and the second loss function to train the natural language processing model.
- a first loss function may be calculated by using the difference between the model prediction value of the first model and the real label value.
- the first model in addition to N1 coding modules, also includes a first fully connected layer and a first activation function layer, for learning to predict each pinyin that is randomly masked.
- calculating the first loss function includes calculating the first loss function by using a cross-quotient loss function according to the size of the original data dictionary constructed based on the pinyin data of the corpus data.
- model predictions can be expressed as
- Dense1 is the first fully connected layer
- ⁇ 1 is the first activation function layer, such as the softmax activation function
- src_vocab_size is the size of the original data dictionary.
- the first loss function can be expressed as
- y i Denote the real label value and model prediction value at the i-th position (such as the i-th Pinyin) respectively, and M represents the set of all pinyins that are randomly masked.
- the prediction and calculation of the first loss function are only performed on randomly masked Pinyin.
- step S52 for the pinyin data of the corpus data, a second loss function is calculated by using the difference between the model prediction value of the second model and the real label value.
- the second model in addition to including N2 encoding modules, also includes a second fully connected layer and a second activation function layer for learning and predicting the correspondence between pinyin and characters, for example, each pinyin position Corresponding Chinese characters.
- calculating the second loss function includes calculating the second loss function by using a cross quotient loss function according to the size of the target data dictionary constructed based on the corpus data.
- model predictions can be expressed as
- Dense2 is the second fully connected layer
- ⁇ 2 is the second activation function layer, such as the softmax activation function
- tgt_word_size is the size of the target data dictionary.
- the second loss function can be expressed as
- step S53 the natural language processing model is trained according to the weighted sum of the first loss function and the second loss function.
- the optimization goal of the model is to minimize the final loss function loss.
- the difference between the structure of the natural language processing model in Fig. 5 and Fig. 2 is that the first model further includes a first fully connected layer FCL1, and the second model further includes a second fully connected layer FCL2.
- the difference will be mainly described below, and the similarities will not be repeated.
- the embedding vector data determined according to the first embedding matrix and the second embedding matrix are input into the first model, and after the output of the last encoding module of the first model such as transformer5, the first fully connected layer FCL1 is used to learn to predict each randomly masked words. And, based on the predicted results, a first loss function is calculated.
- the pinyin after error correction by the first model is input into the second model to convert pinyin to characters.
- the second fully connected layer FCL2 is used to learn and predict the text corresponding to each pinyin position.
- a second loss function is calculated.
- the final loss function of the model is calculated, and the model is trained by minimizing the final loss function.
- the masked language modeling (MLM, Masked Language Modelling) task is used to train the natural language processing model, but the difference from BERT is that the disclosed embodiment does not include the next sentence prediction (NSP, Next Sentence Prediction ) task, but the task of using the first model for pinyin error correction is added.
- the training task in the embodiment of the present disclosure may be a pre-training task, and subsequent fine-tuning based on other tasks may be added; it may also be used as an independent training task to perform pinyin error correction and text conversion independently.
- the trained natural language processing model can be used to process the corpus data to be processed.
- the final output of the model can be normalized, and the softmax function is used to take the value with the highest probability of each pinyin corresponding position as the target result, and the final text can be obtained by indexing the target data dictionary.
- FIG. 6 is a flowchart illustrating a method of natural language processing according to some embodiments of the present disclosure.
- the method for natural language processing includes: step S1 ′, acquiring corpus data to be processed; and step S3 ′, using a natural language processing model to process the corpus data to obtain output information.
- the corpus data to be processed is, for example, actual ASR-recognized data.
- step S3' the natural language processing model includes a first model and a second model, wherein the first model is used to correct the pinyin data of the corpus data, and the second model is used to correct the The error-corrected pinyin data of the corpus data is converted into characters.
- the processing of step S3' is similar to the processing of step S3 in Fig. 1-3, and will not be repeated here.
- a method for training a natural language processing model and a method for natural language processing are provided, which can improve the accuracy of natural language processing.
- the natural language processing model trained according to the embodiments of the present disclosure can stably increase the accuracy of ASR recognition effect by at least 3 percentage points on multiple public corpus data sets.
- the foregoing natural language processing method can be applied to various scenarios as required, such as speech recognition, pinyin input, and the like.
- FIG. 6A is a flowchart illustrating a method of speech recognition according to some embodiments of the present disclosure.
- the method for speech recognition comprises: step S10, obtain the speech to be recognized; Step S20, convert the speech to be recognized into pinyin data; Step S30, utilize natural language processing model, correct the described pinyin data error, and identify the corresponding text according to the error-corrected pinyin data; Step S40, outputting the recognized text.
- the speech to be recognized includes, for example, the human voice received during the speech interaction process, and may be in various languages, including but not limited to Chinese and Japanese.
- the voice to be recognized can be obtained through equipment such as a microphone.
- the converted Pinyin data is not limited to Chinese Pinyin and Japanese Roman alphabet, and can also be applied to other languages with similar characteristics.
- the natural language processing model includes a first model and a second model, the first model is used to correct the pinyin data, and the second model is used to correct the pinyin data after error correction text conversion.
- the structure and training method of the natural language processing model have been described in detail in the foregoing embodiments, and will not be repeated here.
- the recognized text may be output using, for example, a display.
- the speech recognition method further includes outputting error-corrected pinyin data. That is, the natural language processing model can output not only the final recognition result, but also the intermediate processing result of the model.
- FIG. 6B is a flow chart illustrating a method for text input according to some embodiments of the present disclosure.
- the method for text input includes: step S20', obtaining the pinyin data to be processed; step S30', using the natural language processing model to correct the error of the pinyin data, and the corrected pinyin data Convert into text; step S40', input the converted text.
- the Pinyin data to be processed is not limited to Chinese Pinyin and Japanese Romanization, and can also be applied to other languages with similar characteristics.
- the pinyin data to be processed can be obtained through, for example, keyboard input.
- the natural language processing model includes a first model and a second model, the first model is used to correct the pinyin data, and the second model is used to correct the pinyin data after error correction Do text conversion.
- the structure and training method of the natural language processing model have been described in detail in the foregoing embodiments, and will not be repeated here.
- the input text may be displayed using, for example, a display.
- the method for character input further includes outputting error-corrected pinyin data. That is, the natural language processing model can output not only the final recognition result, but also the intermediate processing result of the model. So far, various method embodiments of the present disclosure have been described in detail, and the corresponding product embodiments are described below. The embodiment of the present disclosure also provides an electronic device.
- FIG. 7 is a block diagram illustrating an electronic device according to one embodiment of the present disclosure.
- the electronic device 70 includes: a memory 701 and a processor 702 coupled to the memory 701 .
- the memory 701 is configured to store instructions for executing the method for natural language processing or the method for training a natural language processing model corresponding to the embodiment.
- the processor 702 is configured to execute one or more steps in the method in any of the embodiments of the present disclosure based on the instructions stored in the memory 701 .
- one or more steps in the aforementioned method for training a natural language processing model or the method for natural language processing may be implemented by a processor, and may be implemented in any manner of software, hardware, firmware or a combination thereof.
- an embodiment of the present disclosure may also use a computer program product implemented on one or more non-volatile storage media containing computer program instructions form. Therefore, an embodiment of the present disclosure further provides a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, one or more steps in the method in any of the foregoing embodiments are implemented.
- Figure 8 is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure.
- the computer system can be expressed in the form of a general-purpose computing device, and the computer system can be used to implement the hand-drawn pattern recognition device of the above-mentioned embodiment.
- the computer system includes a memory 810, a processor 820 and a bus 800 connecting the various system components.
- the memory 810 may include, for example, a system memory, a non-volatile storage medium, and the like.
- the system memory stores, for example, an operating system, an application program, a boot loader (Boot Loader) and other programs.
- System memory may include volatile storage media such as random access memory (RAM) and/or cache memory.
- RAM random access memory
- the non-volatile storage medium for example, stores instructions for executing the corresponding embodiments of the disclosed method.
- Non-volatile storage media include, but are not limited to, magnetic disk storage, optical storage, flash memory, and the like.
- the processor 820 can be realized by means of discrete hardware components such as general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gates, or transistors. accomplish.
- each device such as the judging device and the determining device can be realized by executing instructions in the memory of a central processing unit (CPU) to execute corresponding steps, or can also be realized by a dedicated circuit that executes corresponding steps.
- CPU central processing unit
- Bus 800 may use any of a variety of bus structures.
- bus structures include, but are not limited to, Industry Standard Architecture (ISA) buses, Micro Channel Architecture (MCA) buses, Peripheral Component Interconnect (PCI) buses.
- ISA Industry Standard Architecture
- MCA Micro Channel Architecture
- PCI Peripheral Component Interconnect
- the computer system may also include an input and output interface 830, a network interface 840, a storage interface 850, and the like. These interfaces 830 , 840 , and 850 , as well as the memory 810 and the processor 820 may be connected through a bus 800 .
- the input and output interface 830 can provide a connection interface for input and output devices such as a monitor, a mouse, and a keyboard.
- the network interface 840 provides a connection interface for various networked devices.
- the storage interface 840 provides connection interfaces for external storage devices such as floppy disks, U disks, and SD cards.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Acoustics & Sound (AREA)
- General Health & Medical Sciences (AREA)
- Multimedia (AREA)
- Human Computer Interaction (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Machine Translation (AREA)
- Document Processing Apparatus (AREA)
Abstract
本公开涉及一种训练自然语言处理模型和自然语言处理的方法、电子设备。训练自然语言处理模型的方法包括:获取训练用的语料数据;利用自然语言处理模型,对所述语料数据进行处理,得到输出信息,所述自然语言处理模型包括第一模型和第二模型,其中,所述第一模型用于对所述语料数据的拼音数据进行纠错,所述第二模型用于对纠错后的所述语料数据的拼音数据进行文字转换;根据所述自然语言处理模型的输出信息,训练所述自然语言处理模型,得到训练后的自然语言处理模型。
Description
相关申请的交叉引用
本申请是以中国申请号为202111008140.X,申请日为2021年8月30日的申请为基础,并主张其优先权,该中国申请的公开内容在此作为整体引入本申请中。
本公开涉及自然语言处理技术领域,特别涉及一种训练自然语言处理模型和自然语言处理的方法、电子设备,以及计算机可读存储介质。
自然语言处理(NLP,Natural Language Processing)是计算机科学领域与人工智能领域中的一个重要方向。自然语言处理研究能实现人与计算机之间用自然语言进行有效通信的各种理论和方法。例如,利用自然语言处理技术可以对各种语料数据,例如语音数据、文本数据,进行处理。
随着人工智能(AI)算法以及AI芯片等硬件技术的发展,智能设备已经在日常生活中被广泛应用,如智能家居语音控制系统、智能音箱、智能会议系统会议记录生成等。
然而,在语音交互过程中,说话人的口音、环境噪音、或者语句内容本身的同音多词等因素,会造成语音识别错误。并且,语音识别错误会逐级传递放大,并累积至后续链路,最终造成下游任务的失败。因此,对声学模型的识别结果进行矫正就显得尤为重要。
发明内容
根据本公开的一些实施例,提出了一种训练自然语言处理模型的方法,包括:
获取训练用的语料数据;
利用自然语言处理模型,对所述语料数据进行处理,得到输出信息,其中,所述自然语言处理模型包括第一模型和第二模型,所述第一模型用于对所述语料数据的拼音数据进行纠错,所述第二模型用于对纠错后的所述语料数据的拼音数据进行文字转换;
根据所述自然语言处理模型的输出信息,训练所述自然语言处理模型,得到训练后的自然语言处理模型。
在一些实施例中,根据所述自然语言处理模型的输出信息,训练所述自然语言处理模型,得到训练后的自然语言处理模型包括:
利用所述第一模型的模型预测值与真实标签值之间的差异,计算第一损失函数;
利用所述第二模型的模型预测值与真实标签值之间的差异,计算第二损失函数;
根据所述第一损失函数和所述第二损失函数,训练所述自然语言处理模型。
在一些实施例中,利用自然语言处理模型,对所述语料数据进行处理,得到输出信息包括:
将所述语料数据转换成拼音数据;
针对所述语料数据的拼音数据,构建相似拼音集合;
对所述语料数据的拼音数据进行嵌入编码处理,得到嵌入向量数据;
利用所述第一模型,对所述嵌入向量数据进行处理,得到拼音纠错后的数据;
利用所述第二模型,对拼音纠错后的数据进行拼音到文字的转换。
在一些实施例中,对所述语料数据的拼音数据进行嵌入编码处理,得到嵌入向量数据包括:
对所述语料数据的拼音数据中的至少一个拼音进行随机掩蔽处理,得到随机掩蔽后的拼音数据;
对所述随机掩蔽后的拼音数据进行嵌入编码处理,得到嵌入向量数据。
在一些实施例中,对所述语料数据的拼音数据进行随机掩蔽包括:
随机确定要掩蔽的至少一个拼音;
对所述至少一个拼音进行随机掩蔽处理。
在一些实施例中,对所述至少一个拼音进行随机掩蔽处理包括:
所述至少一个拼音以第一概率被遮盖、以第二概率被替换为相似拼音、以第三概率被改变声调。
在一些实施例中,根据所述自然语言处理模型的输出信息,训练所述自然语言处理模型,得到训练后的自然语言处理模型包括:
针对被随机掩蔽处理的所述至少一个拼音,利用所述第一模型的模型预测值与真实标签值之间的差异,计算第一损失函数;
针对所述语料数据的拼音数据,利用所述第二模型的模型预测值与真实标签值之间的差异,计算第二损失函数;
根据所述第一损失函数和所述第二损失函数的加权和,训练所述自然语言处理模型。
在一些实施例中,计算第一损失函数包括根据基于所述语料数据的拼音数据构建的原始数据字典的大小,利用交叉商损失函数计算所述第一损失函数;计算第二损失函数包括根据基于所述语料数据构建的目标数据字典的大小,利用交叉商损失函数计算所述计算第二损失函数。
在一些实施例中,所述第一模型包括N1个编码模块,所述第二模型包括N2个编码模块,所述第二模型除了包括所述第一模型的N1个编码模块外还包括额外的编码模块,其中N1、N2为大于1的正整数,N2>N1,N1个编码模块为串联关系,N2个编码模块为串联关系。
在一些实施例中,所述第一模型还包括第一全连接层和第一激活函数层,所述第二模型还包括第二全连接层和第二激活函数层。
在一些实施例中,针对所述语料数据的拼音数据,构建相似拼音集合包括:基于模糊音对应关系和编辑距离,构建相似拼音集合。
在一些实施例中,对所述随机掩蔽后的拼音数据进行嵌入编码处理,得到嵌入向量数据包括:
对所述随机掩蔽后的拼音数据进行嵌入编码处理,得到第一嵌入矩阵和第二嵌入矩阵;
根据第一嵌入矩阵和第二嵌入矩阵,确定所述嵌入向量数据。
在一些实施例中,所述第一嵌入矩阵为字嵌入矩阵,所述第二嵌入矩阵为位置嵌入矩阵,所述嵌入向量数据与第一嵌入矩阵和第二嵌入矩阵线性相关。
在一些实施例中,所述第一嵌入矩阵和所述第二嵌入矩阵中的元素值为所述自然语言处理模型的训练参数。
根据本公开的另一些实施例,提出了一种自然语言处理的方法,包括:
获取待处理的语料数据;
利用自然语言处理模型,对所述语料数据进行处理,得到输出信息,其中,所述自然语言处理模型包括第一模型和第二模型,所述第一模型用于对所述语料数据的拼 音数据进行纠错,所述第二模型用于对纠错后的所述语料数据的拼音数据进行文字转换。
根据本公开的又一些实施例,提出了一种自然语言处理的方法,包括:
利用前述任一实施例所述的方法,训练自然语言处理模型,得到训练后的自然语言处理模型;
利用训练后的自然语言处理模型,对待处理的语料数据进行处理。
根据本公开的一些实施例,提出了一种语音识别的方法,包括:
获取待识别的语音;
将待识别的语音转换成拼音数据;
利用自然语言处理模型,对所述拼音数据进行纠错,并根据纠错后的拼音数据识别出对应的文字,其中,所述自然语言处理模型包括第一模型和第二模型,所述第一模型用于对所述拼音数据进行纠错,所述第二模型用于对纠错后的拼音数据进行文字转换;
输出识别出的文字。
根据本公开的另一些实施例,提出了一种文字输入的方法,包括:
获取待处理的拼音数据;
利用自然语言处理模型,对所述拼音数据进行纠错,并将纠错后的拼音数据转换成文字,其中,所述自然语言处理模型包括第一模型和第二模型,所述第一模型用于对所述拼音数据进行纠错,所述第二模型用于对纠错后的拼音数据进行文字转换;
输入转换得到的文字。
在一些实施例中,所述方法还包括:利用前述任意实施例所述的方法,训练所述自然语言处理模型。
在一些实施例中,所述方法还包括:输出纠错后的拼音数据。
根据本公开的一些实施例,提出了一种电子设备,包括:存储器;以及耦接至所述存储器的处理器,所述处理器被配置为基于存储在所述存储器的指令,执行本公开任意一些实施例所述的方法。
根据本公开的另一些实施例,提出了一种计算机可存储介质,其上存储有计算机程序指令,该指令被处理器执行时实现本公开任意一些实施例所述的方法。
通过以下参照附图对本公开的示例性实施例的详细描述,本公开的其它特征及其优点将会变得清楚。
构成说明书的一部分的附图描述了本公开的实施例,并且连同说明书一起用于解释本公开的原理。
参照附图,根据下面的详细描述,可以更加清楚地理解本公开,其中:
图1是示出根据本公开一些实施例的训练自然语言处理模型的方法的流程图;
图2是示出根据本公开一些实施例的自然语言处理模型的示意图;
图3是示出根据本公开一些实施例的利用自然语言处理模型对语料数据进行处理的流程图;
图4是示出根据本公开一些实施例的根据所述自然语言处理模型的输出信息训练所述自然语言处理模型的流程图;
图5是示出根据本公开另一些实施例的自然语言处理模型的示意图;
图6是示出根据本公开一些实施例的自然语言处理的方法的流程图;
图6A是示出根据本公开一些实施例的语音识别的方法的流程图;
图6B是示出根据本公开一些实施例的文字输入的方法的流程图;
图7是示出根据本公开一个实施例的电子设备的框图;
图8是示出用于实现本公开一些实施例的计算机系统的框图。
应当明白,附图中所示出的各个部分的尺寸并不是按照实际的比例关系绘制的。此外,相同或类似的参考标号表示相同或类似的构件。
现在将参照附图来详细描述本公开的各种示例性实施例。对示例性实施例的描述仅仅是说明性的,决不作为对本公开及其应用或使用的任何限制。本公开可以以许多不同的形式实现,不限于这里所述的实施例。提供这些实施例是为了使本公开透彻且完整,并且向本领域技术人员充分表达本公开的范围。应注意到:除非另外具体说明,否则在这些实施例中阐述的部件和步骤的相对布置应被解释为仅仅是示例性的,而不是作为限制。
本公开使用的所有术语(包括技术术语或者科学术语)与本公开所属领域的普通技术人员理解的含义相同,除非另外特别定义。还应当理解,在诸如通用字典中定义的术语应当被解释为具有与它们在相关技术的上下文中的含义相一致的含义,而不应 用理想化或极度形式化的意义来解释,除非这里明确地这样定义。
对于相关领域普通技术人员已知的技术、方法和设备可能不作详细讨论,但在适当情况下,所述技术、方法和设备应当被视为说明书的一部分。
语音识别大致可分为五个阶段:预处理、声学特征提取、声学模型训练、语言模型训练和解码。其中,声学模型和语言模型为语音识别系统的模型的两个核心模块,分别对应于语音到音节概率的计算和音节到字概率的计算。
声学模型可以由大量已经标注文本的音频的提取特征之后,通过深度神经网络(DNN,Deep Neural Networks)等方法训练得到。声学模型的优化依赖大量领域相关、内容丰富、标注准确的音频。
声学模型的识别结果直接影响语言模型的输出,从而影响最终结果的精度。因此,对声学模型的识别结果进行矫正就显得尤为重要。
发明人已知的矫正方法都是对自动语音识别(ASR)识别得到的文本进行矫正,例如利用N元文法模型(N-Gram)模型对ASR识别结果的文本成句概率进行筛选,以提高ASR识别结果的准确性,又例如针对ASR识别后的文本基于混淆集和候选词库进行纠错。而基于ASR识别后的文本进行处理,都需要额外的工作,且不具便携性。
针对上述技术问题,本公开提出一种可以用于ASR的集拼音纠错与拼音转文本于一体的语言模型。
本公开可有效提高基于ASR识别的准确率,在其他拼音到文字的转换场景中的应用也可提高转换的准确率。另外,本公开可直接利用训练ASR声学模型的语料数据集构建所需的训练语料,而不需要额外的人工标注数据集,具有更好的通用性。
图1是示出根据本公开一些实施例的训练自然语言处理模型的方法的流程图。
如图1所示,训练自然语言处理模型的方法包括:步骤S1,获取训练用的语料数据;步骤S3,利用自然语言处理模型,对语料数据进行处理,得到输出信息;和步骤S5,根据所述自然语言处理模型的输出信息,训练所述自然语言处理模型,得到训练后的自然语言处理模型。
在步骤S1,训练用的语料数据可以通过对ASR训练语料的标注文本进行处理得到。在一些实施例中,将ASR训练语料的标注文本作为模型预测结果的真实标签值(也可称为目标数据);基于例如pypinyin处理包将标注文本转换成相应的拼音,作为模型的输入(也可称为原始数据)。例如,标注文本为“请将空调的温度调到20度”,其转换后的拼音为“qing3 jiang1 kong1 tiao2 de1 wen1 du4 tiao2 dao4 er2 shi1 du4”, 其中阿拉伯数字表示声调。应当理解,这里的拼音不限于汉语拼音,例如也可以是表示日语发音的罗马音。相应地,标注文本也不限于中文汉字,例如也可以是日语中的假名或汉字。
在步骤S3,所述自然语言处理模型包括第一模型和第二模型。所述第一模型用于对所述语料数据的拼音数据进行纠错。所述第二模型用于对纠错后的所述语料数据的拼音数据进行文字转换。
在一些实施例中,所述第一模型包括N1个编码模块,所述第二模型包括N2个编码模块,其中N1、N2为大于1的正整数,N1个编码模块为串联关系,N2个编码模块为串联关系。所述第二模型除了包括所述第一模型的N1个编码模块外,还包括额外的编码模块,即N2>N1。
编码模块例如采用Transformer模型的编码模块。下面结合图2具体描述根据本公开一些实施例的自然语言处理模型的结构。
如图2所示,第一模型包括transformer0、transformer1……transformer5共6个编码模块,用于对输入的语料数据的拼音数据“sou3 ji1 mei2 dian4 le5”进行纠错,得到纠错后的拼音数据“shou3 ji1 mei2 dian4 le5”。第二模型包括除了包括第一模型的6个编码模块外,还包括transformer7、transformer8……transformer11共6个编码模块,即第二模块包括12个编码模块,用于对纠错后的拼音数据进行文字转换,得到输出信息“手机没电了”。
上述实施例中,使用前6层网络,对输入端的错误进行纠正;使用全部12层的网络,进行拼音到文本的映射转换。当然,网络的具体层数可以根据实际需要进行调整。
下面进一步结合图3详细描述如何利用自然语言处理模型,对语料数据进行处理。
如图3所示,利用自然语言处理模型,对语料数据进行处理,得到输出信息包括:步骤S31,将所述语料数据转换成拼音数据;步骤S32,针对所述语料数据的拼音数据,构建相似拼音集合;步骤S33,对所述语料数据的拼音数据进行嵌入编码处理,得到嵌入向量数据;步骤S34,利用所述第一模型,对所述嵌入向量数据进行处理,得到拼音纠错后的数据;步骤S35,利用所述第二模型,对拼音纠错后的数据进行拼音到文字的转换。
在步骤S31,如前所述,可以利用例如pypinyin处理包将训练用的语料数据,即标注文本,转换成相应的拼音数据。
在步骤S32,可以利用例如模糊音算法,为拼音数据构建相似拼音集合。
模糊音对应关系可以包括声母模糊音对应关系和韵母模糊音对应关系。例如,声母模糊音对应关系包括s<-->sh,c<-->ch,z<-->zh,l<-->n,f<-->h,r<-->l等;韵母模糊音对应关系包括an<-->ang,en<-->eng,in<-->ing,ian<-->iang,uan<-->uang等。
在一些实施例中,基于模糊音对应关系和编辑距离,构建相似拼音集合。编辑距离表征相似字符串之间的差异,例如N-Gram距离。例如,拼音‘zhuang’对应的相似拼音集合可以包括:‘zhang’,’chuang’,‘zhuan’,‘shuang’,‘zang’等。
在构建相似拼音集合的过程中,还可以构建训练用的字典。字典可以包括原始数据字典和目标数据字典。原始数据字典可以包括语料数据中出现的所有汉字的集合,大小为src_vocab_size。目标数据字典可以包括汉字对应的拼音的集合,大小为tgt_word_size。构建相似拼音集合主要针对原始数据字典中的元素。
原始数据字典和目标数据字典都可以包括PAD、CLS、SEP、MASK、UNK等符号。PAD用于对文本进行填充与对齐。CLS和SEP为BERT(Bidirectional Encoder Representations from Transformers)模型的特殊标记符号。CLS标记一般放在第一个句子的首位。SEP标记用于分开两个输入句子,例如输入句子A和B,要在句子A和B后面增加SEP标记。MASK标记用于模型训练时对数据,例如句子中的一些词,进行随机遮盖。语料数据中的每个词可以理解为一句话被分词后,每句话被拆分成的最小单元。UNK用于表示未登录词,例如未知字符。
在原始数据字典和目标数据字典中,都可以利用词频对词进行排序,然后按照排序先后位置给相应的词赋予一个标识ID,可以用于对输入语句进行编码转换。
在步骤S33,对所述语料数据的拼音数据进行嵌入编码处理,得到嵌入向量数据包括:对所述语料数据的拼音数据中的至少一个拼音进行随机掩蔽处理,得到随机掩蔽后的拼音数据;对所述随机掩蔽后的拼音数据进行嵌入编码处理,得到嵌入向量数据。
在一些实施例中,对所述语料数据的拼音数据进行随机掩蔽包括:随机确定要掩蔽的至少一个拼音;对所述至少一个拼音进行随机掩蔽处理。
例如,在训练过程中,将一定比例的字符(Token,可以为单词对应的拼音)随机掩蔽。在训练模型时,一个句子可以被多次喂到模型中用于参数学习。
在确定要遮蔽掉的拼音之后,对所述至少一个拼音进行随机掩蔽处理包括:所述至少一个拼音以第一概率被遮盖、以第二概率被替换为相似拼音、以第三概率被改变 声调。第一、第二、第三概率之和可以不为1。例如,所述至少一个拼音可以第四概率保持不变。具体各个概率的比例可以根据实际情况进行调整。
以输入为“sou3 ji1 mei2 dian4 le5”为例,假设20%的拼音被随机遮蔽,被遮蔽的拼音可以40%的概率被[MASK]直接遮盖,30%的概率被替换为相似拼音,20%的概率被改变声调,10%的概率会保留原始拼音,随机遮蔽的结果如下。
40%:sou3 ji1 mei2 dian4 le5->sou3 ji1[MASK]dian4 le5
30%:sou3 ji1 mei2 dian4 le5->shou3 ji1 mei2 dian4 le5
20%:sou3 ji1 mei2 dian4 le5->sou3 ji1 mei3 dian4 le5
10%:sou3 ji1 mei2 dian4 le5->sou3 ji1 mei2 dian4 le5
在上述实施例中,通过随机遮蔽部分拼音,能够让保持对每个输入拼音的分布式表征,提高模型的准确率。因为如果句子中的某个拼音100%会被遮蔽,模型就会记住[MASK]对应某一个拼音,那么在可能的后续训练例如微调(fine-tuning)过程中,模型就会遇到没见过的单词,而这会降低模型的准确率。另外,通过随机替换相似拼音和改变拼音声调,可以让模型能够自动修正输入的错拼音,进一步提高模型的准确率。
接下来,对所述随机掩蔽后的拼音数据进行嵌入编码处理,得到嵌入向量数据。
例如,首先,对所述随机掩蔽后的拼音数据进行嵌入编码处理,得到第一嵌入矩阵和第二嵌入矩阵。然后,根据第一嵌入矩阵和第二嵌入矩阵,确定所述嵌入向量数据。
在一些实施例中,所述第一嵌入矩阵为字嵌入矩阵,所述第二嵌入矩阵为位置嵌入矩阵,所述嵌入向量数据与第一嵌入矩阵和第二嵌入矩阵线性相关。
例如,首先,将数据X=(x
1,x
2,...,x
n)编码成字嵌入矩阵W
t和位置嵌入矩阵W
p。这里,X可以是原始拼音数据,也可以是被随机遮蔽后的拼音数据。另外,由于模型训练的每一个子任务可以仅针对输入的单个句子,而不需针对同时输入的多个句子,如句子A和B,因此不需要分割嵌入矩阵W
s来区分每一个单词属于句子A还是B。即,W
s可以为0。
在一些实施例中,所述第一嵌入矩阵和所述第二嵌入矩阵中的元素值为所述自然语言处理模型的训练参数。例如,字嵌入矩阵W
t中的元素值在训练过程中一直可学习。位置嵌入矩阵W
p在预训练过程中可学习,而在后续微调等任务的训练中可以保持不便。
然后,可以将前述嵌入矩阵相加,作为输入的嵌入向量数据,表示h
0。例如,h
0=XW
t+W
p。输入的嵌入向量数据h
0即可以作为第一模型的输入数据。
接下来,在步骤S34,利用所述第一模型,对所述嵌入向量数据进行处理,得到拼音纠错后的数据。前述的嵌入向量数据h
0例如为第一模型的第一个编码模块的输入,后续其他编码模块的输入可以根据嵌入向量数据h
0通过例如N1层的Transformer网络得到文本语义表示的向量数据h
l:
h
l=Transformer(h
l-1),l∈[1,N1],
其中,h
l为隐藏层向量,即第l层Transformer网络的输出。
然后,在步骤S35,利用所述第二模型,对拼音纠错后的数据进行拼音到文字的转换。
如前所述,所述第二模型可以包括N2个编码模块,例如N2层Transformer网络。相应地,每个编码模块的输入也可以采用类似的表示,即h
l=Transformer(h
l-1),l∈[1,N2]。
下面进一步结合图4详细描述如何根据所述自然语言处理模型的输出信息,训练所述自然语言处理模型。
如图4所示,根据所述自然语言处理模型的输出信息,训练所述自然语言处理模型,得到训练后的自然语言处理模型包括:步骤S51,利用所述第一模型的模型预测值与真实标签值之间的差异,计算第一损失函数;步骤S52,利用所述第二模型的模型预测值与真实标签值之间的差异,计算第二损失函数;步骤S53,根据所述第一损失函数和所述第二损失函数,训练所述自然语言处理模型。
在步骤S51,可以针对被随机掩蔽处理的所述至少一个拼音,利用所述第一模型的模型预测值与真实标签值之间的差异,计算第一损失函数。
在一些实施例中,所述第一模型除了包括N1个编码模块之外,还包括第一全连接层和第一激活函数层,用于学习预测每个被随机遮蔽的拼音。例如,计算第一损失函数包括根据基于所述语料数据的拼音数据构建的原始数据字典的大小,利用交叉商损失函数计算所述第一损失函数。
在一些实施例中,模型预测值可以表示为
其中Dense1为第一全连接层,σ1为第一激活函数层,例如softmax激活函数,src_vocab_size为原始数据字典的大小。
例如,第一损失函数可以表示为
在步骤S52,针对所述语料数据的拼音数据,利用所述第二模型的模型预测值与真实标签值之间的差异,计算第二损失函数。
在一些实施例中,所述第二模型除了包括N2个编码模块之外,还包括第二全连接层和第二激活函数层,用于学习预测拼音与文字的对应关系,例如每一个拼音位置对应的中文汉字。例如,计算第二损失函数包括根据基于所述语料数据构建的目标数据字典的大小,利用交叉商损失函数计算所述计算第二损失函数。
在一些实施例中,模型预测值可以表示为
其中Dense2为第二全连接层,σ2为第二激活函数层,例如softmax激活函数,tgt_word_size为目标数据字典的大小。
例如,第二损失函数可以表示为
然后,在步骤S53,根据所述第一损失函数和所述第二损失函数的加权和,训练所述自然语言处理模型。
例如,模型的最终损失函数可以表示为所述第一损失函数与所述第二损失函数之和,即loss=loss
error+loss
word。模型的优化目标是使得最终损失函数loss最小化。
下面结合图5示出的根据本公开另一些实施例的自然语言处理模型的结构,具体描述如何训练自然语言处理模型。
图5与图2的自然语言处理模型的结构不同之处在于,第一模型还包括第一全连接层FCL1,第二模型还包括第二全连接层FCL2。下面将重点描述不同之处,相同之处不再赘述。
如图5所示,输入的语料数据的拼音数据“sou3 ji1 mei2 dian4 le5”经过位置嵌入、 分割嵌入、字嵌入编码处理后,分别得到对应的嵌入矩阵,即字嵌入矩阵W
t和位置嵌入矩阵W
p。其中,由于仅输入了一句话,每个拼音都属于句子A,如图5所示的EA,对应的分割嵌入矩阵的元素为0。
如图5所示,根据第一嵌入矩阵和第二嵌入矩阵确定的嵌入向量数据输入第一模型,在第一模型的最后一个编码模块如transformer5的输出后用第一全连接层FCL1学习预测每个被随机遮蔽的词。并且,基于预测的结果,计算第一损失函数。
经过第一模型纠错后的拼音输入第二模型进行拼音到文字的转换。在第二模型的最后一个编码模块如transformer11的输出后用第二全连接层FCL2学习预测每一个拼音位置对应的文字。并且,基于预测的结果,计算第二损失函数。然后,基于第一损失函数和第二损失函数,计算模型最终的损失函数,通过使得最终损失函数最小化来训练模型。
在上述实施例中,利用掩码语言建模(MLM,Masked Language Modelling)任务去训练自然语言处理模型,但是与BERT的不同之处在于本公开实施例不包括下一句预测(NSP,Next Sentence Prediction)任务,但是增加了利用第一模型进行拼音纠错的任务。另外,本公开实施例的训练任务可以是预训练任务,后续可以增加根据其他任务的微调;也可以作为独立的训练任务,独立进行拼音纠错和文字转换。
利用前述任一实施例所述的方法,例如步骤S1-S5,训练自然语言处理模型,得到训练后的自然语言处理模型。在此基础上,可以利用训练后的自然语言处理模型,对待处理的语料数据进行处理。
例如,加载训练好的自然语言处理模型,对实际的ASR识别后的数据进行拼音纠错和拼音到文字的转换。在一些实施例中,可以将模型的最终输出结果进行归一化处理,利用用softmax函数,取每个拼音对应位置概率最大的值作为目标结果,由目标数据字典索引便可得到最终的文字。
根据本公开一些实施例,还提供了一种自然语言处理的方法。图6是示出根据本公开一些实施例的自然语言处理的方法的流程图。
如图6所示,自然语言处理的方法包括:步骤S1',获取待处理的语料数据;和步骤S3',利用自然语言处理模型,对所述语料数据进行处理,得到输出信息。
在步骤S1'中,待处理的语料数据例如为实际的ASR识别后的数据。
在步骤S3'中,所述自然语言处理模型包括第一模型和第二模型,其中,所述第一模型用于对所述语料数据的拼音数据进行纠错,所述第二模型用于对纠错后的所述语 料数据的拼音数据进行文字转换。步骤S3'的处理与图1-3中步骤S3的处理类似,此处不再赘述。
在前述实施例中,提供了训练自然语言处理模型的方法和自然语言处理的方法,可以提高自然语言处理的准确性。
根据本公开实施例训练得到的自然语言处理模型,在多个公开的语料数据集上可将ASR识别效果的准确率稳定提升至少3个百分点。
前述自然语言处理的方法根据需要可以应用于各种场景,例如语音识别、拼音输入等。
图6A是示出根据本公开一些实施例的语音识别的方法的流程图。
如图6A所示,语音识别的方法包括:步骤S10,获取待识别的语音;步骤S20,将待识别的语音转换成拼音数据;步骤S30,利用自然语言处理模型,对所述拼音数据进行纠错,并根据纠错后的拼音数据识别出对应的文字;步骤S40,输出识别出的文字。
在步骤S10,待识别的语音例如包括在语音交互过程中接收到的人声,可以是各种语言,包括但不限于汉语、日语。待识别的语音可以通过例如麦克风等设备获取。
在步骤S20,转换得到的拼音数据也不限于汉语拼音和日语的罗马音,还可以适用于其他有类似特点的语言。
在步骤S30,所述自然语言处理模型包括第一模型和第二模型,所述第一模型用于对所述拼音数据进行纠错,所述第二模型用于对纠错后的拼音数据进行文字转换。自然语言处理模型的结构和训练方法在前述实施例中已经详细描述,此处不再赘述。
在步骤S40,可以利用例如显示器输出识别出的文字。在一些实施例中,语音识别的方法还包括输出纠错后的拼音数据。即,自然语言处理模型既可以输出最终识别结果,也可以输出模型的中间处理结果。
图6B是示出根据本公开一些实施例的文字输入的方法的流程图。
如图6B所示,文字输入的方法包括:步骤S20',获取待处理的拼音数据;步骤S30',利用自然语言处理模型,对所述拼音数据进行纠错,并将纠错后的拼音数据转换成文字;步骤S40',输入转换得到的文字。
在步骤S20',待处理的拼音数据也不限于汉语拼音和日语的罗马音,还可以适用于其他有类似特点的语言。待处理的拼音数据可以通过例如键盘输入来获取。
在步骤S30',所述自然语言处理模型包括第一模型和第二模型,所述第一模型用于对所述拼音数据进行纠错,所述第二模型用于对纠错后的拼音数据进行文字转换。自然语言处理模型的结构和训练方法在前述实施例中已经详细描述,此处不再赘述。
在步骤S40',可以利用例如显示器显示输入的文字。在一些实施例中,文字输入的方法还包括输出纠错后的拼音数据。即,自然语言处理模型既可以输出最终识别结果,也可以输出模型的中间处理结果。至此,已经详细描述了本公开的各种方法实施例,下面描述相应的产品实施例。本公开实施例还提供了一种电子设备。
图7是示出根据本公开一个实施例的电子设备的框图。
如图7所示,电子设备70包括:存储器701以及耦接至该存储器701的处理器702。存储器701配置成存储执行用于自然语言处理的方法或训练自然语言处理模型的方法对应实施例的指令。处理器702被配置为基于存储在存储器701中的指令,执行本公开中任意一些实施例中的方法中的一个或多个步骤。
应当理解,前述训练自然语言处理模型的方法或自然语言处理的方法中的一个或多个步骤可以通过处理器来实现,并且可以软件、硬件、固件或其结合的任一种方式实现。
除了自然语言处理的方法或训练自然语言处理模型的方法和电子设备之外,本公开实施例还可采用在一个或多个包含有计算机程序指令的非易失性存储介质上实施的计算机程序产品的形式。因此,本公开实施例还提供一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现前述任意实施例中的方法中的一个或多个步骤。
图8是示出用于实现本公开一些实施例的计算机系统的框图。
如图8所示,计算机系统可以通用计算设备的形式表现,该计算机系统可以用来实现上述实施例的手绘图形识别装置。计算机系统包括存储器810、处理器820和连接不同系统组件的总线800。
存储器810例如可以包括系统存储器、非易失性存储介质等。系统存储器例如存储有操作系统、应用程序、引导装载程序(Boot Loader)以及其他程序等。系统存储器可以包括易失性存储介质,例如随机存取存储器(RAM)和/或高速缓存存储器。非易失性存储介质例如存储有执行本公开方法的对应实施例的指令。非易失性存储介质包括但不限于磁盘存储器、光学存储器、闪存等。
处理器820可以用通用处理器、数字信号处理器(DSP)、应用专用集成电路(ASIC)、 现场可编程门阵列(FPGA)或其它可编程逻辑设备、分立门或晶体管等分立硬件组件方式来实现。相应地,诸如判断设备和确定设备的每个设备,可以通过中央处理器(CPU)运行存储器中执行相应步骤的指令来实现,也可以通过执行相应步骤的专用电路来实现。
总线800可以使用多种总线结构中的任意总线结构。例如,总线结构包括但不限于工业标准体系结构(ISA)总线、微通道体系结构(MCA)总线、外围组件互连(PCI)总线。
计算机系统还可以包括输入输出接口830、网络接口840、存储接口850等。这些接口830、840、850以及存储器810和处理器820之间可以通过总线800连接。输入输出接口830可以为显示器、鼠标、键盘等输入输出设备提供连接接口。网络接口840为各种联网设备提供连接接口。存储接口840为软盘、U盘、SD卡等外部存储设备提供连接接口。
至此,已经详细描述了本公开的各种实施例。为了避免遮蔽本公开的构思,没有描述本领域所公知的一些细节。本领域技术人员根据上面的描述,完全可以明白如何实施这里公开的技术方案。
虽然已经通过示例对本公开的一些特定实施例进行了详细说明,但是本领域的技术人员应该理解,以上示例仅是为了进行说明,而不是为了限制本公开的范围。本领域的技术人员应该理解,可在不脱离本公开的范围和精神的情况下,对以上实施例进行修改或者对部分技术特征进行等同替换。本公开的范围由所附权利要求来限定。
Claims (22)
- 一种训练自然语言处理模型的方法,包括:获取训练用的语料数据;利用自然语言处理模型,对所述语料数据进行处理,得到输出信息,其中,所述自然语言处理模型包括第一模型和第二模型,所述第一模型用于对所述语料数据的拼音数据进行纠错,所述第二模型用于对纠错后的所述语料数据的拼音数据进行文字转换;根据所述自然语言处理模型的输出信息,训练所述自然语言处理模型,得到训练后的自然语言处理模型。
- 根据权利要求1所述的方法,其中,根据所述自然语言处理模型的输出信息,训练所述自然语言处理模型,得到训练后的自然语言处理模型包括:利用所述第一模型的模型预测值与真实标签值之间的差异,计算第一损失函数;利用所述第二模型的模型预测值与真实标签值之间的差异,计算第二损失函数;根据所述第一损失函数和所述第二损失函数,训练所述自然语言处理模型。
- 根据权利要求1所述的方法,利用自然语言处理模型,对所述语料数据进行处理,得到输出信息包括:将所述语料数据转换成拼音数据;针对所述语料数据的拼音数据,构建相似拼音集合;对所述语料数据的拼音数据进行嵌入编码处理,得到嵌入向量数据;利用所述第一模型,对所述嵌入向量数据进行处理,得到拼音纠错后的数据;利用所述第二模型,对拼音纠错后的数据进行拼音到文字的转换。
- 根据权利要求3所述的方法,其中,对所述语料数据的拼音数据进行嵌入编码处理,得到嵌入向量数据包括:对所述语料数据的拼音数据中的至少一个拼音进行随机掩蔽处理,得到随机掩蔽后的拼音数据;对所述随机掩蔽后的拼音数据进行嵌入编码处理,得到嵌入向量数据。
- 根据权利要求4所述的方法,其中,对所述语料数据的拼音数据进行随机掩蔽包括:随机确定要掩蔽的至少一个拼音;对所述至少一个拼音进行随机掩蔽处理。
- 根据权利要求5所述的方法,其中,对所述至少一个拼音进行随机掩蔽处理包括:所述至少一个拼音以第一概率被遮盖、以第二概率被替换为相似拼音、以第三概率被改变声调。
- 根据权利要求4所述的方法,其中,根据所述自然语言处理模型的输出信息,训练所述自然语言处理模型,得到训练后的自然语言处理模型包括:针对被随机掩蔽处理的所述至少一个拼音,利用所述第一模型的模型预测值与真实标签值之间的差异,计算第一损失函数;针对所述语料数据的拼音数据,利用所述第二模型的模型预测值与真实标签值之间的差异,计算第二损失函数;根据所述第一损失函数和所述第二损失函数的加权和,训练所述自然语言处理模型。
- 根据权利要求7所述的方法,其中:计算第一损失函数包括根据基于所述语料数据的拼音数据构建的原始数据字典的大小,利用交叉商损失函数计算所述第一损失函数;计算第二损失函数包括根据基于所述语料数据构建的目标数据字典的大小,利用交叉商损失函数计算所述计算第二损失函数。
- 根据权利要求1-8任一项所述的方法,其中,所述第一模型包括N1个编码模块,所述第二模型包括N2个编码模块,所述第二模型除了包括所述第一模型的N1个编码模块外还包括额外的编码模块,其中N1、N2为大于1的正整数,N2>N1,N1个编码模块为串联关系,N2个编码模块为串联关系。
- 根据权利要求9所述的方法,其中,所述第一模型还包括第一全连接层和第一激活函数层,所述第二模型还包括第二全连接层和第二激活函数层。
- 根据权利要求3所述的方法,其中,针对所述语料数据的拼音数据,构建相似拼音集合包括:基于模糊音对应关系和编辑距离,构建相似拼音集合。
- 根据权利要求4所述的方法,其中,对所述随机掩蔽后的拼音数据进行嵌入编码处理,得到嵌入向量数据包括:对所述随机掩蔽后的拼音数据进行嵌入编码处理,得到第一嵌入矩阵和第二嵌入矩阵;根据第一嵌入矩阵和第二嵌入矩阵,确定所述嵌入向量数据。
- 根据权利要求12所述的方法,其中,所述第一嵌入矩阵为字嵌入矩阵,所述第二嵌入矩阵为位置嵌入矩阵,所述嵌入向量数据与第一嵌入矩阵和第二嵌入矩阵线性相关。
- 根据权利要求13所述的方法,其中,所述第一嵌入矩阵和所述第二嵌入矩阵中的元素值为所述自然语言处理模型的训练参数。
- 一种自然语言处理的方法,包括:获取待处理的语料数据;利用自然语言处理模型,对所述语料数据进行处理,得到输出信息,其中,所述自然语言处理模型包括第一模型和第二模型,所述第一模型用于对所述语料数据的拼音数据进行纠错,所述第二模型用于对纠错后的所述语料数据的拼音数据进行文字转换。
- 一种自然语言处理的方法,包括:利用权利要求1至14任一项所述的方法,训练自然语言处理模型,得到训练后的自然语言处理模型;利用训练后的自然语言处理模型,对待处理的语料数据进行处理。
- 一种语音识别的方法,包括:获取待识别的语音;将待识别的语音转换成拼音数据;利用自然语言处理模型,对所述拼音数据进行纠错,并根据纠错后的拼音数据识别出对应的文字,其中,所述自然语言处理模型包括第一模型和第二模型,所述第一模型用于对所述拼音数据进行纠错,所述第二模型用于对纠错后的拼音数据进行文字转换;输出识别出的文字。
- 一种文字输入的方法,包括:获取待处理的拼音数据;利用自然语言处理模型,对所述拼音数据进行纠错,并将纠错后的拼音数据转换成文字,其中,所述自然语言处理模型包括第一模型和第二模型,所述第一模型用于对所述拼音数据进行纠错,所述第二模型用于对纠错后的拼音数据进行文字转换;输入转换得到的文字。
- 根据权利要求17或18所述的方法,还包括:利用权利要求1至14任一项所述的方法,训练所述自然语言处理模型。
- 根据权利要求17或18所述的方法,还包括:输出纠错后的拼音数据。
- 一种电子设备,包括:存储器;以及耦接至所述存储器的处理器,所述处理器被配置为基于存储在所述存储器的指令,执行如权利要求1至20任一项所述的方法。
- 一种计算机可存储介质,其上存储有计算机程序指令,该指令被处理器执行时实现如权利要求1至20任一项所述的方法。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US18/547,711 US20240185840A1 (en) | 2021-08-30 | 2022-08-24 | Method of training natural language processing model method of natural language processing, and electronic device |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111008140.X | 2021-08-30 | ||
CN202111008140.XA CN113626563A (zh) | 2021-08-30 | 2021-08-30 | 训练自然语言处理模型和自然语言处理的方法、电子设备 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023030105A1 true WO2023030105A1 (zh) | 2023-03-09 |
Family
ID=78388629
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/114369 WO2023030105A1 (zh) | 2021-08-30 | 2022-08-24 | 训练自然语言处理模型和自然语言处理的方法、电子设备 |
Country Status (3)
Country | Link |
---|---|
US (1) | US20240185840A1 (zh) |
CN (1) | CN113626563A (zh) |
WO (1) | WO2023030105A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116127953A (zh) * | 2023-04-18 | 2023-05-16 | 之江实验室 | 一种基于对比学习的中文拼写纠错方法、装置和介质 |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113626563A (zh) * | 2021-08-30 | 2021-11-09 | 京东方科技集团股份有限公司 | 训练自然语言处理模型和自然语言处理的方法、电子设备 |
TWI834293B (zh) * | 2022-09-15 | 2024-03-01 | 陳森淼 | 自然語言處理方法及其系統與應用 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106527757A (zh) * | 2016-10-28 | 2017-03-22 | 上海智臻智能网络科技股份有限公司 | 一种输入纠错方法及装置 |
CN106601246A (zh) * | 2016-12-23 | 2017-04-26 | 陈勇 | 音到字对应中纠正软件生成的错误拼音后新的文字排列 |
CN109992765A (zh) * | 2017-12-29 | 2019-07-09 | 北京京东尚科信息技术有限公司 | 文本纠错方法及装置、存储介质和电子设备 |
CN113178193A (zh) * | 2021-03-22 | 2021-07-27 | 浙江工业大学 | 一种基于智能语音芯片的中文自定义唤醒与物联交互方法 |
CN113626563A (zh) * | 2021-08-30 | 2021-11-09 | 京东方科技集团股份有限公司 | 训练自然语言处理模型和自然语言处理的方法、电子设备 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108304385A (zh) * | 2018-02-09 | 2018-07-20 | 叶伟 | 一种语音识别文本纠错方法及装置 |
CN110110041B (zh) * | 2019-03-15 | 2022-02-15 | 平安科技(深圳)有限公司 | 错词纠正方法、装置、计算机装置及存储介质 |
CN112232062A (zh) * | 2020-12-11 | 2021-01-15 | 北京百度网讯科技有限公司 | 文本纠错方法、装置、电子设备和存储介质 |
CN113192497B (zh) * | 2021-04-28 | 2024-03-01 | 平安科技(深圳)有限公司 | 基于自然语言处理的语音识别方法、装置、设备及介质 |
CN113223509B (zh) * | 2021-04-28 | 2022-06-10 | 华南理工大学 | 一种应用于多人混杂场景下的模糊语句识别方法及系统 |
-
2021
- 2021-08-30 CN CN202111008140.XA patent/CN113626563A/zh not_active Withdrawn
-
2022
- 2022-08-24 WO PCT/CN2022/114369 patent/WO2023030105A1/zh active Application Filing
- 2022-08-24 US US18/547,711 patent/US20240185840A1/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106527757A (zh) * | 2016-10-28 | 2017-03-22 | 上海智臻智能网络科技股份有限公司 | 一种输入纠错方法及装置 |
CN106601246A (zh) * | 2016-12-23 | 2017-04-26 | 陈勇 | 音到字对应中纠正软件生成的错误拼音后新的文字排列 |
CN109992765A (zh) * | 2017-12-29 | 2019-07-09 | 北京京东尚科信息技术有限公司 | 文本纠错方法及装置、存储介质和电子设备 |
CN113178193A (zh) * | 2021-03-22 | 2021-07-27 | 浙江工业大学 | 一种基于智能语音芯片的中文自定义唤醒与物联交互方法 |
CN113626563A (zh) * | 2021-08-30 | 2021-11-09 | 京东方科技集团股份有限公司 | 训练自然语言处理模型和自然语言处理的方法、电子设备 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116127953A (zh) * | 2023-04-18 | 2023-05-16 | 之江实验室 | 一种基于对比学习的中文拼写纠错方法、装置和介质 |
Also Published As
Publication number | Publication date |
---|---|
US20240185840A1 (en) | 2024-06-06 |
CN113626563A (zh) | 2021-11-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113811946B (zh) | 数字序列的端到端自动语音识别 | |
WO2023030105A1 (zh) | 训练自然语言处理模型和自然语言处理的方法、电子设备 | |
CN111310443B (zh) | 一种文本纠错方法和系统 | |
CN107305768B (zh) | 语音交互中的易错字校准方法 | |
CN109887484B (zh) | 一种基于对偶学习的语音识别与语音合成方法及装置 | |
WO2022142041A1 (zh) | 意图识别模型的训练方法、装置、计算机设备和存储介质 | |
JP6541673B2 (ja) | モバイル機器におけるリアルタイム音声評価システム及び方法 | |
CN113591483A (zh) | 一种基于序列标注的文档级事件论元抽取方法 | |
CN112489626B (zh) | 一种信息识别方法、装置及存储介质 | |
CN111145718A (zh) | 一种基于自注意力机制的中文普通话字音转换方法 | |
CN111310441A (zh) | 基于bert的语音识别后文本修正方法、装置、终端及介质 | |
CN111489746B (zh) | 一种基于bert的电网调度语音识别语言模型构建方法 | |
WO2021143020A1 (zh) | 不良用语识别方法、装置、电子装置及存储介质 | |
CN110335608B (zh) | 声纹验证方法、装置、设备及存储介质 | |
US20230096805A1 (en) | Contrastive Siamese Network for Semi-supervised Speech Recognition | |
CN117099157A (zh) | 用于端到端自动语音识别置信度和删除估计的多任务学习 | |
CN116956835B (zh) | 一种基于预训练语言模型的文书生成方法 | |
CN111192570A (zh) | 语言模型训练方法、系统、移动终端及存储介质 | |
CN114999463B (zh) | 语音识别方法、装置、设备及介质 | |
CN113657098A (zh) | 文本纠错方法、装置、设备及存储介质 | |
CN115017890A (zh) | 基于字音字形相似的文本纠错方法和装置 | |
CN113257230B (zh) | 语音处理方法及装置、计算机可存储介质 | |
US20050197838A1 (en) | Method for text-to-pronunciation conversion capable of increasing the accuracy by re-scoring graphemes likely to be tagged erroneously | |
CN112632956A (zh) | 文本匹配方法、装置、终端和存储介质 | |
WO2024045318A1 (zh) | 自然语言预训练模型训练方法、装置、设备及存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22863244 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 18547711 Country of ref document: US |
|
NENP | Non-entry into the national phase |
Ref country code: DE |