Model training method and ASR text correction method
By performing data enhancement and BERT model training on fraud phone voice transcription data, combined with text correction technology, the problem of inaccurate presentation of voice information in text is solved, improving the accuracy of fraud phone recognition and the performance of the ASR system.
Patent Information
- Application Number
- CN202311695396.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2024-10-18
AI Technical Summary
In the existing technology, when the speech recognition model faces fraudulent calls, due to domain mismatch and the influence of the speech environment, the information cannot be accurately presented in the text, which reduces the judgment accuracy of language recognition.
By obtaining telephone voice transcription data, performing data enhancement and preprocessing, training the BERT model, and using the trained model for text correction, including data enhancement, preprocessing, BERT model training, text segmentation, pinyin conversion, and candidate word replacement, Improve the accuracy of scam call texts.
It has significantly improved the performance of the ASR system and the accuracy of the fraud identification model, and improved the accuracy of judging fraudulent calls.
Smart Images

Figure CN118797331A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a model training method and an ASR text correction method. Background Art
[0002] With the rapid development of the information age and the continuous advancement of artificial intelligence technology, unstructured data in telephone calls can generate huge information value. Due to its convenience and anonymity, criminals will also use it to commit communication information fraud. Existing technical solutions use automatic speech recognition (ASR) technology and natural language understanding (NLP) technology to automatically identify the intention of fraudulent phone calls. However, general ASR technology often has problems such as field mismatch when facing different application fields. For example, in the field of telecommunications fraud, fraudulent calls often contain some special information, and different types of fraud have different characteristics. For example, fraudsters pretend to be bank staff and say that the victim's bank card is abnormal, or pretend to be a policeman and say that the victim has committed illegal acts. The key information in these calls cannot be recognized by general ASR technology, and its recognition performance is always affected by factors such as the speaker's pronunciation and environment. At the same time, what people say sometimes does not fully conform to grammatical specifications, resulting in errors in the final speech recognition results. Therefore, only when this information in the voice can be more accurately presented in the text can the judgment accuracy of the language recognition model be improved. Summary of the invention
[0003] The present invention provides a model training method and an ASR text correction method, which are used to solve the defect in the prior art that the information in the speech cannot be accurately presented in the text, resulting in low judgment accuracy of the language recognition model.
[0004] The present invention provides a model training method, comprising:
[0005] Acquire a first data set, the first data set comprising telephone speech transcription data;
[0006] Performing data enhancement on the first data set according to preset categories to obtain a second data set; the preset categories include extra characters, missing characters, and wrong characters;
[0007] Preprocessing the second data set to obtain a third data set;
[0008] The BERT model is trained according to the third data set to obtain a trained BERT model.
[0009] Optionally, performing data enhancement on the first data set according to a preset category includes:
[0010] Determine data in the first data set whose length of text is greater than a length threshold;
[0011] Determine a random number according to the length of the text, the random number is less than or equal to a preset proportional length, the preset proportional length is determined according to the length of the text, and the random number represents the number of words to be inserted in the text, or represents the number of words to be deleted in the text, or represents the number of words to be replaced in the text;
[0012] Determine a location requiring data enhancement according to the random number;
[0013] When the category of the data enhancement is multiple words, inserting the text according to the position;
[0014] When the category of the data enhancement is a few words, deleting the text according to the position;
[0015] When the category of the data enhancement is a wrong character, the text is replaced according to the position.
[0016] The present invention also provides an ASR text correction method, applying the trained BERT model, the method comprising:
[0017] Acquire a calling text and determine a first perplexity of the calling text;
[0018] Performing word segmentation processing on the calling text to obtain multiple words;
[0019] Converting multiple words into pinyin;
[0020] For each of the words, when it is determined according to the pre-built keyword pinyin library that the pinyin of the word is not the keyword pinyin, but is within the one-step edit distance range of the keyword pinyin, the keyword corresponding to the keyword pinyin is determined as a candidate word;
[0021] The word is replaced according to the candidate word to obtain a replacement text, and a second perplexity of the replacement text is determined. When the second perplexity is less than the first perplexity, the replacement text is output.
[0022] Optionally, it also includes:
[0023] Obtain key words for the area to be revised;
[0024] Constructing a coordination factor function for each of the key words to obtain a keyword library;
[0025] The pinyin of each keyword in the keyword library is determined to obtain the pre-constructed keyword pinyin library.
[0026] Optionally, it also includes:
[0027] For each of the words, when it is determined according to the pre-constructed keyword pinyin library that the pinyin of the word is the keyword pinyin but not the keyword, all homophones of the word are determined as candidate words.
[0028] Optionally, replacing the word according to the candidate word to obtain a replacement text, and determining a second perplexity of the replacement text, and outputting the replacement text when the second perplexity is less than the first perplexity, comprises:
[0029] Replacing the words one by one according to the candidate words to obtain a plurality of replacement texts, and determining a second perplexity of each of the replacement texts;
[0030] When there are multiple replacement texts whose second perplexity is smaller than the first perplexity, and none of the multiple replacement texts smaller than the first perplexity contain words in the keyword library, the replacement text corresponding to the smallest second perplexity is output.
[0031] The present invention also provides a model training system, comprising:
[0032] A first data set acquisition module, used to acquire a first data set, wherein the first data set includes telephone voice transcription data;
[0033] A data enhancement module, configured to perform data enhancement on the first data set according to preset categories to obtain a second data set; the preset categories include extra characters, missing characters, and wrong characters;
[0034] A preprocessing module, used for preprocessing the second data set to obtain a third data set;
[0035] A training module is used to train the BERT model according to the third data set to obtain a trained BERT model.
[0036] The present invention also provides an ASR text correction system, which applies the trained BERT model, and the system includes:
[0037] A calling text acquisition module, used to acquire a calling text and determine a first perplexity of the calling text;
[0038] A word segmentation module, used for performing word segmentation processing on the calling text to obtain multiple words;
[0039] A pinyin conversion module, used for converting the plurality of words into pinyin;
[0040] A candidate word determination module, for each of the words, when it is determined according to the pre-built keyword pinyin library that the pinyin of the word is not the keyword pinyin, but is within the one-step edit distance range of the keyword pinyin, determines the keyword corresponding to the keyword pinyin as a candidate word;
[0041] The replacement text output module is used to replace the word according to the candidate word to obtain the replacement text, and determine the second perplexity of the replacement text, and output the replacement text when the second perplexity is less than the first perplexity.
[0042] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the model training method or the ASR text correction method when executing the program.
[0043] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the model training method or the ASR text correction method is implemented.
[0044] The model training method and ASR text correction method provided by the present invention are as follows: obtaining a first data set, the first data set includes telephone voice transcription data; performing data enhancement on the first data set according to preset categories to obtain a second data set; the preset categories include extra words, missing words and wrong words; preprocessing the second data set to obtain a third data set; training the BERT model according to the third data set to obtain a trained BERT model. Then further applying the trained BERT model: obtaining the caller text of the fraudulent call and determining the first perplexity of the caller text; performing word segmentation processing on the caller text to obtain multiple words; converting multiple words into pinyin; for each of the words, when it is determined that the pinyin of the word is not the keyword pinyin according to the pre-constructed keyword pinyin library, but is within the one-step edit distance range of the keyword pinyin, the keyword corresponding to the keyword pinyin is determined as a candidate word; replacing the word according to the candidate word to obtain a replacement text, and determining the second perplexity of the replacement text, when the second perplexity is less than the first perplexity, outputting the replacement text. The present invention pre-constructs a data-enhanced data set, trains a BERT model based on it, and then combines the trained BERT model with a pre-constructed keyword pinyin library to achieve text replacement and correction, thereby solving the defect in the prior art that the information in the speech cannot be accurately presented in the text, resulting in low judgment accuracy of the language recognition model. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 It is a flow chart of the model training method provided by the present invention;
[0047] Figure 2 It is a principle diagram of the ASR text correction method provided by the present invention;
[0048] Figure 3 It is a flow chart of the ASR text correction method provided by the present invention;
[0049] Figure 4 It is a module diagram of the model training system provided by the present invention;
[0050] Figure 5 It is a module diagram of the ASR text correction system provided by the present invention;
[0051] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] The main business application scenario of the present invention is to identify fraudulent intentions in suspicious telephone call data obtained by the mobile communication terminal. By correcting the text of the ASR system and adapting the pronunciation and semantics in the field of telecommunications fraud, the purpose of improving the accuracy of the fraud identification model in judging whether the phone is fraudulent or not is achieved. Moreover, it has been verified through actual anti-fraud business that the present invention can significantly improve the performance indicators and intelligence level of the ASR system.
[0054] Combine the following Figure 1-Figure 6 The model training method and ASR text correction method of the present invention are described.
[0055] Figure 1 is a flow chart of the model training method provided by the present invention, such as Figure 1 As shown, a model training method includes:
[0056] Step 101: Acquire a first data set, where the first data set includes telephone voice transcription data.
[0057] In a specific embodiment, the first data set used in the present invention is the annotated data of telephone voice transcription recorded in public security fraud cases.
[0058] Step 102: Perform data enhancement on the first data set according to preset categories to obtain a second data set; the preset categories include extra characters, missing characters, and wrong characters.
[0059] In a specific embodiment, step 102 specifically includes:
[0060] Determine data in the first data set whose length of text is greater than a length threshold;
[0061] Determine a random number according to the length of the text, the random number is less than or equal to a preset proportional length, the preset proportional length is determined according to the length of the text, and the random number represents the number of words to be inserted in the text, or represents the number of words to be deleted in the text, or represents the number of words to be replaced in the text;
[0062] Determine a location requiring data enhancement according to the random number;
[0063] When the category of the data enhancement is multiple words, inserting the text according to the position;
[0064] When the category of the data enhancement is a few words, deleting the text according to the position;
[0065] When the category of the data enhancement is a wrong character, the text is replaced according to the position.
[0066] In actual business, since the quantity and quality of the first data set do not meet the requirements, the present invention proposes a method for creating a fraud call error screening data set that meets the business scenario, that is, by performing data enhancement on the first data set according to the preset category, a second data set is obtained, which plays the role of data enhancement and service subsequent processes. The specific method is as follows:
[0067] ① Predefine the labels M, L, and W to represent three types of errors: extra characters, missing characters, and wrong characters, respectively, and use the label O to represent the normal type. That is, the correct Chinese characters in the text correspond to the label O, the extra characters in the text correspond to the label M, when there are missing characters somewhere in the text, the label corresponding to the previous character is L, and if a character in the text is an incorrect character, its corresponding label is W.
[0068] ② For multi-word types, when the length of the original transcribed text is greater than the length threshold, for example, 20, a number that is not greater than the preset ratio of the text length is randomly generated, recorded as a random number. The preset ratio can be one tenth, and the random number indicates how many words will be added to this text. After the total number of words to be added is determined, the position of the word to be added is randomly generated, and at the same time, it is ensured that the position is after a Chinese character. Then, according to the characteristics of the transcribed text, the multi-word type is constructed mainly from three aspects:
[0069] (1) Add common modal particles to normal text, such as 'uh, um, de, ah', etc. In many cases, these modal particles are said by the speaker inadvertently and have no practical meaning to the text.
[0070] (2) By duplicating a word after a word in the text, the stuttering situation in the actual speech transcription text is simulated.
[0071] (3) Randomly select a word from the key dictionary in the field of telecommunications fraud and insert it into a certain position in the text.
[0072] Finally, a Chinese character is added to a given position with a probability of 50% for method (1), 40% for method (2), and 10% for method (3). At the same time, the label corresponding to the added character is recorded as M, indicating that the character belongs to a multi-character type error.
[0073] ③ For the type with few characters, the construction is completed directly by deleting some characters in the text. You only need to remember where to start deleting each time. When the length of the original transcribed text is greater than 20, a number no greater than one tenth of the length of the text is randomly generated. The random number indicates how many characters need to be deleted in this text and is no greater than one tenth of the length of the text. After determining the total number of characters to be deleted, the position of the Chinese characters to be deleted is randomly generated. Then, the corresponding Chinese characters are deleted according to the position, and finally, according to the deleted position, the label of the Chinese character representing the deleted position is recorded as L, indicating that the character belongs to the type of error with few characters.
[0074] ④For the type of wrong characters, replace some Chinese characters in the text according to the characteristics of the transcribed text. No operation is performed on texts with a length of less than 20. When the length of the original transcribed text is greater than 20, a number no greater than one tenth of the length of the text is randomly generated. The random number indicates how many characters need to be replaced in this text and is no greater than one tenth of the length of the text. After the number is determined, the position of the Chinese characters to be replaced is randomly generated. Finally, when replacing at each position, only the Chinese characters at that position are replaced. Finally, a replacement is made from the one-step edit distance vocabulary of Pinyin with a probability of 80%, and a random word is selected from the key dictionary in the field of telecommunications fraud with a probability of 20% for replacement, and the Chinese character label at the replaced position is recorded as W.
[0075] Step 103: preprocess the second data set to obtain a third data set.
[0076] Specifically, during data preprocessing, the second data set needs to be spliced with the caller text of the fraudulent call, and regular expressions are used to remove meaningless repetitions and modal particles.
[0077] Step 104: Train the BERT model according to the third data set to obtain a trained BERT model.
[0078] In a specific embodiment, the BERT model is a commonly used pre-trained language model, which is built on the Transformer bidirectional encoder and utilizes the contextual dependency information of all layers when pre-training the deep bidirectional representation of text. For many downstream tasks, it is possible to fine-tune by combining the pre-trained BERT model and an additional output layer for a specific task, without making major adjustments to the overall BERT architecture.
[0079] The BERT model mentioned in the present invention includes an error screening module and an error correction module; wherein the error screening module uses the BERT model to screen whether the text is wrong and the error type, and directly fine-tunes the pre-trained ChineseBERT model using the data set of the present invention. In addition, the sequence labeling method is used in this fine-tuning stage, which can be regarded as a simple multi-classification task, and only a Softmax layer needs to be added after the ChineseBERT model. After fine-tuning, the label (W, L, M, O) corresponding to each word in each text segment can be obtained through the model.
[0080] The error correction module corrects the erroneous text identified by the error screening module. For error types with multiple words, directly delete the corresponding Chinese characters labeled M in the text. For error types with fewer words, add the [MASK] mark after the Chinese characters labeled L in the text, and then use the BERT model to predict the Chinese characters at that position, and add the Chinese characters with the highest probability to the text. Taking into account the various defects of the general model, the present invention also comprehensively utilizes the key dictionary in the field of telecommunications fraud and the one-step edit distance error word list.
[0081] Based on the above-mentioned trained BERT model, the present invention provides an ASR text correction method, the specific principle is as follows: Figure 2 As shown, including:
[0082] Step 0: Convert the keywords in the key dictionary in the field of telecommunications fraud into pinyin, and obtain all homophones or approximate pinyins within the one-step edit distance range of all pinyins to obtain a one-step edit distance wrong word list.
[0083] Step 1: Split the pinyin version of the business token and execute the following rules in sequence: a. Create a pinyin prefix dictionary based on the telecommunications fraud statistical dictionary and the one-step edit distance wrong word table; b. Based on the DAG construction, find all possible segmentation methods based on the prefix dictionary; c. Use dynamic programming to find the most possible segmentation method.
[0084] Step 2: Calculate the business perplexity of the original transcription text and record it as Per1[j].
[0085] Step 3: Convert all tokens in the text into pinyin format.
[0086] Step 4: Traverse the pinyin of each token and determine whether the pinyin is the pinyin of the keyword and whether the original text token is not the keyword itself.
[0087] Step 5: If the answer in step 4 is yes, add all homophones corresponding to the pinyin to the candidate word list.
[0088] Step 6: If the judgment in step 4 is no, determine again whether the pinyin is within the one-step edit distance range of the keyword pinyin. If the judgment is no, the word corresponding to the pinyin is not a keyword and is skipped.
[0089] Step 7: If the judgment in step 6 is yes, then the keyword corresponding to the pinyin is added to the candidate word list.
[0090] Step 8: Merge and remove duplicate candidate word lists.
[0091] Step 9: Traverse the words in the candidate word list, replace the tokens in the original text one by one, and calculate the business perplexity Per2[j] of the replaced text respectively.
[0092] Step 10: Determine whether the business perplexity after replacement is lower than that of the original text. If it is not, that is, Per2[j]≥Per1[j], then directly return to the original text.
[0093] Step 11: If the judgment in step 10 is yes, determine again whether there is a keyword in the replacement word. If the judgment is yes, replace it with the keyword and return. If the judgment is no, replace it with the word with the lowest confusion and return.
[0094] After completing the error screening and error correction in sequence, you can choose to repeat the error screening and error correction process on the corrected text until the model prediction result reaches the set threshold or the number of iterations reaches a certain value, and then input the corrected result into the subsequent fraud call intention identification SAR system.
[0095] Based on the above, Figure 3 is a flow chart of the ASR text correction method provided by the present invention, such as Figure 3As shown, an ASR text correction method, applying the trained BERT model, the method includes:
[0096] Step 301: Acquire a calling text and determine a first perplexity of the calling text.
[0097] In a specific embodiment, unlike the traditional perplexity (the inverse of the average predicted probability of each word raised to the Nth power), the perplexity evaluation index of the present invention adopts the perplexity based on the language model and the fraudulent phone corpus. Combined with the telecommunications fraud scenario, for a Chinese text of length N, its business perplexity is defined as:
[0098]
[0099] Where P(w i |w i-1 ,w i-2 ,…,w i-k+1 ) is the current word w given the previous k words i The probability of each word is calculated by the language model, and the training corpus of the model is the selected fraud phone corpus.
[0100] Step 302: Perform word segmentation processing on the calling text to obtain multiple words.
[0101] In a specific embodiment, in order to facilitate the comparison between keywords and speech transcription text to find suspected keywords, the speech transcription text can also be converted into pinyin first and then subjected to word segmentation processing.
[0102] Specifically, the present invention uses the pinyin version of token segmentation in the field of telecommunications fraud to perform word segmentation processing. The principle steps of token segmentation include:
[0103] Firstly, a pinyin prefix dictionary is created according to the telecommunication fraud statistical dictionary and the one-step edit distance wrong word list, and a DAG (directed acyclic graph) is constructed for the input sentence based on the prefix dictionary.
[0104] The specific steps of DAG construction are: using dynamic programming method to find a path with the highest probability on DAG as the most likely segmentation method. A text can be regarded as a path, each node corresponds to a Chinese character, each node can be segmented or not, and an optimal path is found through dynamic programming algorithm, so that the total probability of all segmentation schemes on the path is maximized. The probability here can be calculated by statistical language model. According to Markov hypothesis, the appearance of the current word is only related to the previous few words, and has nothing to do with the probability distribution of the entire sentence. Therefore, you only need to obtain the probability of each word segmentation and then multiply them to calculate the probability of a word segmentation scheme. The word segmentation probability is estimated by counting the number of occurrences of each word in the corpus, and these probabilities are independent of each other.
[0105]
[0106] Among them, W * is the optimal sentence segmentation, W is a segmentation of the sentence, w1,w2,…,w n They represent the n parts into which the sentence is divided.
[0107]
[0108] Among them, P(w n ) is the probability of business word segmentation. The probability of each word appearing is equal to the word frequency of the word in the prefix divided by the sum of the word frequencies of all words. If the word frequency is 0 or does not exist, it is treated as 1. The specific expression is as follows:
[0109]
[0110] Among them, freq[w n ] is w n The frequency of words, total_freq is the sum of the frequencies of all words, and get_boost is the coordination factor function in the field of telecommunications fraud. n ) Take the logarithmic probability, that is, take the logarithm based on the probability of each word. This is done to prevent underflow and to convert the subsequent probabilities into addition calculations.
[0111] The present invention starts from the pronunciation adaptability in the field of telecommunications fraud, and realizes the field-adaptive speech-to-text correction function through the pinyin version token segmentation in the field of telecommunications fraud, the perplexity based on the language model and the fraudulent telephone corpus, thereby enhancing the docking capability with the upstream ASR system and improving the system accuracy.
[0112] Step 303: convert the plurality of words into pinyin.
[0113] Step 304: For each of the words, when it is determined according to the pre-constructed keyword pinyin library that the pinyin of the word is not the keyword pinyin, but is within the one-step edit distance range of the keyword pinyin, the keyword corresponding to the keyword pinyin is determined as a candidate word.
[0114] In a specific embodiment, since keywords do not necessarily appear in the correct way in a speech transcription text, it is normal for keywords to appear in the speech text and be different from the correct expression in the case of dialects, noise and slurred speech. In this case, the small difference in pronunciation can be used as a breakthrough for correcting keywords. Therefore, to determine whether a word is a keyword, the difference between the pinyin of the word and the pinyin of the keyword can be measured. Based on this, the present invention constructs a one-step edit distance wrong word list in the field of telecommunications fraud according to the pinyin of keywords in the field of telecommunications fraud, and there is a one-step edit distance deviation between the word pinyin in the word list and the corresponding keyword pinyin. The edit distance, also called the Levenshtein distance, refers to the minimum number of operations required for two character strings to be completely equal through insertion, deletion, and replacement operations. One-step edit distance means that the number of edit operations is one, that is, between two pinyins, only one operation is needed to complete the conversion. The keyword pinyin after one-step edit distance processing is subjected to a pinyin correctness judgment, that is, whether the processed letter string belongs to a Mandarin pinyin judgment, and the pinyin combination finally obtained is similar to the pinyin pronunciation of the keyword. After processing all keywords in the field of telecommunications fraud, a one-step edit distance wrong word list is generated, and the keywords are matched with their wrong word pinyin.
[0115] The present invention starts from the semantic adaptability in the field of telecommunications fraud, constructs a key dictionary in the field of telecommunications fraud and a one-step edit distance wrong word list in the field of telecommunications fraud, and focuses on improving the recognition accuracy of fraud-sensitive keywords. If wrong words related to keywords appear in the voice text, they can be corrected, which makes up for the shortcomings of the general pre-training model, improves the key information density of the text, and has business application value.
[0116] Step 305: Replace the word according to the candidate word to obtain a replacement text, and determine a second perplexity of the replacement text. When the second perplexity is less than the first perplexity, output the replacement text.
[0117] After finding the suspected keywords in the speech text through the one-step edit distance wrong word list, replace the suspected keywords with keywords and calculate the perplexity of the sentence. If the overall perplexity of the replaced sentence (the second perplexity) is lower than the original perplexity (the first perplexity), it can be considered that it is more appropriate to replace the corresponding keywords at that place.
[0118] In a specific embodiment, the ASR text correction method of the present invention further includes:
[0119] Obtain key words for the area to be revised;
[0120] Constructing a coordination factor function for each of the key words to obtain a keyword library;
[0121] The pinyin of each keyword in the keyword library is determined to obtain the pre-constructed keyword pinyin library.
[0122] Among them, the areas to be revised include telecommunications fraud.
[0123] It should be noted that the pre-built keyword pinyin library mainly constructs a professional dictionary in the field of telecommunications fraud to help the model better adapt to the target field. For a specific field, the knowledge in this field will have its unique field characteristics. In order to achieve the purpose of fraud, criminals usually use some specific keywords, such as "winning", "tax refund", "account abnormality", etc., to attract the attention of the victim, and then introduce the fraud implementation link. At the same time, there are many new words in the field of telecommunications fraud. These words are often related to the hot spots of a certain period in this field. Criminals often use these hot spots to implement fraud. They often have obvious field characteristics, such as the abbreviations of many words. Therefore, the present invention analyzes different types of fraud texts through the fraud call samples that have been marked by the public security, and completes the construction of the field dictionary through the following three channels:
[0124] Channel 1: Collect vocabulary information with obvious domain characteristics.
[0125] Channel 2: Use unsupervised new word discovery methods to count possible new sensitive words, use general information extraction methods to assist in the accurate word segmentation of sentences, complete the grammar check of new keywords by comparing new words, and then perform another screening to select more appropriate results.
[0126] Channel 3: Through post-analysis of the “hard negative samples” of the fraud call recognition model, keywords in the fraud analysis scripts are extracted.
[0127] Finally, the collected words and the data in the first data set are combined as the key dictionary in the field of telecommunications fraud, denoted as D. Then, a coordination factor function get_boost(·) is constructed for each word in the key dictionary to obtain a keyword library. The specific expression of the coordination factor function is as follows:
[0128]
[0129] Among them, w is the keyword, ρ is the normalized weight, Num is the number of words contained in the word, TF is the word frequency, IDF is the inverse document frequency, Conf is the confidence of the word source (channel 1 is 1.0, channel 2 is 0.9, and channel 3 is 0.8), and IMP is the business importance in the field of telecommunications fraud (determined according to the business).
[0130] Among them, keywords usually have the following business characteristics:
[0131] Important keywords usually appear frequently in the current text (TF) but not frequently in the entire corpus (IDF).
[0132] Important keywords have different confidence levels (Conf) in different channel sources.
[0133] Important keywords are usually longer and contain more Chinese characters (Num).
[0134] The importance of keywords recognized by officials needs to be determined based on the business (IMP).
[0135] In a specific embodiment, the ASR text correction method of the present invention further includes:
[0136] For each of the words, when it is determined according to the pre-constructed keyword pinyin library that the pinyin of the word is the keyword pinyin but not the keyword, all homophones of the word are determined as candidate words.
[0137] In a specific embodiment, replacing the word according to the candidate word to obtain a replacement text, and determining a second perplexity of the replacement text, and outputting the replacement text when the second perplexity is less than the first perplexity, includes:
[0138] Replacing the words one by one according to the candidate words to obtain a plurality of replacement texts, and determining a second perplexity of each of the replacement texts;
[0139] When there are multiple replacement texts whose second perplexity is smaller than the first perplexity, and none of the multiple replacement texts smaller than the first perplexity contain words in the keyword library, the replacement text corresponding to the smallest second perplexity is output.
[0140] Finally, the intention of fraudulent calls can be identified based on the replacement text of the data, which can improve the accuracy of fraudulent call intention identification.
[0141] The model training system and ASR text correction system provided by the present invention are described below. The model training system and ASR text correction system described below can be referenced to each other with the model training method and ASR text correction method described above.
[0142] Figure 4 It is a module diagram of the model training system provided by the present invention, such as Figure 4 As shown, a model training system includes:
[0143] The first data set acquisition module 401 is used to acquire a first data set, where the first data set includes telephone voice transcription data.
[0144] The data enhancement module 402 is used to perform data enhancement on the first data set according to preset categories to obtain a second data set; the preset categories include extra characters, missing characters and wrong characters.
[0145] In a specific embodiment, the data enhancement module 402 is specifically used to:
[0146] Determine data in the first data set whose length of text is greater than a length threshold;
[0147] Determine a random number according to the length of the text, the random number is less than or equal to a preset proportional length, the preset proportional length is determined according to the length of the text, and the random number represents the number of words to be inserted in the text, or represents the number of words to be deleted in the text, or represents the number of words to be replaced in the text;
[0148] Determine a location requiring data enhancement according to the random number;
[0149] When the category of the data enhancement is multiple words, inserting the text according to the position;
[0150] When the category of the data enhancement is a few words, deleting the text according to the position;
[0151] When the category of the data enhancement is a wrong character, the text is replaced according to the position.
[0152] The preprocessing module 403 is used to preprocess the second data set to obtain a third data set.
[0153] The training module 404 is used to train the BERT model according to the third data set to obtain a trained BERT model.
[0154] Figure 5 It is a module diagram of the ASR text correction system provided by the present invention, such as Figure 5 As shown, an ASR text correction system, applying the trained BERT model, the system includes:
[0155] The calling text acquisition module 501 is used to acquire a calling text and determine a first perplexity of the calling text.
[0156] The word segmentation module 502 is used to perform word segmentation processing on the calling text to obtain multiple words.
[0157] The pinyin conversion module 503 is used to convert the plurality of words into pinyin.
[0158] The candidate word determination module 504 is used to determine the keyword corresponding to the keyword pinyin as a candidate word for each of the words when it is determined according to the pre-constructed keyword pinyin library that the pinyin of the word is not the keyword pinyin, but is within the one-step edit distance range of the keyword pinyin.
[0159] In a specific embodiment, the candidate word determination module 504 of the present invention is also used to:
[0160] For each of the words, when it is determined according to the pre-constructed keyword pinyin library that the pinyin of the word is the keyword pinyin but not the keyword, all homophones of the word are determined as candidate words.
[0161] The replacement text output module 505 is used to replace the word according to the candidate word to obtain the replacement text, and determine the second perplexity of the replacement text. When the second perplexity is less than the first perplexity, the replacement text is output.
[0162] In a specific embodiment, the ASR text correction system of the present invention further includes a keyword pinyin library pre-construction module, which is specifically used for:
[0163] Obtain key words for the area to be revised;
[0164] Constructing a coordination factor function for each of the key words to obtain a keyword library;
[0165] The pinyin of each keyword in the keyword library is determined to obtain the pre-constructed keyword pinyin library.
[0166] In a specific embodiment, the replacement text output module 505 is further used to:
[0167] Replacing the words one by one according to the candidate words to obtain a plurality of replacement texts, and determining a second perplexity of each of the replacement texts;
[0168] When there are multiple replacement texts whose second perplexity is smaller than the first perplexity, and none of the multiple replacement texts smaller than the first perplexity contain words in the keyword library, the replacement text corresponding to the smallest second perplexity is output.
[0169] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6As shown, the electronic device may include: a processor (processor) 610, a communication interface (Communications Interface) 620, a memory (memory) 630 and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the model training method, which includes:
[0170] A first data set is obtained, wherein the first data set includes telephone speech transcription data.
[0171] The first data set is enhanced according to preset categories to obtain a second data set; the preset categories include extra characters, missing characters and wrong characters.
[0172] The second data set is preprocessed to obtain a third data set.
[0173] The BERT model is trained according to the third data set to obtain a trained BERT model.
[0174] Or executing an ASR text correction method, applying the trained BERT model, the method comprising:
[0175] A calling text is obtained and a first perplexity of the calling text is determined.
[0176] The calling text is segmented to obtain a plurality of words.
[0177] The plurality of words are converted into pinyin.
[0178] For each of the words, when it is determined according to the pre-constructed keyword pinyin library that the pinyin of the word is not the keyword pinyin, but is within the one-step edit distance range of the keyword pinyin, the keyword corresponding to the keyword pinyin is determined as a candidate word.
[0179] The word is replaced according to the candidate word to obtain a replacement text, and a second perplexity of the replacement text is determined. When the second perplexity is less than the first perplexity, the replacement text is output.
[0180] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0181] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can perform a model training method, the method comprising:
[0182] A first data set is obtained, wherein the first data set includes telephone speech transcription data.
[0183] The first data set is enhanced according to preset categories to obtain a second data set; the preset categories include extra characters, missing characters and wrong characters.
[0184] The second data set is preprocessed to obtain a third data set.
[0185] The BERT model is trained according to the third data set to obtain a trained BERT model.
[0186] Or executing an ASR text correction method, applying the trained BERT model, the method comprising:
[0187] A calling text is obtained and a first perplexity of the calling text is determined.
[0188] The calling text is segmented to obtain a plurality of words.
[0189] The plurality of words are converted into pinyin.
[0190] For each of the words, when it is determined according to the pre-constructed keyword pinyin library that the pinyin of the word is not the keyword pinyin, but is within the one-step edit distance range of the keyword pinyin, the keyword corresponding to the keyword pinyin is determined as a candidate word.
[0191] The word is replaced according to the candidate word to obtain a replacement text, and a second perplexity of the replacement text is determined. When the second perplexity is less than the first perplexity, the replacement text is output.
[0192] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform a model training method, the method comprising:
[0193] A first data set is obtained, wherein the first data set includes telephone speech transcription data.
[0194] The first data set is enhanced according to preset categories to obtain a second data set; the preset categories include extra characters, missing characters and wrong characters.
[0195] The second data set is preprocessed to obtain a third data set.
[0196] The BERT model is trained according to the third data set to obtain a trained BERT model.
[0197] Or executing an ASR text correction method, applying the trained BERT model, the method comprising:
[0198] A calling text is obtained and a first perplexity of the calling text is determined.
[0199] The calling text is segmented to obtain a plurality of words.
[0200] The plurality of words are converted into pinyin.
[0201] For each of the words, when it is determined according to the pre-constructed keyword pinyin library that the pinyin of the word is not the keyword pinyin, but is within the one-step edit distance range of the keyword pinyin, the keyword corresponding to the keyword pinyin is determined as a candidate word.
[0202] The word is replaced according to the candidate word to obtain a replacement text, and a second perplexity of the replacement text is determined. When the second perplexity is less than the first perplexity, the replacement text is output.
[0203] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0204] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0205] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A model training method, characterized in that: include: Acquire a first data set, the first data set comprising telephone speech transcription data; Performing data enhancement on the first data set according to a preset category to obtain a second data set; The preset categories include extra characters, missing characters and wrong characters; Preprocessing the second data set to obtain a third data set; The BERT model is trained according to the third data set to obtain a trained BERT model.
2. The model training method according to claim 1, characterized in that: Performing data enhancement on the first data set according to a preset category includes: Determine data in the first data set whose length of text is greater than a length threshold; Determine a random number according to the length of the text, the random number is less than or equal to a preset proportional length, the preset proportional length is determined according to the length of the text, and the random number represents the number of words to be inserted in the text, or represents the number of words to be deleted in the text, or represents the number of words to be replaced in the text; Determine a location requiring data enhancement according to the random number; When the category of the data enhancement is multiple words, inserting the text according to the position; When the category of the data enhancement is a few words, deleting the text according to the position; When the category of the data enhancement is a wrong character, the text is replaced according to the position.
3. An ASR text correction method, characterized in that: Applied to the trained BERT model of claim 1 or 2, the method comprising: Acquire a calling text and determine a first perplexity of the calling text; Performing word segmentation processing on the calling text to obtain multiple words; Converting multiple words into pinyin; For each of the words, when it is determined according to the pre-built keyword pinyin library that the pinyin of the word is not the keyword pinyin, but is within the one-step edit distance range of the keyword pinyin, the keyword corresponding to the keyword pinyin is determined as a candidate word; The word is replaced according to the candidate word to obtain a replacement text, and a second perplexity of the replacement text is determined. When the second perplexity is less than the first perplexity, the replacement text is output.
4. The ASR text correction method according to claim 3, characterized in that: Also includes: Obtain key words for the area to be revised; Constructing a coordination factor function for each of the key words to obtain a keyword library; The pinyin of each keyword in the keyword library is determined to obtain the pre-constructed keyword pinyin library.
5. The ASR text correction method according to claim 3 or 4, characterized in that: Also includes: For each of the words, when it is determined according to the pre-constructed keyword pinyin library that the pinyin of the word is the keyword pinyin but not the keyword, all homophones of the word are determined as candidate words.
6. The ASR text correction method according to claim 5, characterized in that: The word is replaced according to the candidate word to obtain a replacement text, and a second perplexity of the replacement text is determined, and when the second perplexity is less than the first perplexity, the replacement text is output, including: Replacing the words one by one according to the candidate words to obtain a plurality of replacement texts, and determining a second perplexity of each of the replacement texts; When there are multiple replacement texts whose second perplexity is smaller than the first perplexity, and none of the multiple replacement texts smaller than the first perplexity contain words in the keyword library, the replacement text corresponding to the smallest second perplexity is output.
7. A model training system, characterized in that: include: A first data set acquisition module, used to acquire a first data set, wherein the first data set includes telephone voice transcription data; A data enhancement module, configured to perform data enhancement on the first data set according to preset categories to obtain a second data set; the preset categories include extra characters, missing characters, and wrong characters; A preprocessing module, used for preprocessing the second data set to obtain a third data set; A training module is used to train the BERT model according to the third data set to obtain a trained BERT model.
8. An ASR text correction system, characterized in that: Applying the trained BERT model according to claim 1 or 2, the system comprises: A calling text acquisition module, used to acquire a calling text and determine a first perplexity of the calling text; A word segmentation module, used for performing word segmentation processing on the calling text to obtain multiple words; A pinyin conversion module, used for converting the plurality of words into pinyin; A candidate word determination module, for each of the words, when it is determined according to the pre-built keyword pinyin library that the pinyin of the word is not the keyword pinyin, but is within the one-step edit distance range of the keyword pinyin, determines the keyword corresponding to the keyword pinyin as a candidate word; A replacement text output module is used to replace the word according to the candidate word to obtain a replacement text, and determine a second perplexity of the replacement text, and output the replacement text when the second perplexity is less than the first perplexity.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, it implements the model training method as described in any one of claims 1 to 2, or the ASR text correction method as described in any one of claims 3 to 6.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the model training method as described in any one of claims 1 to 2, or the ASR text correction method as described in any one of claims 3 to 6.
Citation Information
Patent Citations
Text correction method and device, intelligent equipment and readable memory medium
CN108804414A
Text variable-length error correction method and device, electronic equipment and storage medium
CN113887200A
Search text processing method and device, equipment, storage medium and program product
CN114328798A
Data enhancement method for Chinese text proofreading
CN115310433A
Cited By
Semantic smooth ASR text optimization method
CN120874844A
