Text processing method and device for privacy protection, equipment and medium

By identifying and filtering privacy-sensitive information, performing part-of-speech tagging and constructing fused feature vectors, using lightweight neural networks to correct low-confidence labels, constructing a thesaurus and removing stop words, the problem of high computational overhead in existing technologies is solved, achieving efficient and accurate text preprocessing and providing a high-quality data foundation.

CN121786878APending Publication Date: 2026-04-03XI'AN PETROLEUM UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing technologies incur enormous computational overhead when performing sentiment analysis on text data containing user privacy information, making them difficult to apply to real-time processing of massive amounts of text and unable to effectively reduce computational costs.

Method used

By identifying and filtering privacy-sensitive information, performing part-of-speech tagging and constructing fused feature vectors, using lightweight neural networks to correct low-confidence labels, constructing a thesaurus and removing stop words, and retaining core sentiment vocabulary, efficient text preprocessing is achieved.

Benefits of technology

While maintaining accuracy, it significantly reduced computational overhead, improved the efficiency and accuracy of part-of-speech tagging, and provided a high-quality data foundation for subsequent analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121786878A_ABST
    Figure CN121786878A_ABST
Patent Text Reader

Abstract

The invention discloses a text processing method and device for privacy protection, equipment and a medium. The method comprises the following steps: filtering privacy sensitive information to obtain a filtered text; performing initial part-of-speech tagging on each word in the filtered text, constructing a fusion feature vector according to the to-be-fused word of the word corresponding to the low-confidence label identified from the initial part-of-speech tagging sequence, and determining a final part-of-speech tagging sequence; obtaining a second synonym set according to a word needing to be restored in the final part-of-speech tagging sequence and a final part-of-speech tag corresponding to the word needing to be restored, and determining a restored final lexical element of the current to-be-processed word according to the second synonym set and a third synonym set of related words obtained by taking the word needing to be restored as a center; and removing stop words and punctuations, and reserving final lexical elements with preset part-of-speech as sentiment core vocabularies. According to the text processing method, the accuracy is ensured, and the calculation overhead can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of text processing technology, and specifically relates to a text processing method, apparatus, device and medium for privacy protection. Background Technology

[0002] In today's big data era, advanced semantic processing, such as sentiment analysis and public opinion monitoring, of text data containing user privacy information has become a key technology for business intelligence and social governance. This type of processing typically begins with preprocessing the raw text, aiming to extract high-quality, analyzable sentiment feature words while protecting privacy.

[0003] When performing sentiment analysis on text data containing user privacy information, part-of-speech tagging is required. Currently, deep learning models can be used for full-text tagging. Although this method has high accuracy, it has huge computational overhead and is difficult to apply to the real-time processing of massive amounts of text.

[0004] Therefore, there is an urgent need for a text preprocessing method that can both ensure accuracy and reduce computational overhead. Summary of the Invention

[0005] To address the aforementioned problems in the prior art, this invention provides a text processing method, apparatus, device, and medium for privacy protection. The technical problem to be solved by this invention is achieved through the following technical solution: In a first aspect, the present invention provides a text processing method for privacy protection, comprising: Obtain the raw text to be processed; Identify the privacy-sensitive information in the original text to be processed, and filter the privacy-sensitive information to obtain the filtered text; Each word in the filtered text is initially part-of-speech tagging to obtain an initial part-of-speech tagging sequence. A fusion feature vector is constructed based on the words to be fused according to the words corresponding to the low-confidence tags identified from the initial part-of-speech tagging sequence, so as to determine the final part-of-speech tagging sequence including each word and its final part-of-speech tag. Based on the words to be restored in the final part-of-speech tagging sequence and the final part-of-speech tags corresponding to the words to be restored, a second set of synonyms including non-repeating candidate word elements is obtained, and based on the second set of synonyms and a third set of related words obtained with the words to be restored as the center, the final word element to be restored for the current word to be processed is determined. Remove stop words and punctuation, and retain the final word units with preset parts of speech as the core vocabulary of emotion.

[0006] Secondly, the present invention also provides a text processing apparatus for privacy protection, comprising: The acquisition module is used to acquire the raw text to be processed; A sensitive information filtering module is used to identify the privacy-sensitive information in the original text to be processed, and to filter the privacy-sensitive information to obtain the filtered text. The part-of-speech tagging module is used to perform initial part-of-speech tagging on each word in the filtered text to obtain an initial part-of-speech tagging sequence, and to construct a fusion feature vector based on the words to be fused according to the words corresponding to the low confidence tags identified from the initial part-of-speech tagging sequence, so as to determine the final part-of-speech tagging sequence including each word and its final part-of-speech tag. The restoration module is used to obtain a second set of synonyms including non-repeating candidate words based on the words to be restored in the final part-of-speech tagging sequence and the final part-of-speech tags corresponding to the words to be restored, and to determine the final word to be restored for the current word to be processed based on the second set of synonyms and a third set of synonyms of related words obtained with the words to be restored as the center; The sentiment vocabulary generation module is used to remove stop words and punctuation, and retain the final word units with preset parts of speech as the core sentiment vocabulary.

[0007] Thirdly, the present invention also provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing the computer program, implements the text processing method described in any of the above embodiments.

[0008] Fourthly, one embodiment of the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the text processing method described in any of the above embodiments.

[0009] The beneficial effects of this invention are: This invention first identifies privacy-sensitive information in the original text to be processed and filters this information to obtain filtered text. Then, by performing part-of-speech tagging on the filtered text to obtain an initial part-of-speech tagging sequence, low-confidence labels are identified, thereby obtaining the words to be fused corresponding to the low-confidence labels, constructing a fusion feature vector, and thus determining the final part-of-speech tagging sequence. This part-of-speech tagging method ensures accuracy while reducing computational overhead. In addition, this invention obtains several second synonym sets based on the words to be restored in the final part-of-speech tagging sequence and the final part-of-speech tags corresponding to the words to be restored. Based on the second synonym sets and a third synonym set of related words obtained centered on the words to be restored, the final word unit to be restored for the current word to be processed is determined, realizing accurate inference of words in complex contexts.

[0010] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0011] Figure 1 This is a flowchart illustrating a text processing method for privacy protection provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a text processing device for privacy protection provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of an electronic device provided in this embodiment of the present invention. Detailed Implementation

[0012] The present invention will be further described in detail below with reference to specific embodiments, but the implementation of the present invention is not limited thereto.

[0013] Example 1 Please see Figure 1 , Figure 1 This is a flowchart illustrating a text processing method for privacy protection provided in an embodiment of the present invention. The present invention provides a text processing method for privacy protection, the text processing method comprising: Step 1: Obtain the raw text to be processed.

[0014] Here, the raw text to be processed refers to the initial user input data that has not been processed in any way and contains potentially privacy-sensitive information.

[0015] Step 2: Identify the privacy-sensitive information in the original text to be processed, and filter the privacy-sensitive information to obtain the filtered text.

[0016] In one specific embodiment, step 2 may include: Step 2.1: Use the sensitive information database to match the original text to be processed to obtain privacy-sensitive information. The sensitive information database includes regular expressions used to identify privacy-sensitive information.

[0017] Specifically, this embodiment pre-establishes a sensitive information database, which includes several regular expressions, each used to identify a specific pattern of sensitive information. For example, the sensitive information database includes regular expressions for matching URL links, which can match strings in text that begin with "http: / / " or "https: / / "; the sensitive information database also includes regular expressions for matching user mentions, which can match strings that begin with "@" followed by letters, numbers, or underscores; the sensitive information database may also include regular expressions for identifying other patterns of sensitive information, such as personal identification information (e.g., ID card numbers), email addresses, etc.

[0018] Therefore, for the original text to be processed, the original text is scanned and matched against all regular expressions in the sensitive information database to identify all privacy-sensitive information in the original text to be processed.

[0019] Step 2.2: Replace the privacy-sensitive information with the final token, which includes the type label, to obtain the filtered text.

[0020] Here, the type label is a string used to identify the category to which privacy-sensitive information belongs. For example, the type label for a URL link is URL, and the type label for user mentions is MENTION.

[0021] Step 2.21: Based on the cryptographic hash function, obtain the hash result according to the privacy-sensitive information and random salt.

[0022] Specifically, a unique random string, i.e., a random salt, is generated for the original text to be processed. Then, the text is concatenated according to the combination order of privacy-sensitive information and random salt. The concatenation result of privacy-sensitive information and random salt is encrypted and hashed using an encrypted hash function to generate a hash result corresponding to the privacy-sensitive information. For example, the hash result includes 8 bytes, a total of 64 bits.

[0023] Step 2.22: Obtain the final token for the privacy-sensitive information based on the type label and hash result of the privacy-sensitive information.

[0024] Specifically, the first a bytes of the hash result can be taken and converted into a hexadecimal or Base64 encoded string. Then, the type label of the privacy-sensitive information and the extracted first a bytes of string can be combined in order to obtain the token of the privacy-sensitive information, for example, the token of the privacy-sensitive information is [MENTION_a1b2c3d4].

[0025] Step 2.23: Replace the privacy-sensitive information in the original text to be processed with the final token to obtain the filtered text.

[0026] In addition, a mapping table can be established to store privacy-sensitive information and the corresponding final token, thereby revealing the true information of the privacy-sensitive information replaced by the final token.

[0027] In this embodiment, after obtaining the filtered text, each word in the filtered text can be detected and corrected using Jaccard similarity to obtain the corrected text, and then step 3 is executed.

[0028] Specifically, a standard English dictionary is loaded on the client side. This dictionary is a collection of common English words, which could be a word list from the NLTK library or a system-provided dictionary. The filtered local text data is segmented into individual words. Then, each word is iterated over to determine if it exists in the standard English dictionary. If it exists, it is considered spelled correctly; otherwise, it is marked as a suspected misspelling. Next, the standard dictionary is searched for all words in the standard dictionary whose edit distance to the suspected misspelling is less than or equal to 2. These words are then recorded as candidate words. Here, edit distance refers to the minimum number of operations required to transform one word into another by inserting, deleting, or replacing a character. Next, the Jaccard similarity between the suspected misspelled word and each candidate word is calculated. The Jaccard similarity of all candidate words is compared, and the candidate word with the highest Jaccard similarity is selected. If the Jaccard similarity of the candidate word is greater than the confidence threshold (e.g., 0.7), correction is performed, that is, the suspected misspelled word is replaced with the candidate word. Otherwise, the original word is retained. After all words have been processed, all words sorted in order form the corrected text.

[0029] Step 3: Perform initial part-of-speech tagging on each word in the filtered text to obtain an initial part-of-speech tagging sequence. Construct a fusion feature vector based on the words to be fused according to the words corresponding to the low-confidence tags identified from the initial part-of-speech tagging sequence, so as to determine the final part-of-speech tagging sequence including each word and its final part-of-speech tag.

[0030] In one specific embodiment, step 3 may include: Step 3.1: Divide the filtered text into several independent sentences, and then divide each sentence into several independent words to form a word sequence corresponding to each sentence.

[0031] Specifically, NLTK (Natural Language Toolkit) is a Python natural language processing toolkit. This embodiment uses NLTK's `sent_tokenize` function to segment the filtered text into several independent sentences, and then uses NLTK's `word_tokenize` function to segment each sentence into several independent words and punctuation marks. Thus, the words corresponding to each sentence are sequentially combined into a word sequence. It should be noted that the final token is segmented into a complete word unit.

[0032] Step 3.2: Use NLTK to perform initial part-of-speech tagging on each word in the word sequence to obtain the initial part-of-speech tagging sequence for each sentence. The initial part-of-speech tagging sequence includes several first tag pairs, each of which includes a word and its corresponding first part-of-speech tag.

[0033] Specifically, the Hidden Markov Model (HMM) of NLTK can be used to perform initial part-of-speech tagging on each word in each word sequence obtained in step 3.1, resulting in the first part-of-speech tag for each word. This first part-of-speech tag is the part-of-speech tag assigned to the word by the HMM of NLTK. For example, "run" is tagged as VB (verb infinitive), "running" is tagged as VBG (gerund / present participle), and "the" is tagged as DT (qualifier). Thus, the words in each word sequence and their first part-of-speech tags are combined into a first tag pair. All the words in the word sequence and their corresponding first tag pairs are combined sequentially to form the initial part-of-speech tag sequence.

[0034] Step 3.3: Calculate the confidence score of each first part-of-speech tag in the initial part-of-speech tag sequence and identify low-confidence tags. Construct a fusion feature vector based on the words to be fused according to the words corresponding to the low-confidence tags. Obtain the final part-of-speech tag sequence based on the final part-of-speech tags of the words corresponding to the low-confidence tags obtained from the fusion feature vector.

[0035] Step 3.31: Generate the confidence score of each first part-of-speech tag in the initial part-of-speech tagging sequence based on the forward and backward probability calculation method, and record the first part-of-speech tag corresponding to the confidence score that is less than the confidence threshold as a low confidence tag.

[0036] Specifically, the confidence score of each first part-of-speech tag in each initial part-of-speech tagging sequence is calculated using the forward and backward probability calculation method of HMM. The confidence score of the first part-of-speech tag is expressed as: in, Let t be the first part-of-speech tag for the t-th word. This is the confidence score of i, where i is a specific part-of-speech tag. For example, in a tag library containing 45 tags, i=1 represents NN (noun), i=2 represents VB (verb), and so on, up to i=45. Let be the forward probability, representing the first part-of-speech tag of the first t words seen and the t-th word. The probability that it is i. Let be the backward probability, representing the first part-of-speech tag of the t-th word. Given that the word is i, what is the probability of seeing the (t+1)th word up to the end of the sentence? The probability of the entire sentence. It equals the sum of the forward probabilities of all first part-of-speech tags at the end of the sentence. , Let T be the forward probability in the HMM, and T be the sentence length. This represents the total number of first-part-of-speech tags.

[0037] Next, the confidence score of the first part-of-speech tag is compared with the confidence threshold. When the confidence score of the first part-of-speech tag is less than the confidence threshold, it means that after being marked as a low-confidence tag, the low-confidence tag needs to be further corrected and confirmed to ensure the accuracy of the final part-of-speech tag for each word.

[0038] Preferably, the confidence threshold is between 0.8 and 0.9.

[0039] Step 3.32: Using the words corresponding to the low confidence labels as the center, extract the words to be merged from the word sequence that are within the second preset window.

[0040] Specifically, taking the words corresponding to the low-confidence labels as the center, all words within the second preset window are extracted from the word sequence containing the words corresponding to the low-confidence labels. These words together constitute the words to be merged. The words to be merged include several words before the words corresponding to the low-confidence labels, several words after the words corresponding to the low-confidence labels, and the words corresponding to the low-confidence labels. For example, the second preset window is set to 5.

[0041] Step 3.33: Concatenate the word vector, first part-of-speech tag vector, confidence score, and relative position index of each word in the words to be fused to obtain a fused feature vector, and concatenate all the fused feature vectors to obtain a fused feature vector sequence.

[0042] Specifically, the word vector and the first part-of-speech tag vector are the word vectors and the first part-of-speech tag vectors of the words in the words to be fused, respectively. The relative position index is the position index relative to the word corresponding to the low confidence tag. For example, the relative position index of the word corresponding to the low confidence tag is 0, the two words preceding the word corresponding to the low confidence tag are denoted as -1 and -2, respectively, and the two words preceding the word corresponding to the low confidence tag are denoted as +1 and +2, respectively. First, the word vector, the first part-of-speech tag vector, the confidence score, and the relative position index of each word in the words to be fused are concatenated. For example, for the word "can", its word vector is Vw("can"), its first part-of-speech tag vector is Vtag("MD"), its confidence score is 0.95, and its relative position index is -1. Then, the fusion feature vector of the word "can" is Fcan = [Vw("can");Vtag("MD"); 0.95; -1]. The fusion feature vectors corresponding to all words in the words to be fused are concatenated in order to obtain the fusion feature vector sequence.

[0043] Step 3.34: Input the fused feature vector sequence into the pre-trained neural network model to obtain the second part-of-speech tags of the words corresponding to the low-confidence tags.

[0044] Specifically, the fused feature vector sequence is input into a pre-trained neural network model. After processing by the pre-trained neural network model, the model outputs a probability distribution. The part-of-speech tag with the highest probability value in the probability distribution is selected as the final output, which is the second part-of-speech tag.

[0045] In an optional embodiment, the training method for the neural network model may include: constructing training samples, forward propagation and loss calculation, backpropagation and parameter optimization, and iterative validation. Constructing training samples: Sentences are extracted from a corpus (University of Pennsylvania Treebank), and a fused feature vector (word vector, part-of-speech tag vector, confidence score, relative position index) is constructed for each word to form an input sequence. The corresponding manually labeled parts of speech serve as supervision signals (true labels). Backpropagation and parameter optimization: The input sequence is fed into the neural network model. The model predicts a part-of-speech tag sequence, and the difference is calculated using the cross-entropy loss function by comparing the predicted sequence with the true label sequence. Backpropagation and parameter optimization: The loss value is backpropagated using the backpropagation algorithm to update the network weights, and the prediction error is continuously minimized using the gradient descent algorithm. Iterative validation: The above steps are repeated, and the performance is monitored on the validation set until the model accuracy converges. The final result is a pre-trained neural network model that can predict parts of speech based on contextual features.

[0046] Optionally, the neural network model is BiLSTM-CRF, a deep learning model that combines a bidirectional long short-term memory network (BiLSTM) and a conditional random field (CRF).

[0047] Step 3.35: Replace the corresponding first part-of-speech tag in the initial part-of-speech tagging sequence with the second part-of-speech tag to determine the final part-of-speech tag for each word.

[0048] Specifically, the first part-of-speech tag of the word corresponding to the low-confidence tag in the initial part-of-speech tagging sequence is replaced by the second part-of-speech tag obtained by the pre-trained neural network model. Thus, the first part-of-speech tag retained in the initial part-of-speech tagging sequence and the newly added second part-of-speech tag are used as the final part-of-speech tag of the corresponding word.

[0049] Step 3.36: Obtain the final part-of-speech tagging sequence based on the second tagging pair composed of each word and its final part-of-speech tag.

[0050] Specifically, each word in the initial part-of-speech tagging sequence and its final part-of-speech tag form a second tag pair, and all the second tag pairs corresponding to the words are arranged in order to form the final part-of-speech tagging sequence.

[0051] In this embodiment, NLTK's HMM annotation is computationally fast, enabling low-cost and high-speed processing of massive amounts of text. This allows for rapid initial screening of the entire text, quickly completing the annotation tasks for most simple and clear words. However, for more complex words, NLTK's HMM cannot accurately annotate them. Therefore, this embodiment uses a pre-trained neural network model to annotate the part-of-speech tags of words corresponding to low-confidence labels. The pre-trained neural network model introduces semantic information through word vectors. For rare words, new words, or privacy tokens, it can make analogical judgments based on semantically similar contexts. This significantly improves the final accuracy of part-of-speech tagging without significantly increasing the overall computational cost, achieving a balance between efficiency and accuracy.

[0052] Step 4: Obtain several first synonym sets based on the current word to be processed and its corresponding final part-of-speech tag in the final part-of-speech tag sequence. Obtain an initial candidate pool based on all first synonym sets. Determine the final word unit to be restored for the current word to be processed based on the related words obtained with the current word to be processed as the center in the final part-of-speech tag sequence and the initial candidate pool of the current word to be processed.

[0053] In one specific embodiment, step 4 may include: Step 4.1: Map the final part-of-speech tags of the words to be restored in the final part-of-speech tagging sequence to part-of-speech tags that WordNet can recognize, and obtain the mapped part-of-speech tags.

[0054] Here, the words that need to be restored are usually nouns, verbs, adjectives, and adverbs. WordNet can recognize part-of-speech tags as nouns (n), verbs (v), adjectives (a), and adverbs (r). For example, the final part-of-speech tag BG / VBD / VBZ is mapped to v, the final part-of-speech tag NNS / NN is mapped to n, the final part-of-speech tag JJ is mapped to a, and the final part-of-speech tag RB is mapped to r.

[0055] Step 4.2: Query WordNet to obtain a list of synonym sets including N first synonym sets for the words to be restored and whose parts of speech are mapped. The first synonym set includes several candidate lexical units that are synonyms.

[0056] Specifically, for the words that need to be restored in the final part-of-speech tagging sequence, the API functions provided by WordNet are used to query and obtain all possible synonyms corresponding to the word meanings of the word to be restored as lexical units and the part-of-speech tags after mapping. Each first synonym set contains a set of candidate lexical units of synonyms. All first synonym sets corresponding to each word to be restored constitute the synonym set list of the word to be restored.

[0057] Step 4.3: Traverse each first synonym set in the synonym set list, remove duplicate candidate word elements in each first synonym set, and obtain the second synonym set based on all non-duplicate candidate word elements in the first synonym set.

[0058] Specifically, for each first synonym set, candidate words with repeated occurrences are deleted, and all remaining candidate words in the first synonym set are used as the second synonym set. If the initial first synonym set has no repeated candidate words, the first synonym set is directly used as the second synonym set, and finally N second synonym sets are obtained.

[0059] Step 4.4: Taking the word that needs to be restored in the final part-of-speech tagging sequence as the center, take M related words in front of and behind the final part-of-speech tagging sequence.

[0060] Specifically, for the word that needs to be restored, take it as the center, and then take M related words that are before the word that needs to be restored and M related words that are after the word that needs to be restored from the final part-of-speech tagging sequence, for a total of 2M related words. For example, if M is 2, then a total of 4 words are taken.

[0061] Step 4.5: Determine the final word units to be restored for the words to be restored by using the maximum WUP similarity between the second set of synonyms of the words to be restored and the third set of synonyms of related words.

[0062] Step 4.51: Query WordNet to obtain the K third synonyms of the i-th related word, where 1≤i≤2M.

[0063] Specifically, for the i-th related word corresponding to the word that needs to be restored, the API function provided by WordNet is used to query and obtain all possible synonyms corresponding to the i-th related word as a word element. Each third synonym set contains a set of synonym words.

[0064] Step 4.52: Calculate the WUP (Wu-Palmer) similarity between the nth second synonym set corresponding to the word to be restored and the K third synonym sets of the i-th related word, and select the maximum value among the K WUP similarities as the final similarity between the nth second synonym set and the i-th related word, where 1≤n≤N.

[0065] Specifically, for the nth second synonym set corresponding to the word that needs to be restored in the current processing, the WUP similarity between the nth second synonym set and each third synonym set of the i-th related word is calculated using the Wu-Palmer similarity calculation formula, and a total of K WUP similarities are obtained. The maximum value among the K WUP similarities is selected as the final similarity between the nth second synonym set and the i-th related word. Step 4.53: Obtain the total score of the nth second synonym set based on the sum of the final similarities of the nth second synonym set and 2M related words.

[0066] Specifically, the 2M final similarity scores corresponding to the nth second synonym set are summed to obtain the total score of the nth second synonym set. This total score represents the probability that the word to be restored has the nth meaning. Thus, the total score of each second synonym set can be obtained, for a total of N total scores.

[0067] Step 4.54: Extract all candidate lexical units from all second synonym sets and remove duplicate candidate lexical units. Merge the remaining E candidate lexical units into a candidate pool.

[0068] Specifically, all candidate lexical units in the second thesaurus are selected, and duplicate candidate lexical units are removed. Then, the remaining E non-duplicate candidate lexical units are merged into a candidate pool.

[0069] Step 4.55: Find all second synonym sets in the candidate pool that contain the e-th candidate word element, and take the largest total score in all the second synonym sets as the final score of the e-th candidate word element, where 1≤e≤E.

[0070] Specifically, for the e-th candidate word in the candidate pool, first determine all the second synonym sets to which the e-th candidate word belongs, then determine the second synonym set with the largest total score from these second synonym sets, and take the largest total score as the final score of the e-th candidate word. There are a total of E candidate words in the candidate pool, so a total of E final scores are obtained for the candidate words.

[0071] Step 4.56: Determine the final word to be restored based on the maximum final score of the E candidate word units.

[0072] Specifically, the final scores of the E candidate word elements obtained in step 4.55 are compared, and the candidate word element with the largest final score is selected as the final word element of the word to be restored.

[0073] In addition, for function words (articles, prepositions, conjunctions, pronouns, etc.), punctuation marks, special characters (#, $, %, etc.), numbers, etc., the part-of-speech restoration in step 4 is not required.

[0074] In this embodiment, the candidate range for word reconstruction is first limited to all possible lexical units under its specific part of speech. Then, by calculating the final score of each candidate lexical unit associated with each word to be reconstructed, accurate inference of words in complex contexts is achieved. This embodiment makes full use of WordNet's hierarchical semantic knowledge, and aggregates local semantic matching evidence into global decision-making basis through maximization and summation strategies, effectively overcoming lexical ambiguity and significantly improving the accuracy and robustness of word form reconstruction in real language environments.

[0075] Step 5: Remove stop words and punctuation, and retain the final word units with the preset parts of speech as the core emotional vocabulary.

[0076] Specifically, the sequence after part-of-speech tagging in step 4 is obtained. This sequence includes the final word units and their final part-of-speech tags obtained in step 4, as well as the remaining functional words and their final part-of-speech tags in each sentence, and the punctuation marks and their final part-of-speech tags in each sentence. For example, the sequence is [(the, DT), (movie, NN), (be, VB), (absolutely, RB), (fantastic, JJ), (!, .)]. Stop words and punctuation are filtered out from this sequence. Stop words are common functional words that need to be filtered out. Specifically, a stop word list can be pre-established, and words belonging to the stop word list are removed. Stop words include, for example, articles, prepositions, conjunctions, pronouns, etc. Finally, the final word units with preset parts of speech are retained as the core emotional vocabulary. The preset parts of speech include, for example, nouns, verbs, adjectives, and adverbs.

[0077] This invention utilizes a sensitive information database for matching and generates a final token containing type labels. This not only conceals the original privacy-sensitive information but also maintains the syntactic structure and logical integrity of the text through the semantic type preserved in the token, providing a high-quality data foundation for subsequent analysis.

[0078] This invention introduces a low-confidence tag recognition method based on confidence and the construction of fused feature vectors. This method identifies unreliable labeled words by calculating confidence scores, and only for these unreliable labeled words, it fuses multi-dimensional features such as word vectors, part-of-speech vectors, confidence, and relative positions of their context words, and uses a lightweight neural network model for correction. This reduces computational costs while ensuring high overall accuracy of the part-of-speech tagging sequence.

[0079] This invention obtains a candidate pool by constructing a second synonym set and calculates the WUP similarity between it and a third synonym set of words related to the context. This invention calculates the overall semantic fit score of each candidate word with the entire context by taking the maximum value and summing, thereby selecting the final word that best fits the context, which greatly improves the accuracy of ambiguous word restoration.

[0080] Example 2 Please see Figure 2 , Figure 2 This is a schematic diagram of a text processing device for privacy protection provided in an embodiment of the present invention. The text processing device includes: The acquisition module is used to acquire the raw text to be processed; The sensitive information filtering module is used to identify the privacy-sensitive information in the original text to be processed, and to filter the privacy-sensitive information to obtain the filtered text. The part-of-speech tagging module is used to perform initial part-of-speech tagging on each word in the filtered text to obtain an initial part-of-speech tagging sequence. Based on the words to be fused according to the words corresponding to the low-confidence tags identified from the initial part-of-speech tagging sequence, a fusion feature vector is constructed to determine the final part-of-speech tagging sequence including each word and its final part-of-speech tag. The restoration module is used to obtain a second set of candidate word elements that do not repeat, based on the words to be restored in the final part-of-speech tagging sequence and the final part-of-speech tags corresponding to the words to be restored. Based on the second set of word elements and a third set of word elements of related words obtained with the words to be restored as the center, the module determines the final word element to be restored for the current word to be processed. The sentiment vocabulary generation module is used to remove stop words and punctuation, and retain the final word units with preset parts of speech as the core sentiment vocabulary.

[0081] Example 3 Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in this embodiment of the present invention. The electronic device includes: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; Memory, used to store computer programs; When a processor executes a computer program, it implements all or part of the steps in the text processing method described in Embodiment 1 above. The specific implementation principle and technical effect are similar, and will not be repeated here.

[0082] Example 3 The present invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements all or part of the steps of the above embodiment one. The specific implementation principle and technical effect are similar, and will not be repeated here.

[0083] The communication bus mentioned in the above-mentioned computer equipment can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc.

[0084] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0085] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0086] The computer device can be a desktop computer, a portable computer, a smart mobile terminal, a server, etc. No limitation is made herein; any electronic device that can implement this invention falls within the protection scope of this invention.

[0087] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. In addition, those skilled in the art can combine and integrate the different embodiments or examples described in this specification.

[0088] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects, all of which are collectively referred to herein as "modules" or "systems." Furthermore, this application can take the form of a computer program product 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. The computer program may be stored / distributed in a suitable medium, provided with or as part of other hardware, or may take other forms of distribution, such as via the Internet or other wired or wireless telecommunications systems.

[0089] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and 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 apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0090] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function 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.

[0091] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable 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.

[0092] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.

Claims

1. A text processing method for privacy protection, characterized in that, include: Obtain the raw text to be processed; Identify the privacy-sensitive information in the original text to be processed, and filter the privacy-sensitive information to obtain the filtered text; Each word in the filtered text is initially part-of-speech tagging to obtain an initial part-of-speech tagging sequence. A fusion feature vector is constructed based on the words to be fused according to the words corresponding to the low-confidence tags identified from the initial part-of-speech tagging sequence, so as to determine the final part-of-speech tagging sequence including each word and its final part-of-speech tag. Based on the words to be restored in the final part-of-speech tagging sequence and the final part-of-speech tags corresponding to the words to be restored, a second set of synonyms including non-repeating candidate word elements is obtained, and based on the second set of synonyms and a third set of related words obtained with the words to be restored as the center, the final word element to be restored for the current word to be processed is determined. Remove stop words and punctuation, and retain the final word units with preset parts of speech as the core vocabulary of emotion.

2. The text processing method according to claim 1, characterized in that, Identify privacy-sensitive information in the original text to be processed, and filter the privacy-sensitive information to obtain filtered text, including: The original text to be processed is matched using a sensitive information database to obtain the privacy-sensitive information, wherein the sensitive information database includes regular expressions for identifying privacy-sensitive information; The privacy-sensitive information is replaced with a final token including a type label to obtain the filtered text.

3. The text processing method according to claim 2, characterized in that, The privacy-sensitive information is replaced with a final token including a type label to obtain the filtered text, which includes: Based on the cryptographic hash function, and according to the privacy-sensitive information and random salt, the hash result is obtained; The final token for the privacy-sensitive information is obtained based on the type label of the privacy-sensitive information and the hash result; The privacy-sensitive information in the original text to be processed is replaced with the final token to obtain the filtered text.

4. The text processing method according to claim 1, characterized in that, Each word in the filtered text is initially part-of-speech tagging (POS) to obtain an initial POS tag sequence. A fusion feature vector is constructed based on the words to be fused according to the words corresponding to low-confidence tags identified from the initial POS tag sequence, to determine the final POS tag sequence including each word and its final POS tag, including: The filtered text is divided into several independent sentences, and each sentence is further divided into several independent words to form a word sequence corresponding to each sentence; Using NLTK to perform initial part-of-speech tagging on each word in the word sequence, an initial part-of-speech tagging sequence for each sentence is obtained. The initial part-of-speech tagging sequence includes several first tag pairs, each of which includes a word and its corresponding first part-of-speech tag. Calculate the confidence score of each first part-of-speech tag in the initial part-of-speech tagging sequence and identify low-confidence tags. Construct a fusion feature vector based on the words to be fused according to the words corresponding to the low-confidence tags. Obtain the final part-of-speech tagging sequence based on the final part-of-speech tags of the words corresponding to the low-confidence tags obtained from the fusion feature vector.

5. The text processing method according to claim 4, characterized in that, Calculate the confidence score of each first part-of-speech tag in the initial part-of-speech tagging sequence and identify low-confidence tags. Construct a fusion feature vector based on the words to be fused corresponding to the low-confidence tags. Obtain the final part-of-speech tagging sequence based on the final part-of-speech tags of the words corresponding to the low-confidence tags obtained from the fusion feature vector, including: The confidence score of each first part-of-speech tag in the initial part-of-speech tagging sequence is generated based on the forward and backward probability calculation method, and the first part-of-speech tag corresponding to the confidence score that is less than the confidence threshold is recorded as a low confidence tag; Using the words corresponding to the low confidence labels as the center, extract the words to be merged that are within the second preset window from the word sequence; The word vector, first part-of-speech tag vector, confidence score, and relative position index of each word in the words to be fused are concatenated to obtain a fusion feature vector, and all the fusion feature vectors are concatenated to obtain a fusion feature vector sequence; The fused feature vector sequence is input into a pre-trained neural network model to obtain the second part-of-speech tag of the word corresponding to the low confidence tag; The first part-of-speech tag in the initial part-of-speech tagging sequence is replaced with the second part-of-speech tag to determine the final part-of-speech tag for each word; The final part-of-speech tagging sequence is obtained based on a second tagging pair consisting of each of the words and the final part-of-speech tagging of each of the words.

6. The text processing method according to claim 1, characterized in that, Based on the words to be restored in the final part-of-speech tagging sequence and the corresponding final part-of-speech tags of the words to be restored, a second set of synonyms including non-repeating candidate lexical units is obtained. Then, based on the second set of synonyms and a third set of synonyms containing related words centered on the words to be restored, the final lexical unit to be restored for the current word to be processed is determined, including: The final part-of-speech tags of the words to be restored in the final part-of-speech tagging sequence are mapped to part-of-speech tags that can be recognized by WordNet, thus obtaining the mapped part-of-speech tags; Query WordNet to obtain a list of synonym sets including N first synonym sets, where the part of speech of the word to be restored is the mapped part of speech label. The first synonym set includes several candidate word elements with the same meaning. Iterate through each of the first synonym sets in the synonym set list, remove duplicate candidate word elements in each of the first synonym sets, and obtain the second synonym set based on all non-duplicate candidate word elements in the first synonym set; Centering on the words that need to be restored in the final part-of-speech tagging sequence, take M related words before and after the final part-of-speech tagging sequence; Based on the maximum WUP similarity between the second set of synonyms of the word to be restored and the third set of synonyms of the related words, the final word unit of the word to be restored is determined.

7. The text processing method according to claim 1, characterized in that, Based on the maximum WUP similarity between the second synonym set of the word to be restored and the third synonym set of the related words, the final word units to be restored for the word to be restored are determined, including: Query WordNet to obtain the K third synonyms of the i-th related word, where 1≤i≤2M; Calculate the WUP similarity between the nth second synonym set corresponding to the word to be restored and the K third synonym sets of the i-th related word, and select the maximum value among the K WUP similarities as the final similarity between the nth second synonym set and the i-th related word, where 1≤n≤N; The total score of the nth second synonym set is obtained by summing the final similarities of the nth second synonym set and the 2M related words. Extract all candidate lexical units from the second synonym set and remove duplicate candidate lexical units, then merge the remaining E candidate lexical units into a candidate pool; Find all second synonym sets in the candidate pool that contain the e-th candidate word element, and take the largest total score in all the second synonym sets as the final score of the e-th candidate word element, where 1≤e≤E; The final word to be restored is determined based on the maximum value of the final scores of the E candidate word elements.

8. A text processing device for privacy protection, characterized in that, include: The acquisition module is used to acquire the raw text to be processed; A sensitive information filtering module is used to identify the privacy-sensitive information in the original text to be processed, and to filter the privacy-sensitive information to obtain the filtered text. The part-of-speech tagging module is used to perform initial part-of-speech tagging on each word in the filtered text to obtain an initial part-of-speech tagging sequence, and to construct a fusion feature vector based on the words to be fused according to the words corresponding to the low confidence tags identified from the initial part-of-speech tagging sequence, so as to determine the final part-of-speech tagging sequence including each word and its final part-of-speech tag. The restoration module is used to obtain a second set of synonyms including non-repeating candidate words based on the words to be restored in the final part-of-speech tagging sequence and the final part-of-speech tags corresponding to the words to be restored, and to determine the final word to be restored for the current word to be processed based on the second set of synonyms and a third set of synonyms of related words obtained with the words to be restored as the center; The sentiment vocabulary generation module is used to remove stop words and punctuation, and retain the final word units with preset parts of speech as the core sentiment vocabulary.

9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, configured to execute the computer program, implement the text processing method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the text processing method according to any one of claims 1-7.