Method and device for detecting inappropriate language in speech recognition text, electronic device and medium

By constructing candidate connected words and determining their similarity to suspected inappropriate words, the problem of misjudgment in speech recognition text detection is solved, and the accuracy of detection is improved.

CN123033499APending Publication Date: 2026-11-03GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611498965.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-24
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing methods for detecting inappropriate language in speech recognition text are prone to misjudgment, affecting the accuracy of the detection results.

Method used

By constructing candidate liaison words, the target similarity between the suspected inappropriate word and the candidate liaison words is determined. If the target similarity is less than a preset threshold, the suspected inappropriate word is determined to be an inappropriate word present in the dialogue speech.

Benefits of technology

It reduces false positives caused by transcription errors and improves the accuracy of detecting inappropriate words.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123033499A_ABST
    Figure CN123033499A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a kind of voice recognition text inappropriate language detection method, device, electronic equipment and medium, belong to voice recognition text processing field, the method includes: from the text to be handled, determine suspected inappropriate language word and the target dialogue sentence corresponding to suspected inappropriate language word;At least two characters associated with suspected inappropriate language word are selected from target dialogue sentence, at least one candidate continuous tone word is constructed;Determine the target similarity between suspected inappropriate language word and candidate continuous tone word;If target similarity is less than preset threshold, then determine that suspected inappropriate language word is inappropriate language word existing in dialogue voice.The embodiments of the present application construct candidate continuous tone word as the verification comparison reference of misjudgment caused by transcription error, reduce the misjudgment caused by transcription error, improve the accuracy of inappropriate language word detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of speech recognition and text processing technology, and in particular to a method, apparatus, electronic device, and readable storage medium for detecting inappropriate language in speech recognition text. Background Technology

[0002] Inappropriate language detection technology involves speech recognition and natural language processing. It is primarily used for automated compliance review of voice messages in scenarios such as customer service calls, online education, meeting minutes, and live-streaming e-commerce. This technology automatically identifies whether voice messages contain inappropriate language such as insults, threats, or discrimination, replacing traditional manual review methods. This significantly reduces labor costs and review time while mitigating risks. With the increasing prevalence of voice interaction scenarios, this technology has become a key technology in areas such as call center quality inspection and content security governance.

[0003] In related technologies, inappropriate language detection based on speech recognition text usually adopts a method of matching with a pre-set inappropriate language database. Specifically, the system pre-stores various types of inappropriate language into the database. After obtaining the text converted from speech recognition, it directly compares it with the inappropriate words in the database. If the matching conditions are met, it is determined that the text contains inappropriate language and other subsequent operations are performed.

[0004] However, the above methods are prone to misjudgment in practical applications, which can affect the accuracy of the test results. Summary of the Invention

[0005] In view of the above problems, embodiments of the present invention are proposed to provide a method, apparatus, electronic device and readable storage medium for detecting inappropriate language in speech recognition text that overcomes or at least partially solves the above problems.

[0006] In a first aspect, embodiments of the present invention provide a method for detecting inappropriate language in speech recognition text, the method comprising: Obtain the text to be processed, which is obtained by speech recognition of the user's dialogue speech; From the text to be processed, identify suspected inappropriate words and the target dialogue statements corresponding to the suspected inappropriate words; Select at least two characters from the target dialogue statement that are associated with the suspected inappropriate word to construct at least one candidate liaison word; Determine the target similarity between the suspected inappropriate words and the candidate connected words; If the target similarity is less than a preset threshold, then the suspected inappropriate word is determined to be an inappropriate word present in the dialogue speech.

[0007] Optionally, the target dialogue statement includes the sentence preceding the statement containing the suspected inappropriate word; The step of selecting at least two characters from the target dialogue statement that are associated with the suspected inappropriate word, and constructing at least one candidate connected word, includes: Obtain the last character of the sentence preceding the statement containing the suspected inappropriate word; By concatenating the last character of the sentence preceding the suspected inappropriate word with the last character of the suspected inappropriate word, the first candidate liaison word is obtained.

[0008] Optionally, the target dialogue statement includes the statement containing the suspected inappropriate word; The step of selecting at least two characters from the target dialogue statement that are associated with the suspected inappropriate word to construct at least one candidate connected word further includes: Obtain the first character following the suspected inappropriate word in the sentence containing the suspected inappropriate word; By concatenating the last character of the sentence preceding the suspected inappropriate word with the first character following the suspected inappropriate word in the same sentence, a second candidate liaison word is obtained.

[0009] Optionally, the step of selecting at least two characters associated with the suspected inappropriate word from the target dialogue statement to construct at least one candidate connected word further includes: Obtain the first character preceding the suspected inappropriate word in the sentence containing the suspected inappropriate word; By concatenating the first character before the suspected inappropriate word in the sentence containing the suspected inappropriate word with the last character of the suspected inappropriate word, a third candidate liaison word is obtained.

[0010] Optionally, the target dialogue statement includes the sentence following the statement containing the suspected inappropriate word; The step of selecting at least two characters from the target dialogue statement that are associated with the suspected inappropriate word to construct at least one candidate connected word further includes: Obtain the first character of the sentence following the statement containing the suspected inappropriate word; By concatenating the first character before the suspected inappropriate word in the sentence containing the suspected inappropriate word with the first character of the sentence following the sentence containing the suspected inappropriate word, a fourth candidate liaison word is obtained.

[0011] Optionally, determining the target similarity between the suspected inappropriate word and the candidate liaison word includes: Determine at least one of the following: pronunciation similarity, stress pattern similarity, and length distribution similarity between the suspected inappropriate word and the candidate connected words; The target similarity between the suspected inappropriate word and the candidate liaison word is determined based on at least one of the pronunciation similarity, stress pattern similarity, and length distribution similarity.

[0012] Optionally, determining at least one of the pronunciation similarity, stress pattern similarity, and length distribution similarity between the suspected inappropriate word and the candidate connected words includes: Determine the pronunciation similarity between the suspected inappropriate words and the candidate connected words; When the pronunciation similarity between the suspected inappropriate word and the candidate connected words is higher than a preset pronunciation similarity threshold, the stress pattern similarity and the length distribution similarity are determined. Determining the target similarity between the suspected inappropriate word and the candidate connected speech word based on at least one of the pronunciation similarity, stress pattern similarity, and length distribution similarity includes: The target similarity between the suspected inappropriate word and the candidate connected words is determined based on the pronunciation similarity, the stress pattern similarity, and the length distribution similarity.

[0013] Optionally, the method further includes: When the pronunciation similarity between the suspected inappropriate word and the candidate connected words is lower than the preset pronunciation similarity threshold, the suspected inappropriate word is directly determined to be an inappropriate word in the dialogue speech.

[0014] Optionally, determining at least one of the pronunciation similarity, stress pattern similarity, and length distribution similarity between the suspected inappropriate word and the candidate connected words includes: Determine the similarity of the pronunciation of each pair of characters between the suspected inappropriate words and the candidate connected words; Determine the average value of the pronunciation similarity of each pair of characters based on their individual pronunciation similarity. Determine the word-level pronunciation similarity between the suspected inappropriate words and the candidate connected words; The pronunciation similarity is obtained by weighting and summing the average value of the single-character pronunciation similarity with the word-level pronunciation similarity.

[0015] Optionally, determining at least one of the pronunciation similarity, stress pattern similarity, and length distribution similarity between the suspected inappropriate word and the candidate connected words includes: Based on a preset stress pattern library, determine the stress pattern sequence of the suspected inappropriate words and the stress pattern sequence of the candidate liaison words; The stress pattern similarity is determined based on the stress pattern sequence of the suspected inappropriate words and the stress pattern sequence of the candidate ligatures.

[0016] Optionally, determining at least one of the pronunciation similarity, stress pattern similarity, and length distribution similarity between the suspected inappropriate word and the candidate connected words includes: Based on the tone of each character in the suspected inappropriate words and the candidate connected words, determine the length label of each character; Based on the phonetic length label of each character, generate the phonetic length pattern sequence of the suspected inappropriate words and the phonetic length pattern sequence of the candidate connected words; The similarity of the length distribution is determined by the proportion of length tags that are the same at the same position in the length pattern sequence of the suspected inappropriate words and the length pattern sequence of the candidate connected words.

[0017] Optionally, determining the target similarity between the suspected inappropriate word and the candidate connected words based on the pronunciation similarity, stress pattern similarity, and length distribution similarity includes: The similarity of pronunciation, similarity of stress pattern, and similarity of length distribution are weighted and summed to obtain the target similarity between the suspected inappropriate word and the candidate connected words; wherein the weight of pronunciation similarity is greater than the weight of stress pattern similarity and the weight of length distribution similarity.

[0018] Secondly, embodiments of the present invention provide a device for detecting inappropriate language in speech recognition text, the device comprising: The text to be processed module is used to acquire the text to be processed, which is obtained by speech recognition of the user's dialogue speech. The suspected word and target statement determination module is used to determine suspected inappropriate words and the target dialogue statements corresponding to the suspected inappropriate words from the text to be processed; The candidate liaison word determination module is used to select at least two characters from the target dialogue statement that are associated with the suspected inappropriate word, and construct at least one candidate liaison word; The target similarity determination module is used to determine the target similarity between the suspected inappropriate words and the candidate connected words; The inappropriate word determination module is used to determine that the suspected inappropriate word is an inappropriate word present in the dialogue speech if the similarity of the target is less than a preset threshold.

[0019] Optionally, the target dialogue statement includes the sentence preceding the statement containing the suspected inappropriate word; The candidate liaison word construction module includes: The first single-character acquisition submodule is used to acquire the last character of the sentence preceding the sentence containing the suspected inappropriate word; The first liaison word construction submodule is used to concatenate the last character of the sentence preceding the sentence containing the suspected inappropriate word with the last character of the suspected inappropriate word to obtain the first candidate liaison word.

[0020] Optionally, the target dialogue statement includes the statement containing the suspected inappropriate word; The candidate liaison word construction module also includes: The second single-character acquisition submodule is used to acquire the first character after the suspected inappropriate word in the sentence containing the suspected inappropriate word; The second liaison word construction submodule is used to concatenate the last character of the sentence preceding the sentence containing the suspected inappropriate word with the first character following the suspected inappropriate word in the sentence containing the suspected inappropriate word, to obtain the second candidate liaison word.

[0021] Optionally, the candidate liaison word construction module further includes: The third single-character acquisition submodule is used to acquire the first character before the suspected inappropriate word in the sentence containing the suspected inappropriate word; The third liaison word construction submodule is used to concatenate the first character before the suspected inappropriate word in the sentence containing the suspected inappropriate word with the last character of the suspected inappropriate word to obtain the third candidate liaison word.

[0022] Optionally, the target dialogue statement includes the sentence following the statement containing the suspected inappropriate word; The candidate liaison word construction module also includes: The fourth single-character acquisition submodule is used to acquire the first character of the sentence following the statement containing the suspected inappropriate word; The fourth liaison word construction submodule is used to concatenate the first character before the suspected inappropriate word in the sentence containing the suspected inappropriate word with the first character of the sentence following the sentence containing the suspected inappropriate word to obtain the fourth candidate liaison word.

[0023] Optionally, the target similarity determination module includes: The first similarity determination submodule is used to determine at least one of the pronunciation similarity, stress pattern similarity, and length distribution similarity between the suspected inappropriate word and the candidate connected words; The second similarity determination submodule is used to determine the target similarity between the suspected inappropriate word and the candidate liaison word based on at least one of the pronunciation similarity, stress pattern similarity and length distribution similarity.

[0024] Optionally, the first similarity determination submodule includes: The third similarity determination unit is used to determine the pronunciation similarity between the suspected inappropriate word and the candidate connected words; The fourth similarity determination unit is used to determine the stress pattern similarity and the length distribution similarity when the pronunciation similarity between the suspected inappropriate word and the candidate connected words is higher than a preset pronunciation similarity threshold. The second similarity determination submodule includes: The fifth similarity determination unit is used to determine the target similarity between the suspected inappropriate word and the candidate connected words based on the pronunciation similarity, the stress pattern similarity, and the length distribution similarity.

[0025] Optionally, the device further includes: The inappropriate word direct determination module is used to directly determine the suspected inappropriate word as an inappropriate word in the dialogue speech when the pronunciation similarity between the suspected inappropriate word and the candidate connected words is lower than the preset pronunciation similarity threshold.

[0026] Optionally, the first similarity determination submodule includes: The pronunciation similarity determination unit is used to determine the pronunciation similarity of each pair of characters between the suspected inappropriate word and the candidate connected words; determine the average pronunciation similarity of each pair of characters based on the pronunciation similarity of each pair of characters; determine the word-level pronunciation similarity between the suspected inappropriate word and the candidate connected words; and perform a weighted summation of the average pronunciation similarity of each character and the word-level pronunciation similarity to obtain the pronunciation similarity.

[0027] Optionally, the first similarity determination submodule includes: The stress pattern similarity determination unit is used to determine the stress pattern sequence of the suspected inappropriate word and the stress pattern sequence of the candidate ligature word according to a preset stress pattern library; and to determine the stress pattern similarity according to the stress pattern sequence of the suspected inappropriate word and the stress pattern sequence of the candidate ligature word.

[0028] Optionally, the first similarity determination submodule includes: The length distribution similarity determination unit is used to determine the length label of each character based on the tone of each character in the suspected inappropriate word and the candidate connected words; generate the length pattern sequence of the suspected inappropriate word and the length pattern sequence of the candidate connected words based on the length label of each character; and determine the proportion of the same length label at the same position in the length pattern sequence of the suspected inappropriate word and the length pattern sequence of the candidate connected words as the length distribution similarity.

[0029] Optionally, the fifth similarity determination unit is specifically used for: The similarity of pronunciation, similarity of stress pattern, and similarity of length distribution are weighted and summed to obtain the target similarity between the suspected inappropriate word and the candidate connected words; wherein the weight of pronunciation similarity is greater than the weight of stress pattern similarity and the weight of length distribution similarity.

[0030] Thirdly, embodiments of the present invention provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the speech recognition text inappropriate language detection method as described in the first aspect.

[0031] Fourthly, embodiments of the present invention provide a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the speech recognition text inappropriate language detection method as described in the first aspect.

[0032] The embodiments of the present invention have the following advantages: This invention first acquires the text to be processed, which is obtained through speech recognition of user dialogue. From the text, suspected inappropriate words and their corresponding target dialogue statements are identified. Then, at least two characters associated with the suspected inappropriate words are selected from the target dialogue statements to construct at least one candidate connected words. Finally, the target similarity between the suspected inappropriate words and the candidate connected words is determined. If the target similarity is less than a preset threshold, it indicates a significant difference between the suspected inappropriate words and the candidate connected words, meaning the candidate connected words are less likely to be incorrectly transcribed as inappropriate words due to transcription errors. Therefore, it is determined that the suspected inappropriate words are indeed inappropriate words present in the dialogue. This method constructs candidate connected words as a verification and comparison reference for misjudgments caused by transcription errors, reducing misjudgments due to transcription errors and thus improving the accuracy of inappropriate word detection. Attached Figure Description

[0033] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0034] Figure 1 This is a flowchart illustrating the steps of a method for detecting inappropriate language in speech recognition text provided in an embodiment of the present invention; Figure 2 This is a structural block diagram of a speech recognition text inappropriate language detection device provided in an embodiment of the present invention. Detailed Implementation

[0035] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0036] The terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0037] Inappropriate language detection technology involves speech recognition and natural language processing. It is primarily used for automated compliance review of voice messages in scenarios such as customer service calls, online education, meeting minutes, and live-streaming e-commerce. This technology automatically identifies whether voice messages contain inappropriate language such as insults, threats, or discrimination, replacing traditional manual review methods. This significantly reduces labor costs and review time while mitigating risks. With the increasing prevalence of voice interaction scenarios, this technology has become a key technology in areas such as call center quality inspection and content security governance.

[0038] In related technologies, inappropriate language detection based on speech recognition typically employs a pre-set inappropriate language lexicon for matching. Specifically, the system pre-stores various types of inappropriate language in the lexicon. After obtaining the text converted from speech recognition, it directly compares it with the inappropriate words in the lexicon. If a match is found, the text is determined to contain inappropriate language, allowing for further processing. However, this method is prone to misjudgments in practical applications, thus affecting the accuracy of the detection results.

[0039] One of the core concepts of this invention is to construct candidate liaison words and determine the target similarity between the suspected inappropriate word and the candidate liaison words. If the target similarity is less than a preset threshold, it indicates that the suspected inappropriate word and the candidate liaison words are significantly different, meaning that the candidate liaison words are less likely to be incorrectly transcribed into inappropriate words due to transcription errors. This allows the invention to determine that the suspected inappropriate word is indeed an inappropriate word that actually exists in the dialogue speech. This invention constructs candidate liaison words as a verification and comparison reference for misjudgments caused by transcription errors, reducing misjudgments caused by transcription errors and improving the accuracy of inappropriate word detection.

[0040] Figure 1 This is a flowchart illustrating the steps of a method for detecting inappropriate language in speech recognition text provided in an embodiment of the present invention.

[0041] like Figure 1 As shown, the method may specifically include the following steps: Step 101: Obtain the text to be processed, which is obtained by speech recognition of the user's dialogue speech; In practical applications, such as customer service voice quality inspection, the conversation between customer service representatives and customers is first transcribed into a text sequence by the ASR engine, i.e., the text to be processed, which does not involve the original audio waveform. Compared to processing methods that rely on the original audio signal, this method, which only uses plain text data for subsequent inappropriate language verification, does not require additional audio acquisition or processing hardware. It can be directly integrated into existing speech recognition processing chains, is compatible with the output results of various ASR engines, and has good versatility and ease of deployment.

[0042] It should be noted that the text to be processed can be the ASR transcription result of a complete customer service call, or it can be a dialogue fragment extracted according to actual quality inspection needs. The text to be processed must contain at least the customer service representative's speech and the speech of other customers adjacent to the customer service representative's speech, so as to provide sufficient contextual information for the subsequent construction of candidate connected words.

[0043] Step 102: From the text to be processed, identify suspected inappropriate words and the target dialogue statements corresponding to the suspected inappropriate words; In practical applications, the text to be processed first undergoes preliminary quality control using a large language model. When the text is flagged as containing suspected inappropriate words, the suspected inappropriate words are removed from the text, and the large model is called back for quality control to determine whether the violation was caused by the presence of the suspected inappropriate words. If the re-quality control no longer violates the rules after removing the suspected inappropriate words, the detection process of this invention is performed for further verification. If the re-quality control still violates the rules after removing the suspected inappropriate words, it is treated as a violation.

[0044] Let the suspected inappropriate term be W_offensive, and the customer service statement containing it be S_service. After removing the inappropriate term W_offensive from the customer service statement S_service, the remaining statement is S_service_except_offensive, and the statement preceding S_service is S_client_last.

[0045] In some embodiments, the target dialogue statement includes the sentence preceding the statement containing the suspected inappropriate word, the statement containing the suspected inappropriate word, and the sentence following the statement containing the suspected inappropriate word.

[0046] Specifically, the target dialogue statement can be understood as a broad context window, whose coverage can include: the adjacent statement before the statement containing the suspected inappropriate word (S_client_last), the statement containing the suspected inappropriate word (S_service), and the adjacent statement after the statement containing the suspected inappropriate word (i.e., the next sentence). Using the preceding, current, and following sentences as the target dialogue statement aims to provide sufficient source material for the construction of subsequent candidate liaison words.

[0047] Once the target dialogue statement is determined using the above method, the scope of subsequent candidate connected words can be limited to the target dialogue statement. This ensures the integrity of the candidate word source, covers the boundary positions where speech overlap may occur, and avoids the unnecessary computational overhead caused by blindly searching the entire text.

[0048] Step 103: Select at least two characters from the target dialogue statement that are associated with the suspected inappropriate word, and construct at least one candidate connected word; The candidate liaison words in this step are selected considering the possibility of ASR errors in the transcription of spoken dialogue due to issues such as prolongation and liaison. At least two characters with the aforementioned factors are selected from the target dialogue statement to construct liaison words that may be confused with the suspected inappropriate words. These words are used to further detect the initially detected suspected inappropriate words and avoid misjudgment.

[0049] In real-world customer service voice quality inspection scenarios, during customer-customer conversations, overlapping voices often occur at the beginning or end of a sentence. For example, a customer's prolonged speech or a customer service representative's rapid response can cause the last word of the customer's sentence to overlap with the first word of the customer's reply. When these overlapping and abnormal combinations of sounds occur during ASR transcription, they may incorrectly transcribe words that don't exist, particularly potentially including inappropriate or offensive language. Therefore, this step considers constructing candidate liaison words to provide a reasonable original word form for suspected inappropriate words—that is, the form that suspected inappropriate words should present without transcription errors—thus providing a clear reference for subsequent similarity comparisons.

[0050] The following section provides a detailed explanation of the specific implementation methods for this step, taking into account several scenarios of overlapping speech.

[0051] In some embodiments, step 103 specifically includes the following sub-steps: Sub-step S11: Obtain the last character of the sentence preceding the sentence containing the suspected inappropriate word; Sub-step S12: The last character of the sentence preceding the sentence containing the suspected inappropriate word is concatenated with the last character of the suspected inappropriate word to obtain the first candidate syllable.

[0052] The first scenario involves inappropriate language appearing at the beginning of a customer service representative's speech. Specifically, in customer service calls, due to the customer's prolonged speech and the representative's rapid response, the last word of the customer's conversation and the first word of the representative's conversation may become connected. During ASR transcription, this connected sound segment may be incorrectly transcribed as a non-existent word, resulting in inappropriate language. In this case, the prolonged pronunciation of the last word at the end of the customer's sentence is usually accurate in ASR transcription, while the last word of the inappropriate language is generally pronounced almost identically to the last word of the actual representative's speech. Therefore, by concatenating the last word of the customer's previous sentence (the word from which the prolonged sound originates) with the last word of the suspected inappropriate word, the original word form that might have corresponded to the speech segment before the ASR transcription error can be restored.

[0053] For example, in an actual conversation, the customer says "What does it all include?", and the customer service representative replies "For example, a compressor...". Due to the consecutive utterance of "what" and "for", ASR may additionally transcribe a suspected inappropriate term that is phonetically similar to "what" and phonetically similar to "for". Therefore, according to the above construction method, the last character of the previous sentence of the sentence where the suspected inappropriate term is located is spliced with the last character of the suspected inappropriate term to obtain a first candidate liaison word. Subsequently, the similarity between the first candidate liaison word and the suspected inappropriate term is compared. If the similarity meets a condition, it can be determined that the suspected inappropriate term is a misjudgment caused by a transcription error. If the similarity does not meet the condition, it can be determined that the suspected inappropriate term is not a misjudgment caused by a transcription error, thus confirming that the suspected inappropriate term is indeed a real inappropriate term existing in the conversation speech.

[0054] In some embodiments, step 103 specifically includes the following sub-steps: Sub-step S21: acquiring the first character after the suspected inappropriate term in the sentence where the suspected inappropriate term is located; Sub-step S22: splicing the last character of the previous sentence of the sentence where the suspected inappropriate term is located with the first character after the suspected inappropriate term in the sentence where the suspected inappropriate term is located to obtain a second candidate liaison word.

[0055] The second case is also that the inappropriate term appears at the start of the customer service representative's utterance, but the second case takes into account that the ASR has uncertainty in the boundary division of the liaison segment, that is, the ASR engine may assign part of the acoustic signal in the liaison segment to different characters during transcription. The first character of the customer service representative in the liaison segment (i.e., the first character of the real pronunciation of the customer service representative) may be transcribed as the last character of the inappropriate term, or may be transcribed as the character after the inappropriate term. Therefore, the last character of the customer's previous sentence, that is, the character that is the source of the dragged sound, is spliced with the first Chinese character after the suspected inappropriate term, so as to construct another possible original word form.

[0056] For example, if the first character after the suspected inappropriate term is "for" (from the customer service representative's original words "for example"), the last character "what" of the previous sentence is spliced with the first character "for" after the suspected inappropriate term to obtain the second candidate liaison word. This candidate word is also one of the possible original word forms corresponding to the speech segment before the ASR transcription error.

[0057] Through the construction of the above first candidate liaison word and second candidate liaison word, two main real situations when the inappropriate term appears at the start of the customer service representative's utterance can be covered. It should be noted that in some embodiments, if the suspected inappropriate term is at the end of a sentence or there is no subsequent real character, only the first candidate liaison word is constructed.

[0058] In some embodiments, step 103 specifically includes the following sub-steps: Sub-step S31: Obtain the first character before the suspected inappropriate word in the sentence containing the suspected inappropriate word; Sub-step S32: Concatenate the first character before the suspected inappropriate word in the sentence containing the suspected inappropriate word with the last character of the suspected inappropriate word to obtain the third candidate syllable.

[0059] The third scenario involves inappropriate language appearing at the end of a customer service representative's statement. When the customer service representative pronounces the last word slowly and the customer answers quickly, inappropriate language may also appear at the end of their statement. In this case, the overlap of sounds occurs between the end of the customer service representative's statement and the beginning of the next customer's statement; therefore, the method for constructing candidate connected words needs to be adjusted symmetrically compared to the previous scenarios.

[0060] Specifically, when an inappropriate term appears at the end of a customer service statement, the trailing syllable at the end of the statement connects with the first character of the next customer statement, resulting in the inappropriate term appearing at the end of the ASR transcription. In this case, the last character before the inappropriate term in the customer service statement corresponds to the character from which the trailing syllable originated. By concatenating this character with the last character of the inappropriate term, the original word form that might have corresponded to the speech segment before the ASR transcription error can be restored.

[0061] In some embodiments, step 103 specifically includes the following sub-steps: Sub-step S41: Obtain the first character of the sentence following the statement containing the suspected inappropriate word; Sub-step S42: The first character before the suspected inappropriate word in the sentence containing the suspected inappropriate word is concatenated with the first character of the sentence following the sentence containing the suspected inappropriate word to obtain the fourth candidate liaison word.

[0062] The fourth scenario also involves inappropriate language appearing at the end of a customer service representative's speech. However, similar to the second scenario, when inappropriate language appears at the end of a customer service representative's speech, in addition to combining the last character before the inappropriate language with the last character of the inappropriate language, there is another possible original word form: combining the last character before the inappropriate language with the first character of the next customer service representative's speech.

[0063] By constructing the third and fourth candidate liaison words, we can cover the two main sources of inappropriate language appearing at the end of a customer service statement. Those skilled in the art should understand that the construction methods of the four candidate liaison words correspond to different locations where speech overlap may occur and different forms of transcription errors. In practical applications, the appropriate construction method can be selected based on the specific location of the suspected inappropriate word in the target dialogue statement to comprehensively cover all possible causes of ASR transcription errors.

[0064] Step 104: Determine the target similarity between the suspected inappropriate words and the candidate connected words; The text to be processed is a text sequence transcribed from ASR, which does not involve the original audio waveform. However, after Chinese characters are separated from the speech signal, pseudo-inappropriate terms resulting from transcription errors often have no actual semantic connection to the normal words that constitute them. Therefore, their semantic connotations cannot be applied in this scenario. Thus, this invention considers quantifying the similarity between suspected inappropriate terms and candidate connected words using the character features inherent in the Chinese Pinyin system, such as initials, finals, tones (pronunciation), stress patterns (emphasis), and the high correlation between tone and duration (pronunciation length).

[0065] Pronunciation, stress, and duration are the three key features corresponding to the three critical stages of ASR misjudgment. Pronunciation similarity is the physical prerequisite for misjudgment, stress distribution distinguishes between emotional stress and weakened connected speech, and duration pattern provides direct evidence for prolongation distortion. Therefore, this invention selects pronunciation, stress, and duration as three features to achieve similarity comparison in plain text.

[0066] In some embodiments, step 104 specifically includes the following sub-steps: Sub-step S51: Determine at least one of the following: pronunciation similarity, stress pattern similarity, and length distribution similarity between the suspected inappropriate word and the candidate connected words; In some embodiments, determining the phonetic similarity between the suspected inappropriate word and the candidate connected words includes: Determine the similarity of the pronunciation of each pair of characters between the suspected inappropriate words and the candidate connected words; Determine the average value of the pronunciation similarity of each pair of characters based on their individual pronunciation similarity. Determine the word-level pronunciation similarity between the suspected inappropriate words and the candidate connected words; The pronunciation similarity is obtained by weighting and summing the average value of the single-character pronunciation similarity with the word-level pronunciation similarity.

[0067] As an example, each character of the suspected inappropriate term W_offensive and the candidate liaison word Cand_i (i=1, 2) is converted into a Pinyin string sequence. For example, "好" is converted to "hao3", where the number 3 indicates that the character is pronounced in the third tone. If it is a neutral tone, the number is marked as 5, and there are 5 values for the tone part, which are numbers 1 to 5 respectively.

[0068] Then, the Pinyin of each character is split into three parts: initial consonant, final vowel, and tone. The Levenshtein distances of the initial consonants, final vowels, and tones of the two Pinyin strings are calculated respectively. After the calculation is completed, different weights are set for the edit distance of the initial consonant, the edit distance of the final vowel, and the edit distance of the tone to construct a weighted edit distance. The calculation formula 1 is as follows:

[0069] where, represents the converted Pinyin string sequence of a single character in the suspected inappropriate term W_offensive, represents the converted Pinyin string sequence of a single character in the candidate liaison word, represents the edit distance of the initial consonant, represents the edit distance of the final vowel, represents the edit distance of the tone, W init represents the weight of the edit distance of the initial consonant, W final represents the weight of the edit distance of the final vowel, W tone represents the weight of the edit distance of the tone.

[0070] Then, based on the weighted edit distances of the initial consonant, final vowel, and tone, the single-character pronunciation similarity is calculated, and the calculation formula 2 is as follows:

[0071] where, represents the edit distance of the pronunciation of the two characters, represents the length of the Pinyin string of character a, represents the length of the Pinyin string of character b. After obtaining the single-character pronunciation similarity of each corresponding character in the above manner, the average value of all single-character pronunciation similarities is taken as the single-character pronunciation similarity score .

[0072] Then the word-level liaison pronunciation similarity is calculated. Specifically, the Pinyin (without tone) of each character in the word is concatenated to obtain a word-level Pinyin string, the edit distance between the two word-level Pinyin strings is calculated, and then the normalized word-level pronunciation similarity is calculated. The calculation formula 3 is as follows:

[0073] Herein, Levenshtein(worda, wordb) represents the edit distance of two words (containing only initials and finals, no tones), represents the length of the pinyin character string sequence of word a, represents the length of the pinyin character string sequence of word b.

[0074] Perform weighted summation on the average value of the single-character pronunciation similarity and the word-level pronunciation similarity to obtain the pronunciation similarity between the suspected inappropriate expression word and the candidate liaison word, and the calculation formula 4 is as follows:

[0075] Herein, represents the word-level pronunciation similarity, represents the pronunciation similarity of each character, and α represents the weight of the word-level pronunciation similarity. The weighted calculation of the two similarities can avoid the limitation of single similarity calculation.

[0076] In some embodiments, determining the stress pattern similarity between the suspected inappropriate expression word and the candidate liaison word includes: determining the stress pattern sequence of the suspected inappropriate expression word and the stress pattern sequence of the candidate liaison word according to a preset stress pattern library; determining the stress pattern similarity according to the stress pattern sequence of the suspected inappropriate expression word and the stress pattern sequence of the candidate liaison word.

[0077] In the scenario where inappropriate expressions are actually uttered, especially in scenarios with intense emotion or accusation, an obvious substantial word stress phenomenon often occurs, while for ASR concatenation errors caused by drawn-out sounds or liaison, their stress distribution follows the liaison weakening rule in natural speech flow (for example, modal particles and auxiliary words are pronounced softly). It can be understood that these two scenarios may be highly similar in pronunciation, but have completely different text stress distributions. Therefore, verification is performed using phonetic stress, that is, the stress dimension judgment is added in the present invention, which effectively distinguishes real malicious content from transcription misjudgments caused by acoustic coincidence.

[0078] The preset stress pattern library presets stress patterns for common words based on the part of speech, structure and common pronunciation of the words. For example, the word "dongxi" follows a stress-soft pattern, the word "weida" follows a soft-stress pattern, and the word "dianhua" follows a stress-medium pattern, etc. For uncommon words or words not included in the library, their stress patterns can be automatically derived according to linguistic rules.

[0079] As an example, the stress pattern construction rules are shown in Table 1 below: Table 1 Stress Pattern Construction Rule Table

[0080] After determining the stress pattern sequence of suspected inappropriate words and the stress pattern sequence of candidate ligatures using the above method, the stress pattern similarity is determined based on the stress pattern sequence of the suspected inappropriate words and the stress pattern sequence of the candidate ligatures.

[0081] As an example, suppose For stress pattern sequences of suspected inappropriate words (e.g., "heavy-light"), This represents the stress pattern sequence of candidate liaison words. To quantify the similarity between different stress patterns, a stress pattern similarity scoring table is pre-constructed. This table allows for partial matching between stress patterns and defines the similarity scores for different pattern pairs. The stress pattern similarity scoring table is shown in Table 2 below: Table 2. Accent Pattern Similarity Scoring Table

[0082] The similarity of stress patterns between two words is calculated using the following formula:

[0083] in, An accent pattern indicating potentially inappropriate language. This represents the stress pattern of the i-th (i=1,2) candidate liaison word. The length of the string indicating suspected inappropriate language. This represents the string length of the i-th candidate liaison word. When there are multiple candidate liaison words, the stress pattern similarity with each candidate liaison word is calculated independently, and the average value is taken as the final stress similarity. .

[0084] In some embodiments, determining the similarity in length distribution between the suspected inappropriate word and the candidate liaison word includes: Based on the tone of each character in the suspected inappropriate words and the candidate connected words, determine the length label of each character; Based on the phonetic length label of each character, generate the phonetic length pattern sequence of the suspected inappropriate words and the phonetic length pattern sequence of the candidate connected words; The similarity of the length distribution is determined by the proportion of length tags that are the same at the same position in the length pattern sequence of the suspected inappropriate words and the length pattern sequence of the candidate connected words.

[0085] In real customer service conversations, one typical scenario where ASR (Automatic Speech Recognition) misinterprets inappropriate language occurs when the customer's last word in the previous sentence is abnormally drawn out due to hesitation or prolonged tone. This drawn-out word is then linked to the first word of the customer service representative's next sentence, and is incorrectly merged into an inappropriate word by ASR. Since this drawn-out sound inevitably leads to a physical increase in pronunciation duration, exceeding the average length in normal speech, this invention utilizes the high correlation between Chinese tone and duration (such as the inherent differences in duration between the third tone and the neutral tone) to quantify the physical changes in pronunciation duration into a calculable duration pattern. This provides direct evidence for misjudging drawn-out sounds. When the duration pattern matches, i.e., when the duration pattern conforms to the drawn-out sound hypothesis, it is determined to be a misjudgment.

[0086] In Mandarin Chinese, the first tone (high level tone) and the second tone (rising tone) are generally longer, the third tone (falling-rising tone) is also longer due to its transitional sound, the fourth tone (falling tone) is short, and the neutral tone is very short. Based on this, a standard tone length feature value L∈[0,1] is defined for each character; for example, 0.8 for the first, second, and third tones, 0.3 for the fourth tone, and 0.1 for the neutral tone. Characters with tone length feature values ​​greater than a preset threshold are labeled as "long tone," and characters with tone length feature values ​​less than or equal to the preset threshold are labeled as "short tone."

[0087] For a word W containing n characters, its length pattern D(W) can be represented as a sequence of length n. For example, if the word's pinyin string is māde, the first tone is greater than 0.5 and the neutral tone is less than 0.5, then its length pattern is "long-short".

[0088] Sim, the length similarity between inappropriate words and candidate words dur Defined as the proportion of two sequences with the same duration label at the same position, calculated using formula 6 as follows:

[0089] Among them, D(W) vio D(W) represents the length distribution of suspected inappropriate words. cand_j The length distribution of candidate words is represented by . When multiple candidate words exist, the length similarity with each candidate word is calculated, and the average value is taken to obtain the final length similarity score Sim. dur .

[0090] Sub-step S52: Determine the target similarity between the suspected inappropriate word and the candidate connected words based on at least one of the pronunciation similarity, stress pattern similarity, and length distribution similarity.

[0091] In some embodiments, sub-step S51 includes: determining the pronunciation similarity between the suspected inappropriate word and the candidate connected words; when the pronunciation similarity between the suspected inappropriate word and the candidate connected words is higher than a preset pronunciation similarity threshold, determining the stress pattern similarity and the length distribution similarity; In the foregoing embodiments, detailed examples have been given on how to determine pronunciation similarity, stress pattern similarity, and duration distribution similarity.

[0092] It should be noted that, in some embodiments, pronunciation similarity can be a necessary but not sufficient condition for determining whether a misjudgment is valid. The transcription error in the ASR model essentially maps auditoryally similar acoustic signals to incorrect Chinese characters. If the suspected inappropriate word and the candidate connected words are not similar in terms of initial consonant, final vowel, and tone, then the physical basis for the so-called transcription error caused by prolonged pronunciation or linking does not exist. Therefore, pronunciation similarity judgment is the physical prerequisite for the entire discrimination process and the lowest-level verification threshold. Based on this, this invention uses pronunciation similarity as a branch condition for process control, determining whether to continue executing subsequent verifications of stress and duration based on the pronunciation similarity judgment result.

[0093] In some embodiments, sub-step S52 includes: determining the target similarity between the suspected inappropriate word and the candidate liaison word based on the pronunciation similarity, the stress pattern similarity, and the length distribution similarity.

[0094] After determining the pronunciation similarity, it is compared with a preset pronunciation similarity threshold. When the pronunciation similarity is higher than the preset threshold, it indicates that the suspected inappropriate word and the candidate connected speech word are sufficiently similar in terms of initial consonant, final vowel, and tone. That is, the suspected inappropriate word may be caused by an ASR transcription error at the acoustic-physical level. In this case, further verification is performed at the stress pattern and duration distribution dimensions to ensure the accuracy of the test.

[0095] When the pronunciation similarity is higher than the preset pronunciation similarity threshold, the pronunciation similarity, stress pattern similarity, and length distribution similarity are weighted and summed to obtain the target similarity between the suspected inappropriate word and the candidate connected words; wherein, the weight of the pronunciation similarity is greater than the weight of the stress pattern similarity and the weight of the length distribution similarity.

[0096] Specifically, the formula for calculating the weighted sum is as follows:

[0097] in, Indicates target similarity. The weighting coefficients representing pronunciation similarity Weighting coefficients representing the similarity of accent patterns. Weighting coefficients representing the similarity of pitch length distributions.

[0098] It is understandable that pronunciation similarity is the criterion for determining whether a suspected inappropriate word is due to transcription error, therefore... Setting these values ​​to larger ones allows for further verification of accent pattern similarity and duration distribution similarity based on pronunciation similarity. and Set to a relatively small value. That is, the weight of the pronunciation similarity is greater than the weight of the stress pattern similarity, and the weight of the pronunciation similarity is greater than the weight of the note length distribution similarity. For example, β can be set... pron =0.6, β stress =0.2, β dur =0.2, but this value is only an example and those skilled in the art can make adaptive adjustments to the above weight value according to actual application scenarios and needs.

[0099] By using the weighted summation method described above, the similarity of the three dimensions of pronunciation, stress, and duration is integrated into a target similarity, providing a comprehensive and accurate quantitative basis for subsequent steps to compare with a preset threshold and ultimately determine whether a suspected inappropriate word is a real inappropriate word.

[0100] In some embodiments, the method further includes: When the pronunciation similarity between the suspected inappropriate word and the candidate connected words is lower than the preset pronunciation similarity threshold, the suspected inappropriate word is directly determined to be an inappropriate word in the dialogue speech.

[0101] When the pronunciation similarity is lower than the preset pronunciation similarity threshold, it indicates that the suspected inappropriate word and the candidate connected speech word have significant differences in initial consonant, final vowel, and tone, and are not similar in pronunciation. In this case, the possibility that the suspected inappropriate word originates from the candidate connected speech word due to transcription error has been ruled out, that is, the suspected inappropriate word is not caused by ASR errors due to spoken language phenomena such as prolongation or liaison. In other words, there is no acoustic physical basis for the correlation between the two in terms of transcription error, so there is no need to continue to determine the similarity of stress pattern and length distribution, and the suspected inappropriate word is directly determined to be an inappropriate word that actually appears in the dialogue speech. This process control method effectively avoids the unnecessary processing overhead caused by continuing to perform subsequent calculations when there is already a mismatch at the pronunciation level, and improves the overall processing efficiency.

[0102] Step 105: If the target similarity is less than a preset threshold, then the suspected inappropriate word is determined to be an inappropriate word present in the dialogue speech.

[0103] The preset threshold is a pre-defined value used to determine whether the similarity between a suspected inappropriate word and a candidate liaison word is sufficient to indicate that the suspected inappropriate word may have originated from a misjudgment caused by an ASR transcription error in the candidate liaison word. This preset threshold can be set according to the actual application scenario and the required level of judgment. For example, it can be set to 0.6. However, it should be understood that this value is only an illustrative example and can be adjusted according to specific needs.

[0104] When the target similarity is less than a preset threshold, it indicates that the suspected inappropriate word and the candidate connected speech word have low overall similarity in the three dimensions of pronunciation, stress, and duration, and there is insufficient similarity between them. That is, the possibility of a transcription error between the suspected inappropriate word and the candidate connected speech word is low, and the suspected inappropriate word is not caused by ASR transcription errors due to prolonged sounds, connected speech, or colloquial speech phenomena. Therefore, the possibility that the suspected inappropriate word is a genuinely spoken inappropriate word is high. In this case, the suspected inappropriate word is determined to be a genuine inappropriate word that appeared in the dialogue.

[0105] This invention first acquires the text to be processed, which is obtained through speech recognition of user dialogue. From the text, suspected inappropriate words and their corresponding target dialogue statements are identified. Then, at least two characters associated with the suspected inappropriate words are selected from the target dialogue statements to construct at least one candidate connected words. Finally, the target similarity between the suspected inappropriate words and the candidate connected words is determined. If the target similarity is less than a preset threshold, it indicates a significant difference between the suspected inappropriate words and the candidate connected words, meaning the candidate connected words are less likely to be incorrectly transcribed as inappropriate words due to transcription errors. Therefore, it is determined that the suspected inappropriate words are indeed inappropriate words present in the dialogue. This method constructs candidate connected words as a verification and comparison reference for misjudgments caused by transcription errors, reducing misjudgments due to transcription errors and thus improving the accuracy of inappropriate word detection.

[0106] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0107] To enable those skilled in the art to better understand the embodiments of the present invention, an example is provided to illustrate the embodiments of the present invention.

[0108] For example, a correct dialogue segment between a customer and a customer service representative is as follows: Customer: "What does the ten-year warranty for the air conditioner cover?" Customer service representative: "For example, all accessories such as the compressor, fan, and control board are included." Due to the drawn-out pronunciation of "sha" (what) and the colloquial expression of "bi" (for), the text to be processed transcribed by ASR may additionally transcribe a consecutive word similar to the sounds of "sha" and "bi", forming an inappropriate word a.

[0109] The text segment to be processed after ASR transcription is: Customer: "What does the ten-year warranty for the Gree air conditioner cover?" Customer service representative: "Inappropriate word a, for example, all accessories such as the compressor, fan, and control board are included." This causes the large language model for initial quality inspection to determine that the customer service representative has violated regulations during the service process.

[0110] However, as described above, the inappropriate word a is not necessarily actually spoken by the customer service representative, but may be a similar word generated by transcription. Therefore, after removing the inappropriate word a from the text to be processed, the large model is called again for quality inspection. If it is determined that the customer service representative's speech does not violate regulations after removing the inappropriate word a, it indicates that the violation is caused by the inappropriate word a, so the detection process of the present invention is performed for further verification.

[0111] First, in this scenario, the first candidate consecutive sound word and the second candidate consecutive sound word as described above can be constructed, and then the pronunciation, stress, and duration similarity between the first candidate consecutive sound word, the second candidate consecutive sound word and the suspected inappropriate word a are determined.

[0112] 1. Pronunciation similarity determination (1) Single character pronunciation similarity calculation Compare "sha" (foolish) with "sha" (what): the pinyin string of "sha" (foolish) is sha3, and the pinyin string of "sha" (what) is sha2; The edit distance between sha3 and sha2 is 1 (replace 3 with 2), the maximum length is 4, Simchar_1=1 1 / 4≈0.75 Compare "bi" (vulgar term) with "bi" (for): the pinyin string of "bi" (vulgar term) is bi1, and the pinyin string of "bi" (for) is bi3; The edit distance between bi1 and bi3 is 1 (replace 1 with 3), the maximum length is 3, Simchar_2=1 1 / 3=0.67 Then according to the aforementioned calculation formula 2, the average single character similarity Sim char =(0.75+0.67) / 2≈0.71 (2) Word-level pronunciation similarity calculation The string for removing the tone mark from the inappropriate word 'a' is shabi; the string for removing the tone mark from the candidate connected words is also shabi. Edit distance between the two is 0, maximum length is 5, and according to the above calculation formula 3, word-level pronunciation similarity Sim phrase =1 0 / 5 = 1.0 (3) Calculation of pronunciation similarity According to the aforementioned calculation formula 4, taking α=0.6, then Sim pron =0.6×1.0+0.4×0.71≈0.6+0.28≈0.88 2. Accent Pattern Similarity Calculation Based on the preset stress pattern library, the inappropriate word 'a' is determined to belong to the stress-medium pattern, and the candidate liaison word also belongs to the stress-medium pattern. The two patterns are consistent, and Simstress=1.0.

[0113] 3. Calculation of Pitch Length Similarity The length pattern sequence of the inappropriate word 'a' is [L, L] (long vowel, long vowel), and the length pattern sequence of the candidate ligature is also [L, L]. A positional comparison of the length patterns of the two words shows complete agreement. dur =1.0.

[0114] 4. Target similarity calculation According to the aforementioned calculation formula 7, taking βpron=0.6, βstress=0.2, βdur=0.2, and θ=0.6, then... =0.6×0.88+0.2×1.0+0.2×1.0=0.928 The target similarity of 0.928 is greater than the preset threshold of 0.6. Therefore, it is determined that the suspected inappropriate word 'a' is a misjudgment caused by phenomena such as liaison, prolongation, and colloquialism, rather than an inappropriate word that actually exists in the dialogue.

[0115] It should be noted that the speech recognition text inappropriate language detection method provided in this embodiment of the invention can be executed by a speech recognition text inappropriate language detection device, or a control module within that speech recognition text inappropriate language detection device for executing the speech recognition text inappropriate language detection method. This embodiment of the invention uses the execution of the speech recognition text inappropriate language detection method by a speech recognition text inappropriate language detection device as an example to illustrate the speech recognition text inappropriate language detection method provided in this embodiment of the invention.

[0116] Figure 2 This is a structural block diagram of a speech recognition text inappropriate language detection device provided in an embodiment of the present invention.

[0117] like Figure 2 As shown in the figure, the speech recognition text inappropriate language detection device provided by the embodiment of the present invention may specifically include the following modules: The text acquisition module 201 is used to acquire the text to be processed, which is obtained by speech recognition of user dialogue speech. The suspected word and target statement determination module 202 is used to determine suspected inappropriate words and the target dialogue statements corresponding to the suspected inappropriate words from the text to be processed; The candidate liaison word determination module 203 is used to select at least two characters from the target dialogue statement that are associated with the suspected inappropriate word, and construct at least one candidate liaison word; The target similarity determination module 204 is used to determine the target similarity between the suspected inappropriate word and the candidate connected words; The inappropriate word determination module 205 is used to determine that the suspected inappropriate word is an inappropriate word present in the dialogue speech if the target similarity is less than a preset threshold.

[0118] In some embodiments, the target dialogue statement includes the sentence preceding the statement containing the suspected inappropriate word; The candidate liaison word construction module includes: The first single-character acquisition submodule is used to acquire the last character of the sentence preceding the sentence containing the suspected inappropriate word; The first liaison word construction submodule is used to concatenate the last character of the sentence preceding the sentence containing the suspected inappropriate word with the last character of the suspected inappropriate word to obtain the first candidate liaison word.

[0119] In some embodiments, the target dialogue statement includes the statement containing the suspected inappropriate word; The candidate liaison word construction module also includes: The second single-character acquisition submodule is used to acquire the first character after the suspected inappropriate word in the sentence containing the suspected inappropriate word; The second liaison word construction submodule is used to concatenate the last character of the sentence preceding the sentence containing the suspected inappropriate word with the first character following the suspected inappropriate word in the sentence containing the suspected inappropriate word, to obtain the second candidate liaison word.

[0120] In some embodiments, the candidate liaison word construction module further includes: The third single-character acquisition submodule is used to acquire the first character before the suspected inappropriate word in the sentence containing the suspected inappropriate word; The third liaison word construction submodule is used to concatenate the first character before the suspected inappropriate word in the sentence containing the suspected inappropriate word with the last character of the suspected inappropriate word to obtain the third candidate liaison word.

[0121] In some embodiments, the target dialogue statement includes the sentence following the statement containing the suspected inappropriate word; The candidate liaison word construction module also includes: The fourth single-character acquisition submodule is used to acquire the first character of the sentence following the statement containing the suspected inappropriate word; The fourth liaison word construction submodule is used to concatenate the first character before the suspected inappropriate word in the sentence containing the suspected inappropriate word with the first character of the sentence following the sentence containing the suspected inappropriate word to obtain the fourth candidate liaison word.

[0122] In some embodiments, the target similarity determination module includes: The first similarity determination submodule is used to determine at least one of the pronunciation similarity, stress pattern similarity, and length distribution similarity between the suspected inappropriate word and the candidate connected words; The second similarity determination submodule is used to determine the target similarity between the suspected inappropriate word and the candidate liaison word based on at least one of the pronunciation similarity, stress pattern similarity and length distribution similarity.

[0123] In some embodiments, the first similarity determination submodule includes: The third similarity determination unit is used to determine the pronunciation similarity between the suspected inappropriate word and the candidate connected words; The fourth similarity determination unit is used to determine the stress pattern similarity and the length distribution similarity when the pronunciation similarity between the suspected inappropriate word and the candidate connected words is higher than a preset pronunciation similarity threshold. The second similarity determination submodule includes: The fifth similarity determination unit is used to determine the target similarity between the suspected inappropriate word and the candidate connected words based on the pronunciation similarity, the stress pattern similarity, and the length distribution similarity.

[0124] In some embodiments, the apparatus further includes: The inappropriate word direct determination module is used to directly determine the suspected inappropriate word as an inappropriate word in the dialogue speech when the pronunciation similarity between the suspected inappropriate word and the candidate connected words is lower than the preset pronunciation similarity threshold.

[0125] In some embodiments, the first similarity determination submodule includes: The pronunciation similarity determination unit is used to determine the pronunciation similarity of each pair of characters between the suspected inappropriate word and the candidate connected words; determine the average pronunciation similarity of each pair of characters based on the pronunciation similarity of each pair of characters; determine the word-level pronunciation similarity between the suspected inappropriate word and the candidate connected words; and perform a weighted summation of the average pronunciation similarity of each character and the word-level pronunciation similarity to obtain the pronunciation similarity.

[0126] In some embodiments, the first similarity determination submodule includes: The stress pattern similarity determination unit is used to determine the stress pattern sequence of the suspected inappropriate word and the stress pattern sequence of the candidate ligature word according to a preset stress pattern library; and to determine the stress pattern similarity according to the stress pattern sequence of the suspected inappropriate word and the stress pattern sequence of the candidate ligature word.

[0127] In some embodiments, the first similarity determination submodule includes: The length distribution similarity determination unit is used to determine the length label of each character based on the tone of each character in the suspected inappropriate word and the candidate connected words; generate the length pattern sequence of the suspected inappropriate word and the length pattern sequence of the candidate connected words based on the length label of each character; and determine the proportion of the same length label at the same position in the length pattern sequence of the suspected inappropriate word and the length pattern sequence of the candidate connected words as the length distribution similarity.

[0128] In some embodiments, the fifth similarity determination unit is specifically used for: The similarity of pronunciation, similarity of stress pattern, and similarity of length distribution are weighted and summed to obtain the target similarity between the suspected inappropriate word and the candidate connected words; wherein the weight of pronunciation similarity is greater than the weight of stress pattern similarity and the weight of length distribution similarity.

[0129] As the apparatus embodiment is basically similar to the method embodiment, it is described in a relatively simple manner. For relevant details, please refer to the description of the method embodiment.

[0130] This invention also provides an electronic device, including a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the various processes of the above-described speech recognition text inappropriate language detection method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0131] It should be noted that the electronic devices in the embodiments of the present invention include the mobile electronic devices and non-mobile electronic devices described above.

[0132] This invention also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described speech recognition text inappropriate language detection method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0133] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0134] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0135] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0136] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0137] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0138] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0139] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0140] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0141] The present invention has provided a detailed description of a method, apparatus, electronic device, and computer-readable storage medium for detecting inappropriate language in speech recognition text. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for detecting inappropriate language in speech recognition text, characterized in that, The method includes: Obtain the text to be processed, which is obtained by speech recognition of the user's dialogue speech; From the text to be processed, identify suspected inappropriate words and the target dialogue statements corresponding to the suspected inappropriate words; Select at least two characters from the target dialogue statement that are associated with the suspected inappropriate word to construct at least one candidate liaison word; Determine the target similarity between the suspected inappropriate words and the candidate connected words; If the target similarity is less than a preset threshold, then the suspected inappropriate word is determined to be an inappropriate word present in the dialogue speech.

2. The method for detecting inappropriate language in speech recognition text according to claim 1, characterized in that, The target dialogue statement includes the sentence preceding the statement containing the suspected inappropriate word; The step of selecting at least two characters from the target dialogue statement that are associated with the suspected inappropriate word, and constructing at least one candidate connected word, includes: Obtain the last character of the sentence preceding the statement containing the suspected inappropriate word; By concatenating the last character of the sentence preceding the suspected inappropriate word with the last character of the suspected inappropriate word, the first candidate liaison word is obtained.

3. The method for detecting inappropriate language in speech recognition text according to claim 2, characterized in that, The target dialogue statement includes the statement containing the suspected inappropriate word; The step of selecting at least two characters from the target dialogue statement that are associated with the suspected inappropriate word to construct at least one candidate connected word further includes: Obtain the first character following the suspected inappropriate word in the sentence containing the suspected inappropriate word; By concatenating the last character of the sentence preceding the suspected inappropriate word with the first character following the suspected inappropriate word in the same sentence, a second candidate liaison word is obtained.

4. The method for detecting inappropriate language in speech recognition text according to claim 3, characterized in that, The step of selecting at least two characters from the target dialogue statement that are associated with the suspected inappropriate word to construct at least one candidate connected word further includes: Obtain the first character preceding the suspected inappropriate word in the sentence containing the suspected inappropriate word; By concatenating the first character before the suspected inappropriate word in the sentence containing the suspected inappropriate word with the last character of the suspected inappropriate word, a third candidate liaison word is obtained.

5. The method for detecting inappropriate language in speech recognition text according to claim 4, characterized in that, The target dialogue statement includes the sentence following the statement containing the suspected inappropriate word; The step of selecting at least two characters from the target dialogue statement that are associated with the suspected inappropriate word to construct at least one candidate connected word further includes: Obtain the first character of the sentence following the statement containing the suspected inappropriate word; By concatenating the first character before the suspected inappropriate word in the sentence containing the suspected inappropriate word with the first character of the sentence following the sentence containing the suspected inappropriate word, a fourth candidate liaison word is obtained.

6. The method for detecting inappropriate language in speech recognition text according to claim 1, characterized in that, Determining the target similarity between the suspected inappropriate word and the candidate connected words includes: Determine at least one of the following: pronunciation similarity, stress pattern similarity, and length distribution similarity between the suspected inappropriate word and the candidate connected words; The target similarity between the suspected inappropriate word and the candidate liaison word is determined based on at least one of the pronunciation similarity, stress pattern similarity, and length distribution similarity.

7. The method for detecting inappropriate language in speech recognition text according to claim 6, characterized in that, Determining at least one of the following—pronunciation similarity, stress pattern similarity, and length distribution similarity—between the suspected inappropriate word and the candidate connected words includes: Determine the pronunciation similarity between the suspected inappropriate words and the candidate connected words; When the pronunciation similarity between the suspected inappropriate word and the candidate connected words is higher than a preset pronunciation similarity threshold, the stress pattern similarity and the length distribution similarity are determined. Determining the target similarity between the suspected inappropriate word and the candidate connected speech word based on at least one of the pronunciation similarity, stress pattern similarity, and length distribution similarity includes: The target similarity between the suspected inappropriate word and the candidate connected words is determined based on the pronunciation similarity, the stress pattern similarity, and the length distribution similarity.

8. The method for detecting inappropriate language in speech recognition text according to claim 7, characterized in that, The method further includes: When the pronunciation similarity between the suspected inappropriate word and the candidate connected words is lower than the preset pronunciation similarity threshold, the suspected inappropriate word is directly determined to be an inappropriate word in the dialogue speech.

9. The method for detecting inappropriate language in speech recognition text according to claim 6, characterized in that, Determining at least one of the following—pronunciation similarity, stress pattern similarity, and length distribution similarity—between the suspected inappropriate word and the candidate connected words includes: Determine the similarity of the pronunciation of each pair of characters between the suspected inappropriate words and the candidate connected words; Based on the pronunciation similarity of each pair of characters, determine the average pronunciation similarity of the characters; Determine the word-level pronunciation similarity between the suspected inappropriate words and the candidate connected words; The pronunciation similarity is obtained by weighted summing the average value of the single-character pronunciation similarity and the word-level pronunciation similarity.

10. The method for detecting inappropriate language in speech recognition text according to claim 6, characterized in that, Determining at least one of the following—pronunciation similarity, stress pattern similarity, and length distribution similarity—between the suspected inappropriate word and the candidate connected words includes: Based on a preset stress pattern library, determine the stress pattern sequence of the suspected inappropriate words and the stress pattern sequence of the candidate liaison words; The stress pattern similarity is determined based on the stress pattern sequence of the suspected inappropriate words and the stress pattern sequence of the candidate ligatures.

11. The method for detecting inappropriate language in speech recognition text according to claim 6, characterized in that, Determining at least one of the following—pronunciation similarity, stress pattern similarity, and length distribution similarity—between the suspected inappropriate word and the candidate connected words includes: Based on the tone of each character in the suspected inappropriate words and the candidate connected words, determine the length label of each character; Based on the phonetic length label of each character, generate the phonetic length pattern sequence of the suspected inappropriate words and the phonetic length pattern sequence of the candidate connected words; The similarity of the length distribution is determined by the proportion of length tags that are the same at the same position in the length pattern sequence of the suspected inappropriate words and the length pattern sequence of the candidate connected words.

12. The method for detecting inappropriate language in speech recognition text according to claim 7, characterized in that, The step of determining the target similarity between the suspected inappropriate word and the candidate connected words based on the pronunciation similarity, stress pattern similarity, and length distribution similarity includes: The similarity of pronunciation, similarity of stress pattern, and similarity of length distribution are weighted and summed to obtain the target similarity between the suspected inappropriate word and the candidate connected words; wherein the weight of pronunciation similarity is greater than the weight of stress pattern similarity and the weight of length distribution similarity.

13. A device for detecting inappropriate language in speech-recognition text, characterized in that, The device includes: The text to be processed module is used to acquire the text to be processed, which is obtained by speech recognition of the user's dialogue speech. The suspected word and target statement determination module is used to determine suspected inappropriate words and the target dialogue statements corresponding to the suspected inappropriate words from the text to be processed; The candidate liaison word construction module is used to select at least two characters from the target dialogue statement that are associated with the suspected inappropriate word, and construct at least one candidate liaison word; The target similarity determination module is used to determine the target similarity between the suspected inappropriate words and the candidate connected words; The inappropriate word determination module is used to determine that the suspected inappropriate word is an inappropriate word present in the dialogue speech if the similarity of the target is less than a preset threshold.

14. An electronic device, characterized in that, The method includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method for detecting inappropriate language in speech recognition text as described in any one of claims 1-12.

15. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the speech recognition text inappropriate language detection method as described in any one of claims 1-12.