Bad phrase mining and semantic judgment method and device based on large model

By integrating statistical distribution weights and topic relevance weights, and combining them with a large language model to analyze and contextualize inappropriate corpora, this approach addresses the shortcomings in semantic recognition and screening accuracy of inappropriate phrase mining in existing technologies, achieving efficient and accurate inappropriate phrase identification.

CN123159339APending Publication Date: 2026-11-24NAT COMP NETWORK & INFORMATION SECURITY MANAGEMENT CENT +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611088971.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing technologies for bad phrase mining suffer from insufficient semantic recognition capabilities, low accuracy in phrase selection, and low automation.

Method used

By analyzing the negative corpus, the statistical distribution weights of words and the topic relevance weights are integrated to construct a set of candidate key phrases. The negative attribute score is calculated by combining the distribution difference index between positive and negative corpora. The contextual analysis of the candidate negative phrases is performed using a pre-trained language model to output negative semantic labels.

Benefits of technology

It achieves automated and high-precision mining of bad key phrases in large-scale bad corpora, improves the coverage and accuracy of bad key phrase identification, enhances the identification ability in complex semantic scenarios, and reduces the computational overhead of large language models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123159339A_ABST
    Figure CN123159339A_ABST
Patent Text Reader

Abstract

This application provides a method and apparatus for malicious phrase mining and semantic analysis based on a large model. The method includes: parsing malicious corpora to obtain words; fusing the statistical distribution weights and topic relevance weights of the words to obtain a set of candidate key phrases; acquiring a positive corpus and a malicious corpus, and statistically analyzing the distribution difference index of each candidate key phrase in the candidate key phrase set between the positive and malicious corpora; calculating a malicious attribute score based on the distribution difference index, and filtering a set of candidate malicious phrases from the candidate key phrase set based on the malicious attribute score; extracting contextual samples of each candidate malicious phrase in the candidate malicious phrase set; and inputting the candidate malicious phrases, contextual samples, and structured prompt templates into a pre-trained language model for processing to obtain a malicious semantic label. This achieves automated mining of key phrases in the corpus, improving the coverage, accuracy, and semantic analysis capabilities of phrase recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing technology, and in particular to a method and apparatus for bad phrase mining and semantic judgment based on a large model. Background Technology

[0002] In an environment of continuous growth in internet information, various online platforms generate massive amounts of text data every day. Therefore, the identification and recall of inappropriate content is of great value in real-world business scenarios.

[0003] Existing technologies for extracting offensive phrases from offensive corpora can be broadly categorized into three types: The first type is dictionary- or rule-based methods, relying on manually constructed offensive word libraries and employing dictionary matching and rule filtering to locate potential offensive expressions. The second type is phrase mining methods based on statistical features, using statistical indicators such as N-gram statistics, word frequency analysis, mutual information, or co-occurrence relationships to mine high-frequency word groups or candidate phrases, then combining these with filtering strategies to screen for content potentially carrying offensive meanings. The third type is machine learning or deep learning-based methods, utilizing text classification models or sentiment analysis models to identify text fragments or keywords carrying negative emotions.

[0004] However, the aforementioned methods still have significant shortcomings in practical applications: dictionary- or rule-based methods have limited lexicon coverage, and lexicon updates rely on manual intervention, making it difficult to promptly capture emerging new and inappropriate expressions in online corpora. Statistical feature-based phrase mining methods lack a deep understanding of semantics, making it difficult to accurately determine whether candidate phrases truly possess inappropriate semantics, and easily generating a large number of irrelevant or neutral phrases. Machine learning or deep learning-based methods are not specifically designed for inappropriate phrase mining, and still have shortcomings in granular expression discovery and structured organization. Furthermore, these methods generally lack the ability to analyze the thematic structure of the corpus and lack mechanisms for deep semantic analysis of candidate phrases, resulting in insufficient accuracy and representativeness of the mining results. Summary of the Invention

[0005] This application provides a method and apparatus for bad phrase mining and semantic judgment based on a large model, in order to solve the problems of insufficient semantic recognition ability, low accuracy of phrase screening and low degree of automation in the process of bad phrase mining in the prior art.

[0006] Firstly, this application provides a method for bad phrase mining and semantic analysis based on a large model, including: The negative corpus is analyzed to obtain words, and the statistical distribution weights and topic relevance weights of the words are fused to obtain a set of candidate key phrases; Obtain a positive corpus and a negative corpus, and statistically analyze the distribution difference index of each candidate key phrase in the candidate key phrase set in the positive corpus and the negative corpus; Based on the distribution difference index, a negative attribute score is calculated, and a candidate negative phrase set is obtained by filtering from the candidate key phrase set according to the negative attribute score; Extract the contextual samples of each candidate bad phrase from the candidate bad phrase set, and input the candidate bad phrases, the contextual samples, and the structured prompt template into a pre-trained language model for processing to obtain bad semantic labels.

[0007] In one possible implementation, the statistical distribution weights based on the words are fused with the topic relevance weights to obtain a set of candidate key phrases, including: The statistical distribution weights are calculated based on the local frequency and global rarity of the words in the malicious corpus. The topic relevance weight is calculated based on the vector space similarity between the semantic topic distribution of the phrase to which the word belongs and the text topic distribution of the bad corpus. The statistical distribution weights and topic relevance weights of the words are used to perform a fusion calculation to calculate the comprehensive score of each candidate phrase, and a set of candidate key phrases is obtained based on the comprehensive score.

[0008] In one possible implementation, the step of fusing the statistical distribution weights and topic relevance weights of the words to calculate a comprehensive score for each candidate phrase, and then filtering the candidate key phrase set based on the comprehensive score, includes: Obtain the domain feature information of the malicious language corpus; The fusion ratio factor of the statistical distribution weight and the topic relevance weight is dynamically adjusted based on the domain feature information. The statistical distribution weight and the topic relevance weight are weighted and summed based on the fusion ratio factor of the words, and a preset number of phrases are selected as the candidate key phrase set according to the summation result.

[0009] In one possible implementation, the step of acquiring a positive corpus and a negative corpus, and statistically analyzing the distribution difference index of each candidate key phrase in the candidate key phrase set in the positive corpus and the negative corpus, includes: Construct a positive corpus and a negative corpus; The number of hits for each candidate phrase in the candidate key phrase set in the positive corpus is counted, and the positive false alarm rate for each candidate phrase is calculated. The number of hits of each candidate phrase in the candidate keyword phrase set in the bad corpus is counted, and the bad recall rate of each candidate phrase is calculated.

[0010] In one possible implementation, the step of calculating a negative attribute score based on the distribution difference index, and then filtering a candidate negative phrase set from the candidate key phrase set based on the negative attribute score, includes: A comprehensive discrimination function is constructed based on the negative recall rate and the positive false injury rate; The negative attribute score for each candidate phrase is calculated using the comprehensive discriminant function; Candidate phrases with negative attribute scores greater than or equal to a preset threshold are identified as negative phrases, thus obtaining a set of candidate negative phrases.

[0011] In one possible implementation, the step of extracting contextual samples of each candidate bad phrase from the candidate bad phrase set, and inputting the candidate bad phrases, the contextual samples, and the structured prompt template into a pre-trained language model for processing to obtain bad semantic labels, includes: For each bad candidate phrase in the set of bad phrases, extract contextual samples containing the bad candidate phrase from the corpus to construct a contextual sample set; Build structured prompt templates; The candidate bad phrases, the contextual samples, and the structured prompt templates are input into a pre-trained language model for semantic analysis, and the results of bad phrase discrimination are output. The consistency of the discrimination results is verified. When the consistency check passes, a bad semantic label is output.

[0012] In one possible implementation, the method further includes: For target candidate bad phrases with uncertain identifiers in the bad semantic tags, multiple heterogeneous pre-trained language models are invoked for cross-inference to obtain multiple cross semantic tags; The consistency correction of the multiple cross-semantic tags is performed based on the majority voting mechanism to obtain the final bad semantic tags; The cross-inference and consistency correction using the multiple heterogeneous pre-trained language models are used to eliminate inference bias in a single model and improve the robustness of semantic labels.

[0013] Secondly, this application provides a method and apparatus for bad phrase mining and semantic judgment based on a large model, comprising: The calculation module is used to parse the bad language corpus to obtain words, and to perform a fusion calculation based on the statistical distribution weight and topic relevance weight of the words to obtain a set of candidate key phrases; The statistics module is used to acquire a positive corpus and a negative corpus, and to calculate the distribution difference index of each candidate key phrase in the candidate key phrase set in the positive corpus and the negative corpus. The filtering module is used to calculate the negative attribute score based on the distribution difference index, and filter the negative attribute score from the candidate key phrase set to obtain a candidate negative phrase set. The processing module is used to extract the contextual samples of each candidate bad phrase in the candidate bad phrase set, and input the candidate bad phrase, the contextual samples and the structured prompt template into the pre-trained language model for processing to obtain bad semantic labels.

[0014] Thirdly, this application provides an apparatus comprising: a processor and a memory, wherein the processor is configured to execute a large-model-based bad phrase mining and semantic analysis program stored in the memory, to implement the large-model-based bad phrase mining and semantic analysis method and apparatus described in any one of the first aspects.

[0015] Fourthly, this application provides a storage medium storing one or more programs, which can be executed by one or more processors to implement the bad phrase mining and semantic judgment method and apparatus based on a large model as described in the first aspect.

[0016] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application obtains words by parsing the corpus of negative words, and calculates a set of candidate key phrases by fusing the statistical distribution weights and topic relevance weights of the words; it acquires a positive corpus and a negative corpus, and statistically analyzes the distribution difference index of each candidate key phrase in the candidate key phrase set in the positive corpus and the negative corpus; it calculates a negative attribute score based on the distribution difference index, and selects a set of candidate negative phrases from the set of candidate key phrases based on the negative attribute score; it extracts the contextual samples of each candidate negative phrase in the set of candidate negative phrases, and inputs the candidate negative phrases, the contextual samples, and the structured prompt template into a pre-trained language model for processing to obtain a negative semantic label. By fusing LDA topic modeling and TF-IDF statistical weighting methods to extract candidate phrases from the corpus, it achieves automated and high-precision mining of negative key phrases in large-scale negative corpus, improving the coverage and accuracy of negative key phrase identification. Introducing a large language model to perform semantic discrimination on candidate phrases enhances the recognition ability in complex semantic scenarios and improves the semantic accuracy of negative phrase identification. It adopts a hierarchical processing approach that combines traditional machine learning with large language models, balancing recognition performance and resource consumption, and has good modularity and scalability. Attached Figure Description

[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0020] Figure 1 A flowchart illustrating a method for bad phrase mining and semantic analysis based on a large model, provided in an embodiment of this application; Figure 2 A flowchart illustrating another method for bad phrase mining and semantic analysis based on a large model provided in this application embodiment; Figure 3A schematic diagram of a large-model-based bad phrase mining and semantic analysis device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0022] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0023] To address the technical problems of insufficient semantic recognition capabilities, low accuracy in phrase selection, and low automation in existing methods for bad phrase mining, this application provides a method for bad phrase mining and semantic judgment based on a large model. This method combines candidate phrase extraction with semantic discrimination, improving the coverage, accuracy, and semantic analysis capabilities of bad key phrase identification. Simultaneously, it reduces the computational overhead of large language models, balancing processing efficiency and recognition performance, and possesses good scalability, making it applicable to various text bad phrase mining scenarios.

[0024] Figure 1 This is a flowchart illustrating a method for bad phrase mining and semantic analysis based on a large model, provided as an embodiment of this application. Figure 1 As shown, the method includes the following steps: S101. The bad language data is analyzed to obtain words. Based on the statistical distribution weight of the words and the topic relevance weight, a set of candidate key phrases is obtained.

[0025] This application provides a method for bad phrase mining and semantic analysis based on a large model. It integrates LDA topic modeling, TF-IDF statistical methods, and a large language model, aiming to achieve automated and accurate mining of bad phrases and construct a sustainably expandable set of bad phrases. Simultaneously, a hierarchical processing architecture reduces the computational overhead of the large language model, balancing processing efficiency and recognition performance. This method is applicable to text bad phrase mining tasks in various business scenarios, providing more effective basic resource support for the identification and recall of bad content in massive amounts of text.

[0026] In this embodiment, the input corpus of inappropriate language is first obtained, and then parsed to obtain multiple words. This parsing process can be text preprocessing, including word segmentation, part-of-speech tagging, and, combined with a stop word list and part-of-speech filtering rules, removing stop words, punctuation marks, and function words that do not contribute to actual semantics, while retaining words with semantic information such as nouns, verbs, and adjectives.

[0027] Next, the Term Frequency–Inverse Document Frequency (TF-IDF) statistical distribution weights are calculated based on the processed words to characterize their importance. Building upon this, adjacent effective words are combined according to preset rules to generate candidate phrases. A Latent Dirichlet Allocation (LDA) topic model is then introduced to calculate the relevance weights of each candidate phrase to the text topic, reflecting their topic representativeness. Finally, the statistical distribution weights and topic relevance weights are fused, and the candidate phrases are ranked and filtered based on the fusion results to obtain a set of candidate key phrases, providing high-quality candidate data for subsequent identification of problematic key phrases.

[0028] S102. Obtain positive and negative corpora, and statistically analyze the distribution differences of each candidate key phrase in the candidate key phrase set between the positive and negative corpora.

[0029] In this embodiment of the application, after obtaining the set of candidate key phrases, the distribution characteristics of each candidate key phrase are further analyzed by combining the positive corpus and the negative corpus, so as to facilitate the subsequent screening to obtain candidate negative phrases.

[0030] Specifically, a positive corpus and a negative corpus are pre-constructed, whereby the positive corpus may contain D. p This is not a piece of malicious text; a malicious corpus can contain D. nThis involves analyzing a set of inappropriate text. For each candidate keyword phrase in the candidate keyword phrase set, the distribution difference index between the positive and inappropriate text corpora is calculated. This distribution difference index can include the number of hits H of each candidate keyword phrase in the positive corpus. p and the number of hits H in the bad corpus n The data includes the negative recall rate (R) and positive false positive rate (P) for each candidate keyword phrase. The negative recall rate characterizes the ability of a candidate keyword phrase to cover negative text, while the positive false positive rate characterizes the degree of misidentification of a candidate keyword phrase in positive text. Based on these distribution difference indicators, a reliable data foundation is provided for subsequent preliminary screening of candidate keyword phrases and for determining negative semantics.

[0031] S103. Calculate the negative attribute score based on the distribution difference index, and select the candidate negative phrase set from the candidate key phrase set according to the negative attribute score.

[0032] In this embodiment of the application, a negative attribute score is calculated based on the distribution difference index of candidate key phrases, and a candidate negative phrase set is obtained by filtering from the candidate key phrase set according to the negative attribute score.

[0033] Specifically, a comprehensive discriminant function is constructed based on the negative recall rate R and the positive false positive rate P of the candidate key phrases. The comprehensive discriminant function calculates R and P together to ensure that the candidate key phrases have high negative coverage while taking into account low false positive risk, thereby obtaining a negative attribute score between 0 and 1.

[0034] Next, a threshold T for judging negative attributes is set as a preset threshold, and the negative attribute scores corresponding to each candidate key phrase are compared with the preset threshold. When the negative attribute score is greater than or equal to the preset threshold T, the corresponding candidate key phrase is retained as a candidate negative phrase; when the negative attribute score is less than the threshold T, the corresponding candidate key phrase is filtered out, thereby obtaining a set of candidate negative phrases, which provides highly reliable input data for subsequent semantic analysis.

[0035] S104. Extract the contextual samples of each candidate bad phrase from the candidate bad phrase set. Input the candidate bad phrases, contextual samples, and structured prompt templates into the pre-trained language model for processing to obtain bad semantic labels.

[0036] In this embodiment of the application, the powerful semantic understanding and reasoning capabilities of the large language model are utilized, combined with the real language environment in which the phrase is located, to perform semantic analysis on each candidate bad phrase in the candidate bad phrase set, so as to obtain the corresponding bad semantic label.

[0037] Specifically, for each candidate bad phrase, corresponding contextual samples are extracted from the pre-built positive corpus and bad corpus. These contextual samples can be contextual sentences or text fragments containing the candidate bad phrase, so as to use contextual samples for semantic analysis and avoid semantic ambiguity caused by isolated phrases.

[0038] Next, a structured prompt template is constructed, which may include a task description, contextual examples, and output constraints to standardize the reasoning process and output format of the pre-trained language model. Further, candidate inappropriate phrases, corresponding contextual samples, and the structured prompt template are input into the pre-trained language model. The pre-trained language model then combines contextual semantic information to comprehensively analyze the degree of inappropriateness, semantic category, and sentiment tendency of the candidate inappropriate phrases, outputting corresponding inappropriate semantic labels.

[0039] In the optional scheme of Embodiment 1 of this application, for candidate bad phrases whose model output has uncertainty or whose inference results are inconsistent, a multi-model cross-validation or multi-round inference voting mechanism can be used for consistency correction to improve the stability and reliability of bad semantic tags.

[0040] The technical solution provided in this application involves parsing malicious corpora to obtain words, fusing the statistical distribution weights and topic relevance weights of the words to obtain a set of candidate key phrases; acquiring a positive corpus and a malicious corpus, and statistically analyzing the distribution difference index of each candidate key phrase in the candidate key phrase set within the positive and malicious corpora; calculating a negative attribute score based on the distribution difference index, and filtering a set of candidate negative phrases from the candidate key phrase set based on the negative attribute score; extracting contextual samples of each candidate negative phrase in the candidate negative phrase set, and inputting the candidate negative phrases, the contextual samples, and structured prompt templates into a pre-trained language model for processing to obtain negative semantic labels. By fusing LDA topic modeling and TF-IDF statistical weighting methods to extract candidate phrases from the corpus, automated and high-precision mining of negative key phrases in large-scale malicious corpora is achieved, improving the coverage and accuracy of negative key phrase identification. Introducing a large language model for semantic discrimination of candidate phrases enhances the recognition ability in complex semantic scenarios and improves the semantic accuracy of negative phrase identification. It adopts a hierarchical processing approach that combines traditional machine learning with large language models, balancing recognition performance and resource consumption, and has good modularity and scalability.

[0041] Figure 2 This is a flowchart illustrating another method for bad phrase mining and semantic analysis based on a large model, provided in an embodiment of this application. Figure 2 The process shown includes the following steps: S201. The bad language corpus is parsed to obtain words. Based on the local frequency and global rarity of the words in the bad language corpus, the statistical distribution weight is calculated.

[0042] This application provides a method for bad phrase mining and semantic analysis based on a large model. It integrates LDA topic modeling, TF-IDF statistical methods, and a large language model, aiming to address the shortcomings of existing technologies in bad phrase mining, such as insufficient semantic recognition capabilities, low phrase selection accuracy, and low automation. This method achieves automated and accurate mining of bad phrases, constructing a sustainably expandable set of bad phrases. Simultaneously, a hierarchical processing architecture reduces the computational overhead of the large language model, balancing processing efficiency and recognition performance. This method is applicable to text bad phrase mining tasks in various business scenarios, providing more effective basic resource support for the identification and recall of bad content in massive amounts of text.

[0043] In this embodiment of the application, the input corpus of inappropriate language is parsed to obtain words, and the statistical distribution weights of each word are calculated based on the statistical characteristics of each word in the corpus of inappropriate language.

[0044] Specifically, the problematic corpus is first preprocessed, including word segmentation and part-of-speech tagging. Then, combined with a pre-defined stop word list and part-of-speech filtering rules, stop words, punctuation marks, and function words without actual semantic contribution are removed, while nouns, verbs, adjectives, and other semantically meaningful words are retained. The pre-defined stop word list can be derived from the Harbin Institute of Technology stop word list and manually expanded based on business domains. Part-of-speech filtering retains nouns, verbs, adjectives, and some adverbs, while filtering out conjunctions, prepositions, auxiliary words, modal particles, punctuation marks, and other semantically meaningless words. The aforementioned valid words are semantic words that have been retained after word segmentation, stop word removal, and part-of-speech filtering, and are at least two characters long.

[0045] Next, the frequency of each word in the malicious corpus was statistically analyzed. Combined with the word distribution across all documents, the Term Frequency-Inverse Document Frequency (TF-IDF) statistical distribution weights were calculated based on the local frequency and global rarity of the words to characterize the importance of each word in the malicious corpus. Local frequency reflects the activity level of a word in the current corpus, while global rarity reflects the word's discriminative ability across all documents. Together, they constitute the statistical distribution weights of the words, providing fundamental data support for subsequent candidate keyword generation and malicious semantic analysis.

[0046] S202. Based on the vector space similarity between the semantic topic distribution of the phrase to which the word belongs and the text topic distribution of the bad corpus, the topic relevance weight is calculated.

[0047] In this embodiment of the application, candidate phrases are generated based on the words obtained above, and topic relevance weights are calculated by combining the degree of matching between the candidate phrases and the semantic topics of the text.

[0048] Specifically, the valid words retained after text preprocessing are combined according to preset combination rules to generate candidate phrases. The preset combination rules can be as follows: candidate phrases are generated using a 2-4 gram sliding window, and are restricted to conforming to part-of-speech templates such as "adjective + noun", "adverb + adjective", and "verb + noun".

[0049] Subsequently, a Latent Dirichlet Allocation (LDA) topic model was introduced to model the topics of the malicious corpus, obtaining the topic probability distribution of the malicious text and the topic probability distribution corresponding to each candidate phrase. The text topic probability distribution can be obtained by training the topic model using LDA, and is used to represent the weight of the text on each semantic topic; the candidate phrase topic probability distribution can be obtained by weighted averaging of the topic distributions of documents containing the phrase, and is used to represent the semantic topic features to which the candidate phrase belongs.

[0050] Furthermore, topic relevance weights are calculated based on the vector space similarity between the topic probability distributions of candidate phrases and the corresponding negative text topic probability distributions. Cosine similarity can be used to process both to characterize the degree of matching between candidate phrases and the semantic topics of the text. Higher topic relevance weights indicate that candidate phrases better reflect the core semantic topics of the text, thus providing a reliable basis for subsequent candidate key phrase selection and negative semantic analysis.

[0051] S203. Obtain domain feature information of bad language corpus.

[0052] S204. Dynamically adjust the fusion ratio factor of statistical distribution weight and topic relevance weight based on domain characteristic information.

[0053] S205. The fusion ratio factor based on words is used to perform a weighted summation of the statistical distribution weight and the topic relevance weight, and a preset number of phrases are selected as a candidate key phrase set based on the summation result.

[0054] The following is a unified discussion of S203-S205.

[0055] In this embodiment of the application, after obtaining the statistical distribution weight and topic relevance weight of the candidate phrases, the two types of weights are fused and calculated to obtain a comprehensive score of the candidate phrases, and a set of candidate key phrases is obtained based on the comprehensive score.

[0056] Specifically, the first step is to acquire domain feature information of the problematic corpus, which may include domain category, text topic distribution, and semantic features. Based on this domain feature information, the fusion ratio factor corresponding to the statistical distribution weight and topic relevance weight is dynamically determined to adapt to the differences in word frequency distribution and topic clustering characteristics of corpora from different domains, thereby improving the screening effect of candidate key phrases in different scenarios.

[0057] Furthermore, based on the aforementioned determined fusion ratio factor, the statistical distribution weight and the topic relevance weight are weighted and summed to obtain a comprehensive score for each candidate phrase. This comprehensive score reflects both the statistical importance and semantic topic matching degree of the candidate phrases, and can reflect the distinguishing ability of words in poor corpora and their representativeness of the core theme of the text. Subsequently, all candidate phrases are sorted in descending order according to the comprehensive score, and candidate phrases are selected according to a preset screening quantity or preset screening ratio to construct a candidate key phrase set.

[0058] In one example, the statistical distribution weights and the topic relevance weights can be weighted and summed according to the following formula: W(phrase)=α×TF-IDF(phrase)+(1 α)×S(phrase) Where W(phrase) is the overall score of the candidate phrase, TF-IDF(phrase) represents the statistical distribution weight of the phrase, S(phrase) represents the topic relevance weight, and α is the weight coefficient.

[0059] Sort the phrases in descending order based on W (phrase) and select the top K candidate phrases as the candidate keyword phrase set. K can be automatically determined from the validation set, or a fixed value can be set as the default candidate size, for example, K = 5000.

[0060] Through an adaptive weight fusion mechanism, the candidate key phrases are ensured to have both high statistical importance and topic relevance, providing comprehensive and reliable candidate data for subsequent bad phrase identification and semantic analysis, and effectively improving the accuracy and generalization ability of bad phrase extraction.

[0061] S206. Construct a positive corpus and a negative corpus.

[0062] In this embodiment, a positive corpus and a negative corpus are pre-constructed. The positive corpus contains Dp pieces of non-negative text, representing normal semantic expressions; the negative corpus contains Dn pieces of negative text, representing expressions with negative semantic tendencies. The positive and negative corpora together serve as the basis for candidate keyword distribution statistics and negative attribute discrimination. The aforementioned negative and non-negative texts can be derived from publicly available internet corpora such as news articles, forums, microblogs, and comments. The positive and negative corpora are constructed by manually annotating these texts.

[0063] S207. Count the number of hits of each candidate phrase in the candidate key phrase set in the positive corpus, and calculate the positive false positive rate of each candidate phrase.

[0064] In the embodiments of this application, the distribution of each candidate key phrase in the candidate key phrase set in the positive corpus is statistically analyzed, and the positive false alarm rate is calculated accordingly.

[0065] Specifically, the candidate key phrase set is traversed, and the hit count H of each candidate key phrase in the positive corpus is counted. p , where H p This indicates the number of positive corpus documents containing the candidate keyword phrase. The number of hits H is calculated based on this. p Then, combined with the total number of documents D in the positive corpus p Calculate the positive false positive rate P for each candidate keyword phrase, where the positive false positive rate P is H. p With D p The ratio is used to characterize the frequency of occurrence of candidate key phrases in positive corpora, reflecting the risk of misjudging normal content when the candidate key phrase is identified as a bad expression.

[0066] S208. Count the number of hits of each candidate phrase in the candidate key phrase set in the bad corpus, and calculate the bad recall rate of each candidate phrase.

[0067] In this embodiment of the application, the distribution of each candidate key phrase in the candidate key phrase set in the bad corpus is statistically analyzed, and the bad recall rate is calculated accordingly.

[0068] Specifically, the set of candidate key phrases is traversed, and the hit count H of each candidate key phrase in the bad corpus is counted. n , where H n This indicates the number of bad corpus documents containing the candidate keyword phrase. The number of hits H is calculated from this. n Then, combined with the total number of documents D in the malicious language corpus n Calculate the negative recall rate R for each candidate keyword phrase, where the negative recall rate R is H. n With D nThe ratio is used to characterize the coverage of candidate key phrases in bad corpora, reflecting the ability of the candidate key phrase to identify bad expressions.

[0069] S209. Construct a comprehensive discriminant function based on the negative recall rate and the positive false negative rate.

[0070] S210. Calculate the negative attribute score for each candidate phrase using the comprehensive discriminant function.

[0071] The following is a unified discussion of S209-S210.

[0072] In this embodiment, a comprehensive discriminant function is constructed based on the aforementioned negative recall rate R and positive false negative rate P to quantitatively evaluate the negative attributes of candidate key phrases. Specifically, the comprehensive discriminant function jointly calculates the negative recall capability and the risk of false negatives to obtain a negative attribute score S corresponding to the candidate key phrase. This negative attribute score characterizes the credibility of the negative semantics of the candidate key phrase, providing a quantitative basis for subsequent screening of candidate negative phrases.

[0073] In one example, the comprehensive discriminant function is: S = R×(1 P) / (R+P) The above comprehensive discriminant function takes into account both recall and false negative rate. When the false negative rate increases, the score automatically decreases to ensure the reliability of the screening.

[0074] S211. Select candidate phrases with negative attribute scores greater than or equal to a preset threshold as negative phrases to obtain a set of candidate negative phrases.

[0075] In this embodiment, a negative attribute scoring threshold T is preset as a pre-defined threshold, and the negative attribute scores corresponding to each candidate key phrase are compared with the pre-defined threshold. When the negative attribute score of a candidate key phrase is greater than or equal to the pre-defined threshold, it is determined that the candidate key phrase has a clear negative semantic attribute and is retained as a candidate negative phrase; when the negative attribute score is less than the pre-defined threshold, it is determined that the candidate key phrase has insufficient negative attributes or a high risk of misjudgment and is filtered out.

[0076] By using threshold screening based on negative attribute scores, candidate key phrases are objectively and quantitatively judged, which reduces the false positive rate while ensuring the recall ability of negative expressions, thereby obtaining a reliable set of candidate negative phrases and providing high-quality input data for subsequent negative semantic analysis.

[0077] S212. For each bad candidate phrase in the set of bad phrases, extract contextual samples containing bad candidate phrases from the corpus and construct a contextual sample set.

[0078] In this embodiment of the application, for each candidate bad phrase in the candidate bad phrase set, a corresponding contextual sample set is constructed to provide real contextual information for subsequent semantic analysis.

[0079] Specifically, texts containing target candidate non-poor phrases are retrieved from pre-built positive and non-poor corpora. Complete sentences, paragraphs, or text fragments of a preset length containing these candidate non-poor phrases are extracted as contextual samples. For example, by default, 50-100 Chinese characters before and after each candidate non-poor phrase are selected as context windows. These samples can then be stored in association according to the candidate non-poor phrases, forming a corresponding set of contextual samples. The contextual samples not only contain the candidate non-poor phrases themselves but also retain their preceding and following semantic information to fully reflect the expression and semantic features of the candidate non-poor phrases in real-world language environments.

[0080] By constructing a contextual sample set, the subsequent pre-trained language model can combine contextual information to perform semantic understanding of candidate bad phrases, avoiding semantic ambiguity and misjudgment caused by judging based solely on isolated phrases, and improving the accuracy and reliability of bad semantic recognition.

[0081] S213. Construct a structured prompt template.

[0082] In this embodiment, a structured prompt template for semantic analysis of a pre-trained language model is constructed. Specifically, the structured prompt template may include three parts: a task description, contextual samples, and output constraints. The task description clarifies the analysis task that the pre-trained language model needs to complete, and may include the role positioning of the pre-trained language model, the definition of semantic discrimination, precautions, and requirements. The contextual samples provide standardized analysis examples to guide the pre-trained language model to understand candidate inappropriate phrases in conjunction with the context. Contextual samples that meet preset conditions can be selected using semantic similarity, and may include two positive contextual samples and two inappropriate contextual samples. The output constraints standardize the output content and format of the pre-trained language model. For example, the output content may include an inappropriate score, inappropriate category, keywords, and judgment reasons, and the output format is JSON.

[0083] The structured prompt template guides the pre-trained language model to conduct a comprehensive analysis of candidate bad phrases from multiple dimensions such as semantic tendency, expression intensity, and contextual meaning, thereby improving the consistency and standardization of the semantic reasoning process and providing a foundation for the subsequent generation of accurate and stable bad semantic labels.

[0084] S214. Input the candidate bad phrases, contextual samples, and structured prompt templates into the pre-trained language model for semantic analysis, and output the judgment results of bad phrases.

[0085] S215. Perform a consistency check on the discrimination results.

[0086] S216. When the consistency check passes, output the bad semantic label.

[0087] The following is a unified discussion of S214-S216.

[0088] In this embodiment of the application, candidate bad phrases, corresponding contextual samples, and structured prompt templates are input into a pre-trained language model. The pre-trained language model combines contextual semantic information to perform comprehensive reasoning and discrimination on the bad semantic attributes of the candidate bad phrases and outputs the corresponding discrimination results. The discrimination results may include the degree of badness, semantic category, and bad semantic label.

[0089] Next, the discrimination results output by the pre-trained language model are subjected to consistency verification. The verified results are then structured and organized, the JSON data output by the model is parsed, and the required fields are extracted and merged for subsequent use. When the consistency verification passes, the detrimental semantic labels are output.

[0090] In an optional embodiment of this application, for target candidate bad phrases with uncertain identifiers in bad semantic tags, multiple heterogeneous pre-trained language models are invoked for cross-inference to obtain multiple cross-semantic tags; the consistency correction of multiple cross-semantic tags is performed based on a majority voting mechanism to obtain the final bad semantic tags; wherein, cross-inference and consistency correction through multiple heterogeneous pre-trained language models are used to eliminate the inference bias of a single model and improve the robustness of semantic tags.

[0091] For candidate bad phrases with inconsistent reasoning results or uncertain identifiers, consistency optimization can be achieved through multi-round reasoning, multi-model cross-validation, or voting mechanisms to reduce random bias caused by single-round reasoning and improve the stability and reliability of the judgment results. Specifically, candidate bad phrases, corresponding contextual samples, and structured prompt templates are input into multiple heterogeneous pre-trained language models, and each pre-trained language model independently performs semantic analysis and outputs corresponding cross-semantic labels.

[0092] Next, consistency checks are performed on multiple cross-semantic labels, and the final bad semantic labels are determined based on a majority voting mechanism. When the outputs of multiple pre-trained language models are consistent, the corresponding semantic label is directly used as the final judgment result; when the outputs differ, the semantic label with the most votes is used as the final bad semantic label.

[0093] By introducing multiple heterogeneous pre-trained language models for cross-reasoning and combining them with a majority voting mechanism for consistency correction, the impact of single-model inference bias and randomness on the discrimination results can be effectively reduced, thereby improving the accuracy, stability, and robustness of malicious semantic labels.

[0094] Figure 2 The illustrated process provides a method for bad phrase mining and semantic judgment based on a large-scale model. By integrating LDA topic modeling and TF-IDF statistical weighting methods to extract candidate phrases from the corpus, it achieves automated and high-precision mining of bad key phrases in large-scale bad corpora, improving the coverage and accuracy of bad key phrase identification. The introduction of a large language model for semantic discrimination of candidate phrases enhances the recognition capability in complex semantic scenarios and improves the semantic accuracy of bad phrase identification. A hierarchical processing approach combining traditional machine learning and a large language model is adopted, balancing recognition performance and resource consumption, and exhibiting good modularity and scalability.

[0095] Figure 3 This is a schematic diagram of a large-model-based bad phrase mining and semantic analysis device provided in an embodiment of this application. Figure 3 As shown, the device includes: The calculation module 301 is used to parse the bad language corpus to obtain words, and perform a fusion calculation based on the statistical distribution weight and topic relevance weight of the words to obtain a set of candidate key phrases; The statistics module 302 is used to acquire a positive corpus and a negative corpus, and to calculate the distribution difference index of each candidate key phrase in the candidate key phrase set in the positive corpus and the negative corpus. The filtering module 303 is used to calculate the negative attribute score based on the distribution difference index, and filter the negative attribute score from the candidate key phrase set to obtain a candidate negative phrase set. The processing module 304 is used to extract the contextual samples of each candidate bad phrase in the candidate bad phrase set, and input the candidate bad phrase, the contextual samples and the structured prompt template into the pre-trained language model for processing to obtain bad semantic labels.

[0096] In one possible implementation, the calculation module 301 is specifically used to: calculate the statistical distribution weight based on the local frequency and global rarity of the word in the malformed corpus; calculate the topic relevance weight based on the vector space similarity between the semantic topic distribution of the phrase to which the word belongs and the text topic distribution of the malformed corpus; perform a fusion calculation using the statistical distribution weight and the topic relevance weight of the word to calculate the comprehensive score of each candidate phrase; and filter the candidate key phrase set according to the comprehensive score.

[0097] In one possible implementation, the calculation module 301 is further configured to: acquire domain feature information of the bad corpus; dynamically adjust the fusion ratio factor of the statistical distribution weight and the topic relevance weight according to the domain feature information; perform a weighted summation of the statistical distribution weight and the topic relevance weight based on the fusion ratio factor of the words, and extract a preset number of phrases as the candidate key phrase set according to the summation result.

[0098] In one possible implementation, the statistics module 302 is specifically used for: constructing a positive corpus and a negative corpus; counting the number of hits of each candidate phrase in the candidate key phrase set in the positive corpus, and calculating the positive false negative rate of each candidate phrase; counting the number of hits of each candidate phrase in the candidate key phrase set in the negative corpus, and calculating the negative recall rate of each candidate phrase.

[0099] In one possible implementation, the screening module 303 is configured to: construct a comprehensive discrimination function based on the negative recall rate and the positive false negative rate; calculate the negative attribute score of each candidate phrase using the comprehensive discrimination function; and select candidate phrases whose negative attribute scores are greater than or equal to a preset threshold as negative phrases to obtain a set of candidate negative phrases.

[0100] In one possible implementation, the processing module 304 is specifically configured to: for each bad candidate phrase in the candidate bad phrase set, extract contextual samples containing the bad candidate phrase from the corpus to construct a contextual sample set; construct a structured prompt template; input the candidate bad phrase, the contextual samples, and the structured prompt template into a pre-trained language model for semantic analysis, and output the discrimination result of the bad phrase; perform consistency verification on the discrimination result; and when the consistency verification passes, output a bad semantic label.

[0101] In one possible implementation, the device further includes a verification module 305; The verification module 305 is specifically used for: for target candidate bad phrases with uncertain identifiers in the bad semantic tags, calling multiple heterogeneous pre-trained language models to perform cross-inference to obtain multiple cross-semantic tags; and performing consistency correction on the multiple cross-semantic tags based on a majority voting mechanism to obtain the final bad semantic tags; wherein, the cross-inference through the multiple heterogeneous pre-trained language models and the consistency correction are used to eliminate the inference bias of a single model and improve the robustness of the semantic tags.

[0102] like Figure 4As shown in the illustration, this application provides a device including a processor 411, a communication interface 412, a memory 413, and a communication bus 414. The processor 411, communication interface 412, and memory 413 communicate with each other via the communication bus 414. Memory 413 is used to store computer programs; In one embodiment of this application, when the processor 411 executes the program stored in the memory 413, it implements the large-model-based bad phrase mining and semantic judgment method provided in any of the foregoing method embodiments, including: The negative corpus is analyzed to obtain words, and the statistical distribution weights and topic relevance weights of the words are fused to obtain a set of candidate key phrases; Obtain a positive corpus and a negative corpus, and statistically analyze the distribution difference index of each candidate key phrase in the candidate key phrase set in the positive corpus and the negative corpus; Based on the distribution difference index, a negative attribute score is calculated, and a candidate negative phrase set is obtained by filtering from the candidate key phrase set according to the negative attribute score; Extract the contextual samples of each candidate bad phrase from the candidate bad phrase set, and input the candidate bad phrases, the contextual samples, and the structured prompt template into a pre-trained language model for processing to obtain bad semantic labels.

[0103] In one possible implementation, the statistical distribution weight is calculated based on the local frequency and global rarity of the word in the malformed corpus; the topic relevance weight is calculated based on the vector space similarity between the semantic topic distribution of the phrase to which the word belongs and the text topic distribution of the malformed corpus; the statistical distribution weight and the topic relevance weight of the word are fused together to calculate the comprehensive score of each candidate phrase, and a set of candidate key phrases is obtained based on the comprehensive score.

[0104] In one possible implementation, domain feature information of the bad corpus is obtained; the fusion ratio factor of the statistical distribution weight and the topic relevance weight is dynamically adjusted according to the domain feature information; the statistical distribution weight and the topic relevance weight are weighted and summed based on the fusion ratio factor of the words, and a preset number of phrases are selected as the candidate key phrase set according to the summation result.

[0105] In one possible implementation, a positive corpus and a negative corpus are constructed; the number of hits of each candidate phrase in the candidate key phrase set in the positive corpus is counted, and the positive false negative rate of each candidate phrase is calculated; the number of hits of each candidate phrase in the candidate key phrase set in the negative corpus is counted, and the negative recall rate of each candidate phrase is calculated.

[0106] In one possible implementation, a comprehensive discriminant function is constructed based on the negative recall rate and the positive false negative rate; the negative attribute score of each candidate phrase is calculated using the comprehensive discriminant function; and candidate phrases with negative attribute scores greater than or equal to a preset threshold are identified as negative phrases, thus obtaining a set of candidate negative phrases.

[0107] In one possible implementation, for each bad candidate phrase in the set of bad phrases, contextual samples containing the bad candidate phrase are extracted from the corpus to construct a contextual sample set; a structured prompt template is constructed; the bad candidate phrase, the contextual samples, and the structured prompt template are input into a pre-trained language model for semantic analysis, and the judgment result of the bad phrase is output; the judgment result is checked for consistency; when the consistency check passes, a bad semantic label is output.

[0108] In one possible implementation, for target candidate bad phrases with uncertain identifiers in the bad semantic tags, multiple heterogeneous pre-trained language models are invoked for cross-inference to obtain multiple cross-semantic tags; the multiple cross-semantic tags are then subjected to consistency correction based on a majority voting mechanism to obtain the final bad semantic tags; wherein, the cross-inference through the multiple heterogeneous pre-trained language models and the consistency correction are used to eliminate the inference bias of a single model and improve the robustness of the semantic tags.

[0109] This application embodiment also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; the memory may also include combinations of the above types of memory. When one or more programs in the storage medium can be executed by one or more processors to implement the above-described large-model-based bad phrase mining and semantic judgment method executed on the device side of the large-model-based bad phrase mining and semantic judgment, the processor is used to execute the large-model-based bad phrase mining and semantic judgment program stored in the memory to implement the following steps of executing the large-model-based bad phrase mining and semantic judgment method on the device side: The process involves parsing the negative corpus to obtain words, fusing the statistical distribution weights and topic relevance weights of these words to obtain a set of candidate key phrases; acquiring a positive corpus and a negative corpus, and statistically analyzing the distribution difference index of each candidate key phrase in the candidate key phrase set within the positive and negative corpora; calculating a negative attribute score based on the distribution difference index, and selecting a set of candidate negative phrases from the candidate key phrase set based on the negative attribute score; extracting contextual samples of each candidate negative phrase from the candidate negative phrase set, and inputting the candidate negative phrases, the contextual samples, and the structured prompt template into a pre-trained language model for processing to obtain negative semantic labels.

[0110] In one possible implementation, the statistical distribution weight is calculated based on the local frequency and global rarity of the word in the malformed corpus; the topic relevance weight is calculated based on the vector space similarity between the semantic topic distribution of the phrase to which the word belongs and the text topic distribution of the malformed corpus; the statistical distribution weight and the topic relevance weight of the word are fused together to calculate the comprehensive score of each candidate phrase, and a set of candidate key phrases is obtained based on the comprehensive score.

[0111] In one possible implementation, domain feature information of the bad corpus is obtained; the fusion ratio factor of the statistical distribution weight and the topic relevance weight is dynamically adjusted according to the domain feature information; the statistical distribution weight and the topic relevance weight are weighted and summed based on the fusion ratio factor of the words, and a preset number of phrases are selected as the candidate key phrase set according to the summation result.

[0112] In one possible implementation, a positive corpus and a negative corpus are constructed; the number of hits of each candidate phrase in the candidate key phrase set in the positive corpus is counted, and the positive false negative rate of each candidate phrase is calculated; the number of hits of each candidate phrase in the candidate key phrase set in the negative corpus is counted, and the negative recall rate of each candidate phrase is calculated.

[0113] In one possible implementation, a comprehensive discriminant function is constructed based on the negative recall rate and the positive false negative rate; the negative attribute score of each candidate phrase is calculated using the comprehensive discriminant function; and candidate phrases with negative attribute scores greater than or equal to a preset threshold are identified as negative phrases, thus obtaining a set of candidate negative phrases.

[0114] In one possible implementation, for each bad candidate phrase in the set of bad phrases, contextual samples containing the bad candidate phrase are extracted from the corpus to construct a contextual sample set; a structured prompt template is constructed; the bad candidate phrase, the contextual samples, and the structured prompt template are input into a pre-trained language model for semantic analysis, and the judgment result of the bad phrase is output; the judgment result is checked for consistency; when the consistency check passes, a bad semantic label is output.

[0115] In one possible implementation, for target candidate bad phrases with uncertain identifiers in the bad semantic tags, multiple heterogeneous pre-trained language models are invoked for cross-inference to obtain multiple cross-semantic tags; the multiple cross-semantic tags are then subjected to consistency correction based on a majority voting mechanism to obtain the final bad semantic tags; wherein, the cross-inference through the multiple heterogeneous pre-trained language models and the consistency correction are used to eliminate the inference bias of a single model and improve the robustness of the semantic tags.

[0116] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0117] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0118] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also mean including the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.

[0119] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for bad phrase mining and semantic analysis based on a large model, characterized in that, The method includes: The negative corpus is analyzed to obtain words, and the statistical distribution weights and topic relevance weights of the words are fused to obtain a set of candidate key phrases; Obtain a positive corpus and a negative corpus, and statistically analyze the distribution difference index of each candidate key phrase in the candidate key phrase set in the positive corpus and the negative corpus; Based on the distribution difference index, a negative attribute score is calculated, and a candidate negative phrase set is obtained by filtering from the candidate key phrase set according to the negative attribute score; Extract the contextual samples of each candidate bad phrase from the candidate bad phrase set, and input the candidate bad phrases, the contextual samples, and the structured prompt template into a pre-trained language model for processing to obtain bad semantic labels.

2. The method according to claim 1, characterized in that, The statistical distribution weights and topic relevance weights based on the words are fused together to obtain a set of candidate key phrases, including: The statistical distribution weights are calculated based on the local frequency and global rarity of the words in the malicious corpus. The topic relevance weight is calculated based on the vector space similarity between the semantic topic distribution of the phrase to which the word belongs and the text topic distribution of the bad corpus. The statistical distribution weights and topic relevance weights of the words are used to perform a fusion calculation to calculate the comprehensive score of each candidate phrase, and a set of candidate key phrases is obtained based on the comprehensive score.

3. The method according to claim 1, characterized in that, The method involves fusing the statistical distribution weights and topic relevance weights of the words to calculate a comprehensive score for each candidate phrase. Based on this comprehensive score, a set of candidate key phrases is obtained, including: Obtain the domain feature information of the malicious language corpus; The fusion ratio factor of the statistical distribution weight and the topic relevance weight is dynamically adjusted based on the domain feature information. The statistical distribution weight and the topic relevance weight are weighted and summed based on the fusion ratio factor of the words, and a preset number of phrases are selected as the candidate key phrase set according to the summation result.

4. The method according to claim 1, characterized in that, The process of acquiring a positive corpus and a negative corpus, and statistically analyzing the distribution differences of each candidate key phrase in the candidate key phrase set within the positive corpus and the negative corpus, includes: Construct a positive corpus and a negative corpus; The number of hits for each candidate phrase in the candidate key phrase set in the positive corpus is counted, and the positive false alarm rate for each candidate phrase is calculated. The number of hits of each candidate phrase in the candidate keyword phrase set in the bad corpus is counted, and the bad recall rate of each candidate phrase is calculated.

5. The method according to claim 4, characterized in that, The step of calculating a negative attribute score based on the distribution difference index, and then filtering a candidate negative phrase set from the candidate key phrase set based on the negative attribute score, includes: A comprehensive discrimination function is constructed based on the negative recall rate and the positive false injury rate; The negative attribute score for each candidate phrase is calculated using the comprehensive discriminant function; Candidate phrases with negative attribute scores greater than or equal to a preset threshold are identified as negative phrases, thus obtaining a set of candidate negative phrases.

6. The method according to claim 1, characterized in that, The process involves extracting contextual samples of each candidate bad phrase from the candidate bad phrase set, inputting the candidate bad phrases, the contextual samples, and the structured prompt template into a pre-trained language model for processing, and obtaining bad semantic labels, including: For each bad candidate phrase in the set of bad phrases, extract contextual samples containing the bad candidate phrase from the corpus to construct a contextual sample set; Build structured prompt templates; The candidate bad phrases, the contextual samples, and the structured prompt templates are input into a pre-trained language model for semantic analysis, and the results of bad phrase discrimination are output. The consistency of the discrimination results is verified. When the consistency check passes, a bad semantic label is output.

7. The method according to claim 6, characterized in that, The method further includes: For target candidate bad phrases with uncertain identifiers in the bad semantic tags, multiple heterogeneous pre-trained language models are invoked for cross-inference to obtain multiple cross semantic tags; The consistency correction of the multiple cross-semantic tags is performed based on the majority voting mechanism to obtain the final bad semantic tags; The cross-inference and consistency correction using the multiple heterogeneous pre-trained language models are used to eliminate inference bias in a single model and improve the robustness of semantic labels.

8. A device for mining and semantically judging bad phrases based on a large model, characterized in that, The device includes: The calculation module is used to parse the bad language corpus to obtain words, and to perform a fusion calculation based on the statistical distribution weight and topic relevance weight of the words to obtain a set of candidate key phrases; The statistics module is used to acquire a positive corpus and a negative corpus, and to calculate the distribution difference index of each candidate key phrase in the candidate key phrase set in the positive corpus and the negative corpus. The filtering module is used to calculate the negative attribute score based on the distribution difference index, and filter the negative attribute score from the candidate key phrase set to obtain a candidate negative phrase set. The processing module is used to extract the contextual samples of each candidate bad phrase in the candidate bad phrase set, and input the candidate bad phrase, the contextual samples and the structured prompt template into the pre-trained language model for processing to obtain bad semantic labels.

9. An electronic device, characterized in that, include: A processor and a memory, the processor being configured to execute a large-model-based bad phrase mining and semantic analysis program stored in the memory, to implement the large-model-based bad phrase mining and semantic analysis method according to any one of claims 1-7.

10. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the bad phrase mining and semantic judgment method based on a large model as described in any one of claims 1-7.