Communication text anonymization method and system based on NLP

Through deep semantic analysis and multiple matching mechanisms based on NLP, the problem of lack of semantic understanding in communication text anonymization methods in the existing technology is solved, high-precision and flexible anonymization processing is achieved, and privacy protection and information accuracy are ensured.

CN118364512BActive Publication Date: 2024-08-23CHENGDU LECHAOREN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410781821.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2024-08-23
Estimated Expiration
2044-06-18

AI Technical Summary

Technical Problem

Existing communication text anonymization methods lack an in-depth understanding of semantics, resulting in ambiguous and difficult-to-understand text after anonymization, and the inability to flexibly adjust anonymity strategies, resulting in unsatisfactory anonymity effects.

Method used

Using deep semantic analysis and multiple matching mechanisms based on NLP, the target anonymization rules are determined and high-precision anonymization processing is achieved by generating key semantic vector sequences and matching them with the preset anonymization rule library and anonymization rule text library.

Benefits of technology

It ensures the accuracy and readability of anonymization processing, adapts to the contextual characteristics of specific communication texts, improves the flexibility and applicability of anonymization processing, effectively protects the privacy of communication content, and ensures the accuracy and accuracy of information transmission. Fluency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118364512B
    Figure CN118364512B
Patent Text Reader

Abstract

The present application provides a communication text anonymization method and system based on NLP, which generates an accurate first key semantic vector sequence by performing deep semantic analysis on the original communication text, not only matching according to the preset anonymization rule library to find the first reference anonymization rule that is closest to the semantics of the original communication text, but also further matching with the anonymization rule text library corresponding to each anonymization rule to determine the second reference anonymization rule. This dual matching mechanism significantly improves the selection accuracy of the anonymization rule, making the final anonymization processing more in line with the actual semantics of the original communication text. In addition, by comprehensively considering the first reference anonymization rule and the second reference anonymization rule, the final target anonymization rule is determined, so that the anonymization processing can not only meet the preset anonymization rule requirements, but also adapt to the contextual characteristics of the specific communication text, greatly improving the flexibility and applicability of the anonymization processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and in particular to a method and system for anonymizing communication texts based on NLP. Background Art

[0002] With the rapid development of information technology and the advent of the big data era, the security and privacy protection issues of communication texts have become increasingly prominent. In daily life and work, people exchange information through various communication tools. These communications often contain a large amount of personal privacy information. If they are not properly anonymized, this information may be maliciously used, resulting in personal privacy leakage. Therefore, it is particularly important to develop an effective communication text anonymization method.

[0003] Traditional anonymization methods are mostly achieved through simple text replacement or obfuscation. Although this method can protect privacy to a certain extent, due to the lack of in-depth understanding of the semantics of the communication text, it often makes the meaning of the anonymized text vague and difficult to understand, and even changes the true intention of the original text. In addition, traditional anonymization methods are usually unable to flexibly adjust the anonymization strategy according to the specific content of the communication text, making the anonymization effect unsatisfactory. Summary of the invention

[0004] In view of this, the purpose of this application is to provide a communication text anonymization method and system based on NLP, which aims to achieve high-precision anonymization processing of communication text through deep semantic analysis and multiple matching mechanisms, thereby protecting personal privacy and ensuring the accuracy and readability of communication text.

[0005] According to a first aspect of the present application, a communication text anonymization method based on NLP is provided, the method comprising:

[0006] Performing semantic analysis on the original communication text to generate a first key semantic vector sequence of the original communication text;

[0007] Determine a first matching degree between the first key semantic vector sequence and the anonymous semantic vector sequence of each anonymization rule of a preset anonymization rule library, and determine a first reference anonymization rule corresponding to the original communication text based on each first matching degree;

[0008] Determining a second matching degree between the first key semantic vector sequence and a second key semantic vector sequence of each anonymization rule text library corresponding to each of the anonymization rules, and determining a second reference anonymization rule corresponding to the original communication text according to each of the second matching degrees;

[0009] According to the first reference anonymization rule and the second reference anonymization rule, a target anonymization rule corresponding to the original communication text is determined, and the original communication text is anonymized according to the target anonymization rule.

[0010] In a possible implementation of the first aspect, before determining a first matching degree between the first key semantic vector sequence and an anonymous semantic vector sequence of each anonymization rule of a preset anonymization rule library, the method further includes:

[0011] Traversing each of the anonymization rules, acquiring one or more target anonymization rule text libraries corresponding to the anonymization rule, and performing semantic analysis on each of the target anonymization rule text libraries to generate each target second key semantic vector sequence of the anonymization rule;

[0012] Performing feature interaction on one or more target second key semantic vector sequences of the anonymization rule to generate a third key semantic vector sequence of the anonymization rule;

[0013] Using the third key semantic vector sequence of the anonymization rule as the anonymous semantic vector sequence of the anonymization rule;

[0014] In a possible implementation of the first aspect, the step of performing feature interaction on one or more target second key semantic vector sequences of the anonymization rule to generate a third key semantic vector sequence of the anonymization rule includes:

[0015] Traversing each anonymization rule, obtaining one or more target anonymization rule text libraries corresponding to the anonymization rule, performing semantic analysis on each target anonymization rule text library, and generating a sequence of target second key semantic vectors of each anonymization rule;

[0016] For each target second key semantic vector sequence, extract key features of the target second key semantic vector sequence, wherein the key features include at least one of a vocabulary feature, a phrase feature, a syntactic structure feature, or a semantic role feature;

[0017] The key features are fused into a target vector representation by a feature fusion algorithm, wherein the target vector representation is used to capture the common information and difference information in the second key semantic vector sequence of each target;

[0018] Learning the relationship between different target second key semantic vector sequences according to the target vector representation to identify significant related features in different target second key semantic vector sequences and generate an initial third key semantic vector sequence that incorporates information of multiple target second key semantic vector sequences;

[0019] Fine-tuning the initial third key semantic vector sequence based on a gradient descent optimization algorithm to ensure that it can more accurately capture the semantic information of the original anonymization rule, and using the optimized third key semantic vector sequence as the final third key semantic vector sequence of the anonymization rule;

[0020] In a possible implementation of the first aspect, the step of learning the relationship between different target second key semantic vector sequences according to the target vector representation to identify significant related features in different target second key semantic vector sequences and generating an initial third key semantic vector sequence that integrates information of multiple target second key semantic vector sequences includes:

[0021] For all target vector representations, calculate the Pearson correlation coefficients between the target vector representations, and construct a corresponding correlation matrix based on the Pearson correlation coefficients between the target vector representations, wherein each element in the correlation matrix represents the correlation between two corresponding target vector representations;

[0022] Analyzing the mutual relationship matrix to determine a target vector representation pair having a preset correlation;

[0023] For each target vector representation pair, identifying significant correlation features between different target vector representations in the target vector representation pair based on a mutual information algorithm, wherein the significant correlation features represent lexical features, phrase features, or specified semantic pattern features that appear significantly in the target vector representation pair;

[0024] An empty vector sequence is created as the basis of the initial third key semantic vector sequence, all the identified significance-related features are traversed, the significance-related features are sorted according to the corresponding importance scores, and the sorted significance-related features are added one by one to the initial third key semantic vector sequence, wherein, when adding each significance-related feature, a preset weighting mechanism is used so that the significance-related features with higher importance scores have greater influence weights in the final third key semantic vector sequence.

[0025] In a possible implementation manner of the first aspect, determining, based on each of the first matching degrees, a first reference anonymization rule corresponding to the original communication text includes:

[0026] Selecting an anonymization rule having a first matching degree greater than a preset matching degree from the anonymization rules as a first reference anonymization rule corresponding to the original communication text;

[0027] Alternatively, each of the anonymization rules is arranged in descending order according to each of the first matching degrees, and the first N anonymization rules in the arrangement result are selected as the first reference anonymization rules corresponding to the original communication text, where N is a positive integer greater than 1.

[0028] In a possible implementation manner of the first aspect, determining the second reference anonymization rule corresponding to the original communication text according to each second matching degree includes:

[0029] Arranging each of the anonymization rule text libraries in descending order according to each of the second matching degrees;

[0030] Determine, from the anonymization rule text libraries, a target anonymization rule text library having a second matching degree greater than a preset matching degree;

[0031] The anonymization rule corresponding to the target anonymization rule text library is used as the second reference anonymization rule corresponding to the original communication text.

[0032] In a possible implementation of the first aspect, the first reference anonymization rules include at least two, and the second reference anonymization rules include at least two; determining the target anonymization rule corresponding to the original communication text according to the first reference anonymization rule and the second reference anonymization rule includes:

[0033] Traversing each of the second reference anonymization rules to determine whether the second reference anonymization rule exists in a plurality of the first reference anonymization rules, and when the second reference anonymization rule exists in a plurality of the first reference anonymization rules, using the second reference anonymization rule as a third reference anonymization rule;

[0034] If the number of the third reference anonymization rule is one, determining the third reference anonymization rule as the target anonymization rule corresponding to the original communication text;

[0035] If the third reference anonymization rule includes at least two, traverse each of the third reference anonymization rules, and select one or more target second matching degrees reflecting that the original communication text corresponds to the third reference anonymization rule from each of the second matching degrees;

[0036] Arrange the one or more target second matching degrees in descending order, and select the first M target matching degrees from the one or more target second matching degrees, where M is a positive integer greater than 0;

[0037] The M target matching degrees are averaged to generate a reference matching degree of the third reference anonymization rule, and the reference matching degree is used as the confidence of the original communication text corresponding to the third reference anonymization rule, and the third reference anonymization rule corresponding to the maximum confidence is used as the target anonymization rule corresponding to the original communication text.

[0038] In a possible implementation of the first aspect, before selecting the first M target matching degrees, the method further includes:

[0039] Each of the third reference anonymization rules is traversed to obtain the number of the original communication texts corresponding to the third reference anonymization rules determined according to each of the second matching degrees, and the minimum number among the numbers corresponding to each of the third reference anonymization rules is used as M.

[0040] In a possible implementation of the first aspect, determining the confidence level of the original communication text corresponding to each of the third reference anonymization rules includes:

[0041] Traversing each of the third reference anonymization rules, and selecting, from each of the second matching degrees, one or more target second matching degrees reflecting that the original communication text corresponds to the third reference anonymization rule;

[0042] An average matching degree of the one or more target second matching degrees is determined, and the average matching degree is used as the confidence degree of the original communication text corresponding to each of the third reference anonymization rules.

[0043] In a possible implementation of the first aspect, determining the confidence level of the original communication text corresponding to each of the third reference anonymization rules includes:

[0044] Traversing each of the third reference anonymization rules, and obtaining the number of the original communication texts corresponding to the third reference anonymization rules determined according to each of the second matching degrees;

[0045] Acquire association information between the quantity and the confidence level;

[0046] The confidence level of the original communication text corresponding to each of the third reference anonymization rules is determined according to the number corresponding to each of the third reference anonymization rules and the associated information.

[0047] In a possible implementation manner of the first aspect, before performing semantic analysis on the original communication text to generate a first key semantic vector sequence of the original communication text, the method further includes:

[0048] Acquire one or more anonymization rule text libraries corresponding to each of the anonymization rules, and extract a second key semantic vector sequence of each of the anonymization rule text libraries;

[0049] Traversing each of the anonymization rules, generating a first anonymization rule information base by configuring the anonymization rules and the anonymous semantic vector sequences of the anonymization rules in a correlation manner, wherein the anonymous semantic vector sequence is a fused semantic vector sequence of the second key semantic vector sequence of one or more anonymization rule text bases corresponding to the anonymization rules;

[0050] Each of the anonymization rule text libraries is traversed, and a second anonymization rule information library is generated by configuring the anonymization rule text library, the second key semantic vector sequence of the anonymization rule text library, and the anonymization rules corresponding to the anonymization rule text library in a correlation manner.

[0051] According to the second aspect of the present application, a communication text anonymization system based on NLP is provided, wherein the communication text anonymization system based on NLP includes a machine-readable storage medium and a processor, wherein the machine-readable storage medium stores machine-executable instructions, and when the processor executes the machine-executable instructions, the communication text anonymization system based on NLP implements the aforementioned communication text anonymization method based on NLP.

[0052] According to a third aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed, the aforementioned NLP-based communication text anonymization method is implemented.

[0053] According to any one of the above aspects, the technical effect of the present application is:

[0054] By performing deep semantic analysis on the original communication text, an accurate first key semantic vector sequence is generated, thereby ensuring the accuracy of the subsequent matching process. Not only is the matching performed according to the preset anonymization rule library to find the first reference anonymization rule that is closest to the semantics of the original communication text, but it is also further matched with the anonymization rule text library corresponding to each anonymization rule to determine the second reference anonymization rule. This dual matching mechanism significantly improves the selection accuracy of the anonymization rule, making the final anonymization processing more in line with the actual semantics of the original communication text. In addition, by comprehensively considering the first reference anonymization rule and the second reference anonymization rule, the final target anonymization rule is determined, so that the anonymization processing can not only meet the preset anonymization rule requirements, but also adapt to the contextual characteristics of the specific communication text, greatly improving the flexibility and applicability of the anonymization processing. Therefore, through deep semantic analysis and dual matching mechanism, high-precision and flexible anonymization processing of the communication text is achieved, effectively protecting the privacy of the communication content, while ensuring the accuracy and fluency of information transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0056] Figure 1 A flowchart of the NLP-based communication text anonymization method provided in an embodiment of the present application.

[0057] Figure 2 A schematic diagram of the component structure of an NLP-based communication text anonymization system provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical scheme and advantages of the embodiment of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below according to the drawings in the embodiment of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description, and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the embodiment of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add multiple other operations to the flowchart under the guidance of the content of the present application, and can also destroy multiple operations from the flowchart.

[0059] Figure 1 The flowchart of the NLP-based communication text anonymization method and system provided in the embodiment of the present application is shown. It should be understood that in other embodiments, the order of some steps in the NLP-based communication text anonymization method of this embodiment can be shared with each other according to actual needs, or some steps can be omitted or maintained. The detailed steps of the NLP-based communication text anonymization method include:

[0060] Step S110, performing semantic analysis on the original communication text to generate a first key semantic vector sequence of the original communication text.

[0061] In detail, the original communication text may refer to the original communication content that has not been processed or modified, and usually exists in the form of text.

[0062] The first key semantic vector sequence is to convert the original communication text into a series of numerical vectors through a certain algorithm (such as Word2Vec, BERT, etc.), and these numerical vectors can represent the main semantics of the text.

[0063] That is, in this embodiment, the NLP-based communication text anonymization system acts as a server. After receiving a piece of original communication text, it first uses natural language processing technology to perform semantic analysis on this piece of original communication text. Through a deep learning model, such as a word embedding model or a Transformer model, each word in the original communication text is converted into a key semantic vector representation. These key semantic vectors capture the semantic information of the word and the contextual relationship of the word in the text. The server combines these key semantic vectors in the order of the text to form a first key semantic vector sequence, which represents the overall semantics of the original communication text.

[0064] Step S120, determining a first matching degree between the first key semantic vector sequence and the anonymous semantic vector sequence of each anonymization rule in a preset anonymization rule library, and determining a first reference anonymization rule corresponding to the original communication text based on each first matching degree.

[0065] In detail, the preset anonymization rule base is a pre-set rule set, which includes a variety of rules and methods for anonymizing text. For example, the anonymization rule base may include a series of regular expressions, replacement rules or more complex logic for identifying and replacing sensitive information in the text.

[0066] Similar to the key semantic vector, the anonymous semantic vector sequence is generated based on the rules in the anonymization rule base and is used to match the semantic vector of the original text.

[0067] That is, in this embodiment, the server will then compare the first key semantic vector sequence with the anonymous semantic vector sequences of each anonymization rule pre-stored in the anonymization rule library, where these anonymization rules are previously defined and used to guide how to anonymize different types of communication texts. Each anonymization rule has an associated anonymous semantic vector sequence, which reflects the typical semantic features of the communication text type targeted by the anonymization rule.

[0068] The server determines the degree of match between the first key semantic vector sequence and the anonymous semantic vector sequence of each anonymization rule by calculating the similarity (such as cosine similarity) between them. This similarity is the first match. Based on the first match, the server selects the anonymization rule that is closest to the semantics of the original communication text as the first reference anonymization rule. For example, if the original communication text is about meeting arrangements, the anonymization rule that best matches it may be the anonymization rule about meeting information.

[0069] Step S130, determining a second matching degree between the first key semantic vector sequence and a second key semantic vector sequence of each anonymization rule text library corresponding to each anonymization rule, and determining a second reference anonymization rule corresponding to the original communication text based on each second matching degree.

[0070] In detail, the second key semantic vector sequence refers to the semantic vector sequence corresponding to each rule in the anonymized rule text library. Similar to the first key semantic vector sequence, these vectors are key semantic information extracted from the anonymized rule text by natural language processing technology and converted into numerical vectors.

[0071] The second reference anonymization rule is an anonymization rule that best matches the original communication text and is selected from the anonymization rule text library based only on the calculation result of the second matching degree. The second reference anonymization rule may be the same as or different from the first reference anonymization rule, depending on which rule is closer to the semantics of the original text.

[0072] That is, after determining the first reference anonymization rule, the server will further analyze the degree of match between the original communication text and the anonymization rule text library corresponding to these rules. Each anonymization rule will have one or more anonymization rule text libraries associated with it, and these anonymization rule text libraries contain various types of communication text instances that can be processed by the anonymization rule.

[0073] The server performs semantic analysis on each anonymization rule text library to generate a second key semantic vector sequence. Then, the server calculates the similarity between the first key semantic vector sequence of the original communication text and these second key semantic vector sequences to obtain a second matching degree, which reflects the similarity between the original communication text and the text in each anonymization rule text library.

[0074] According to the second matching degree, the server selects the anonymization rule corresponding to the anonymization rule text library that is most similar to the original communication text as the second reference anonymization rule. These second reference anonymization rules provide more specific guidance on how to anonymize the original communication text.

[0075] Step S140: determining a target anonymization rule corresponding to the original communication text according to the first reference anonymization rule and the second reference anonymization rule, and performing anonymization processing on the original communication text according to the target anonymization rule.

[0076] In detail, the target anonymization rule refers to the finalized rule for anonymizing the original communication text, and the target anonymization rule may be derived based on the comprehensive consideration of the first reference anonymization rule and the second reference anonymization rule. For example, if the first reference anonymization rule and the second reference anonymization rule both replace specific information with general information, then the target anonymization rule may be a combination of the two rules, aiming to protect the privacy information in the original communication text to the greatest extent.

[0077] Anonymization is the process of modifying the original communication text according to the target anonymization rules, with the aim of hiding or obscuring sensitive or private information in the text.

[0078] That is, in this embodiment, finally, the server will combine the first reference anonymization rule and the second reference anonymization rule to determine the target anonymization rule for processing the original communication text. If the first reference anonymization rule and the second reference anonymization rule point to the same anonymization rule, then this anonymization rule will be selected as the target anonymization rule.

[0079] If the two refer to different anonymization rules, the server can make a choice based on the priority of the anonymization rule, the degree of matching, or other decision logic. Once the target anonymization rule is determined, the server will anonymize the original communication text according to this target anonymization rule. For example, if the target anonymization rule requires that all names be replaced with "XXX", then the server will replace all names in the original communication text with "XXX" to achieve the purpose of anonymization.

[0080] Based on the above steps, by performing deep semantic analysis on the original communication text, an accurate first key semantic vector sequence is generated, thereby ensuring the accuracy of the subsequent matching process. Not only is the matching performed according to the preset anonymization rule library to find the first reference anonymization rule that is closest to the semantics of the original communication text, but it is also further matched with the anonymization rule text library corresponding to each anonymization rule to determine the second reference anonymization rule. This dual matching mechanism significantly improves the selection accuracy of the anonymization rule, making the final anonymization processing more in line with the actual semantics of the original communication text. In addition, by comprehensively considering the first reference anonymization rule and the second reference anonymization rule, the final target anonymization rule is determined, so that the anonymization processing can not only meet the preset anonymization rule requirements, but also adapt to the contextual characteristics of the specific communication text, greatly improving the flexibility and applicability of the anonymization processing. Therefore, through deep semantic analysis and dual matching mechanism, high-precision and flexible anonymization processing of the communication text is achieved, effectively protecting the privacy of the communication content, while ensuring the accuracy and fluency of information transmission.

[0081] In a possible implementation, before step S120, the method further includes:

[0082] Step A110, traverse each of the anonymization rules, obtain one or more target anonymization rule text libraries corresponding to the anonymization rule, and perform semantic analysis on each of the target anonymization rule text libraries to generate each target second key semantic vector sequence of the anonymization rule.

[0083] Step A120: performing feature interaction on one or more target second key semantic vector sequences of the anonymization rule to generate a third key semantic vector sequence of the anonymization rule.

[0084] Step A130: Using the third key semantic vector sequence of the anonymization rule as the anonymous semantic vector sequence of the anonymization rule.

[0085] In this embodiment, the server starts to execute the traversal task and processes each anonymization rule in a preset anonymization rule library. The anonymization rule library is pre-stored in the server and contains a variety of rules for text anonymization.

[0086] For example, the server has an anonymization rule library containing dozens of rules. The server starts to process these rules one by one, and first selects Rule A, which is designed to replace the specific name of a person in the text with "someone".

[0087] For the anonymization rule currently being processed (such as rule A), the server obtains one or more target anonymization rule text libraries associated with the rule. These text libraries usually contain text samples or templates that can be processed by the rule.

[0088] For example, for rule A, the server obtains a target anonymization rule text library, which contains multiple text samples containing people's names, such as "Zhang San went to the supermarket yesterday", "Li Si reads a book in the library", etc.

[0089] Next, the server uses natural language processing technology to perform semantic analysis on the text in each target anonymization rule text library, and converts the semantic information of these texts into numerical vectors, namely the target second key semantic vector sequence.

[0090] For example, the server performs semantic analysis on each text sample in the target anonymization rule text library. For example, for the text "Zhang San went to the supermarket yesterday", the server extracts its key semantic information and converts it into a numerical vector sequence that can represent the semantics of the text. Similarly, the same processing is performed on other texts in the text library.

[0091] The server performs feature interaction on the target second key semantic vector sequence generated in the previous step, which usually means that the server considers the relationship or combination between these vectors to extract more complex semantic features.

[0092] The server performs feature interaction on the target second key semantic vector sequence. For example, it can compare the similarities between different text vectors, or combine or fuse these vectors in some form to extract more advanced semantic features. The results of these feature interactions will help to more accurately understand and apply anonymization rules.

[0093] Based on the results of feature interaction, the server generates a new semantic vector sequence, namely the third key semantic vector sequence, which more comprehensively reflects the semantic features of the anonymization rule.

[0094] For example, after feature interaction, the server generates a new third key semantic vector sequence, which not only contains the semantic information of a single text, but also incorporates the relationship between texts and complex semantic features. This sequence will serve as a higher-level semantic representation of rule A.

[0095] Finally, the server determines the third key semantic vector sequence as the anonymous semantic vector sequence of the anonymization rule, and the sequence will be used for subsequent matching degree calculation and anonymization processing.

[0096] For example, the server saves the third key semantic vector sequence of rule A as its anonymous semantic vector sequence. When the original communication text needs to be anonymized later, this sequence will be used to calculate the matching degree with the semantic vector of the original text to determine whether to apply rule A for anonymization.

[0097] In a possible implementation, step A120 includes:

[0098] Step A121, traverse each anonymization rule, obtain one or more target anonymization rule text libraries corresponding to the anonymization rule, perform semantic analysis on each target anonymization rule text library, and generate each target second key semantic vector sequence of the anonymization rule.

[0099] In this embodiment, the server starts to process the rules in the preset anonymization rule library one by one. For each rule, it will find the target anonymization rule text library associated with it, which contains the text samples to which the rule is applied. Then, the server uses natural language processing technology to perform semantic analysis on these texts and convert them into target second key semantic vector sequences.

[0100] For example, the server is processing an anonymization rule that aims to replace sensitive data in a text with a universal placeholder. The server first obtains a text library related to the anonymization rule, which contains multiple text samples containing sensitive data. Then, a semantic analysis is performed on each text to generate a corresponding target second key semantic vector sequence.

[0101] Step A122: for each target second key semantic vector sequence, extract key features of the target second key semantic vector sequence, wherein the key features include at least one of vocabulary features, phrase features, syntactic structure features or semantic role features.

[0102] In this embodiment, the server further analyzes each target second key semantic vector sequence and extracts key features therein, such as vocabulary, phrases, syntactic structures or semantic roles, etc. These features help to more deeply understand the semantic content of the text.

[0103] For example, for the previously generated target second key semantic vector sequence, the server begins to extract key features. For example, in a certain text, the server identifies the key vocabulary feature "credit card number" and the phrase feature "1234-5678-9012-3456", which are crucial for the subsequent anonymization process.

[0104] Step A123, fusion of the key features into a target vector representation through a feature fusion algorithm, wherein the target vector representation is used to capture the common information and difference information in each target second key semantic vector sequence.

[0105] In this embodiment, the server uses a feature fusion algorithm to fuse the extracted key features into a new vector representation, which not only captures the common information in each text sequence, but also retains the difference information between them.

[0106] For example, the server fuses the previously extracted key features into a target vector representation that contains both the common semantic information among the texts and the unique differences between them.

[0107] Step A124, learning the relationship between different target second key semantic vector sequences based on the target vector representation to identify significant related features in different target second key semantic vector sequences, and generating an initial third key semantic vector sequence that integrates information of multiple target second key semantic vector sequences.

[0108] In this embodiment, the server uses the target vector representation to learn the relationships between different text sequences, especially to identify the features that are significantly related in different text sequences. Based on these relationships, the server generates an initial third key semantic vector sequence.

[0109] For example, by analyzing the target vector representation, the server finds that certain features appear significantly in different texts, such as the feature of "credit card number". Based on these significantly related features, the server constructs an initial third key semantic vector sequence, which can more comprehensively reflect the semantics of the anonymization rule.

[0110] Step A125, fine-tuning the initial third key semantic vector sequence based on a gradient descent optimization algorithm to ensure that it can more accurately capture the semantic information of the original anonymization rule, and using the optimized third key semantic vector sequence as the final third key semantic vector sequence of the anonymization rule.

[0111] In order to ensure that the third key semantic vector sequence can more accurately capture the semantic information of the original anonymization rule, the server uses a gradient descent-based optimization algorithm to fine-tune the initial sequence. After optimization, the server obtains the final third key semantic vector sequence.

[0112] For example, the server uses an efficient gradient descent algorithm to fine-tune the initial third key semantic vector sequence. Through multiple iterations and optimizations, the server finally obtains a vector sequence that can more accurately reflect the semantics of the anonymization rule. This final third key semantic vector sequence will be used in subsequent matching degree calculations and anonymization processing.

[0113] In a possible implementation, step A124 may include:

[0114] Step A1241, for all target vector representations, calculate the Pearson correlation coefficient between each of the target vector representations, and construct a corresponding correlation matrix based on the Pearson correlation coefficient between each of the target vector representations, wherein each element in the correlation matrix represents the correlation between the corresponding two target vector representations.

[0115] In this embodiment, the server first obtains all target vector representations, which are extracted from each target anonymization rule text library and obtained through feature fusion. Then, the server starts to calculate the Pearson correlation coefficient between these target vector representations, which is an indicator of the closeness of the linear relationship between two variables. The server uses these correlation coefficients to construct a correlation matrix, in which each element represents the correlation between two target vector representations.

[0116] For example. Assuming that the server has obtained five target vector representations (V1, V2, V3, V4, V5), it starts to calculate the Pearson correlation coefficients between these vectors. For example, the correlation coefficient between V1 and V2 is 0.8, indicating that there is a strong positive correlation between them; while the correlation coefficient between V1 and V3 is 0.2, indicating that the correlation between them is weak. The server fills these correlation coefficients into the mutual relationship matrix to form a 5x5 matrix for subsequent analysis.

[0117] Step A1242, analyzing the mutual relationship matrix to determine a target vector representation pair having a preset correlation.

[0118] In this embodiment, the server then analyzes the mutual relationship matrix constructed in the previous step to find out the target vector representation pairs whose correlation coefficients exceed a preset threshold. These vector pairs are considered to be highly correlated and may contain important common information or features.

[0119] For example, the server sets a threshold, such as 0.7, to filter out highly correlated target vector representation pairs. By analyzing the correlation matrix, the server finds that the correlation coefficients between V1 and V2, V1 and V4, and V2 and V5 all exceed 0.7, so these vector pairs are marked as having significant correlation.

[0120] Step A1243, for each target vector representation pair, identify the significant correlation features between different target vector representations in the target vector representation pair based on the mutual information algorithm, wherein the significant correlation features represent lexical features, phrase features or specified semantic pattern features that appear significantly in the target vector representation pair.

[0121] In this embodiment, for each target vector representation pair marked as significantly correlated, the server uses a mutual information algorithm to identify significantly correlated features between them, which may be words, phrases, or specific semantic patterns that appear significantly in both vectors.

[0122] For example, for the pair of significantly correlated target vectors V1 and V2, the server uses the mutual information algorithm to find the significant features shared between them. After calculation, the server finds that vocabulary features such as "credit card information" and "account number" and phrase features such as "please provide your XX information for verification" appear significantly in both vectors and are therefore identified as significantly correlated features.

[0123] Step A1244, creating an empty vector sequence as the basis of the initial third key semantic vector sequence, traversing all the identified significance-related features, sorting the significance-related features according to the corresponding importance scores, and adding the sorted significance-related features one by one to the initial third key semantic vector sequence, wherein, when adding each significance-related feature, a preset weighting mechanism is used so that the significance-related features with higher importance scores have a greater influence weight in the final third key semantic vector sequence.

[0124] In this embodiment, the server first creates an empty vector sequence as the basis for the initial third key semantic vector sequence. Then, it traverses all the identified significant related features and sorts them according to their importance scores. Next, the server adds these sorted features one by one to the initial third key semantic vector sequence, and uses a preset weighting mechanism to ensure that features with higher importance scores have a greater influence weight in the final vector sequence.

[0125] For example, the server first creates an empty third key semantic vector sequence. Then, it sorts all the identified significant related features according to the importance score. In this example, vocabulary features such as "credit card information" and "account number" may get higher scores due to their high frequency and criticality. The server adds these features to the third key semantic vector sequence one by one in the order of scores and assigns corresponding weights to each feature. The final third key semantic vector sequence will be a comprehensive representation that integrates the information of multiple target second key semantic vector sequences, providing more precise semantic guidance for subsequent anonymization processing.

[0126] In a possible implementation, step A120 may include: selecting an anonymization rule having a first matching degree greater than a preset matching degree from the anonymization rules as a first reference anonymization rule corresponding to the original communication text. Alternatively, arranging each of the anonymization rules in descending order according to each of the first matching degrees, and selecting the first N anonymization rules in the arrangement result as the first reference anonymization rule corresponding to the original communication text, where N is a positive integer greater than 1.

[0127] In this embodiment, the server has calculated the first matching degrees between the original communication text and each anonymization rule. These first matching degrees are numerical representations, reflecting the similarity or compliance between the original communication text and each anonymization rule.

[0128] For example, assume that the server has calculated the first matching degrees of the original communication text with five anonymization rules (rules A, B, C, D, and E), which are 0.75, 0.80, 0.65, 0.90, and 0.70, respectively.

[0129] The preset matching threshold set by the server is 0.80, which means that only anonymization rules with matching degrees higher than or equal to 0.80 will be selected.

[0130] Among the above five anonymization rules, only the first matching degrees of rule B (matching degree is 0.80) and rule D (matching degree is 0.90) are greater than or equal to the preset matching degree threshold value 0.80.

[0131] Therefore, the server determines that Rule B and Rule D are the first reference anonymization rules corresponding to the original communication text.

[0132] Similarly, the server has calculated the first matching degree between the original communication text and each anonymization rule. The above five anonymization rules are sorted according to the first matching degree, and the results are: Rule D (0.90), Rule B (0.80), Rule A (0.75), Rule E (0.70), Rule C (0.65).

[0133] The server sets N to 2, which means it will select the first two anonymization rules with the highest matching degree.

[0134] In the sorted anonymization rule list, the first two rules are Rule D and Rule B, so the server determines that these two rules are the first reference anonymization rules corresponding to the original communication text.

[0135] In a possible implementation, step S130 includes:

[0136] Step S131 , arranging each of the anonymization rule text libraries in descending order according to each of the second matching degrees.

[0137] In this embodiment, the server has calculated the second matching degrees between the original communication text and each anonymization rule text library. These second matching degrees are numerical representations that reflect the similarity or conformity between the original communication text and each anonymization rule text library.

[0138] For example, assume that the server has calculated the second matching degrees of the original communication text and five anonymized rule text libraries (library A, library B, library C, library D, library E), which are 0.75, 0.85, 0.60, 0.90 and 0.70 respectively.

[0139] Step S132: determining, from the anonymization rule text libraries, a target anonymization rule text library having a second matching degree greater than a preset matching degree.

[0140] Step S133: using the anonymization rule corresponding to the target anonymization rule text library as the second reference anonymization rule corresponding to the original communication text.

[0141] Next, the server arranges all anonymization rule text libraries in order of the matching degree from large to small according to these second matching degrees.

[0142] For example, the server sorts the five anonymization rule text libraries according to the second matching degree, and the results are: library D (0.90), library B (0.85), library A (0.75), library E (0.70), and library C (0.60).

[0143] The server sets a preset matching threshold, which is used to filter out the anonymization rule text library with a high matching degree with the original communication text.

[0144] For example, the preset matching degree threshold set by the server is 0.80, which means that only the anonymization rule text library with a matching degree higher than 0.80 will be selected.

[0145] The server selects a library having a second matching degree greater than a preset matching degree from the sorted anonymization rule text library.

[0146] For example, among the five anonymization rule text libraries, only library D (matching degree is 0.90) and library B (matching degree is 0.85) have a second matching degree greater than the preset matching degree threshold of 0.80.

[0147] The server determines the anonymization rule corresponding to the screened anonymization rule text library as the second reference anonymization rule corresponding to the original communication text.

[0148] For example, the server determines that the anonymization rules corresponding to library D and library B are the second reference anonymization rules corresponding to the original communication text. These rules will be used in subsequent text anonymization processing to ensure that sensitive information in the original communication text is properly protected.

[0149] In a possible implementation, the first reference anonymization rules include at least two, and the second reference anonymization rules include at least two. Step S140 may include:

[0150] Step S141, traversing each of the second reference anonymization rules, determining whether the second reference anonymization rule exists in multiple first reference anonymization rules, and when the second reference anonymization rule exists in multiple first reference anonymization rules, using the second reference anonymization rule as a third reference anonymization rule.

[0151] Step S142: If the number of the third reference anonymization rule is one, determine that the third reference anonymization rule is the target anonymization rule corresponding to the original communication text.

[0152] Step S143: if the third reference anonymization rule includes at least two, traverse each of the third reference anonymization rules, and select one or more target second matching degrees reflecting that the original communication text corresponds to the third reference anonymization rule from each of the second matching degrees.

[0153] Step S144: Arrange the one or more target second matching degrees in descending order, and select the first M target matching degrees from the one or more target second matching degrees, where M is a positive integer greater than 0.

[0154] Step S145, calculating the mean of the M target matching degrees to generate a reference matching degree of the third reference anonymization rule, and using the reference matching degree as the confidence of the original communication text corresponding to the third reference anonymization rule, and using the third reference anonymization rule corresponding to the maximum confidence as the target anonymization rule corresponding to the original communication text.

[0155] In this embodiment, the server has determined at least two first reference anonymization rules and at least two second reference anonymization rules. Assume that there are three first reference anonymization rules A, B, and C, and three second reference anonymization rules X, Y, and Z.

[0156] The server starts to iterate over each of the second reference anonymization rules, checking whether they exist in the plurality of first reference anonymization rules.

[0157] For example, the server first checks rule X and finds that it appears in both first reference rules A and B; then checks rule Y and finds that it only appears in first reference rule C; and finally checks rule Z and finds that it does not appear in any first reference rule.

[0158] Next, the server determines those second reference anonymization rules that exist in the plurality of first reference anonymization rules as third reference anonymization rules.

[0159] For example, in this example, only rule X appears in both first reference rules, so it is determined as the third reference anonymization rule. Rules Y and Z are not considered as third reference anonymization rules.

[0160] If there is only one third reference anonymization rule, the server directly determines it as the target anonymization rule corresponding to the original communication text.

[0161] For example, since only Rule X is determined as the third reference anonymization rule in this example, the server uses Rule X as the target anonymization rule.

[0162] If there are multiple third reference anonymization rules, the server will traverse each third reference anonymization rule and select one or more target second matching degrees corresponding to these rules from the second matching degrees.

[0163] Next, the server arranges these target second matching degrees in descending order, and selects the first M target matching degrees (M is a positive integer greater than 0) therefrom.

[0164] Next, the server calculates the average of the M target matching degrees to generate a reference matching degree for each third reference anonymization rule. The average is used as the confidence level of the original communication text corresponding to the rule.

[0165] Next, the server determines the third reference anonymization rule corresponding to the maximum confidence as the target anonymization rule corresponding to the original communication text.

[0166] For example, suppose in this example, in addition to Rule X, there is another rule that is also determined as the third reference anonymization rule. The server will calculate the confidence of these two rules respectively and compare their sizes. In the end, the server will select the rule with higher confidence as the target anonymization rule. If Rule X has a higher confidence, it will be selected as the final target anonymization rule.

[0167] In a possible implementation, before selecting the first M target matching degrees in step S143, the method further includes: traversing each of the third reference anonymization rules, obtaining the number of the original communication texts corresponding to the third reference anonymization rules determined based on each of the second matching degrees, and taking the minimum number of the numbers corresponding to each of the third reference anonymization rules as M.

[0168] In this embodiment, the server has determined multiple third reference anonymization rules. Assume that there are three third reference anonymization rules, namely, R1, R2, and R3. The server starts to traverse each third reference anonymization rule and obtains the number of original communication texts corresponding to these rules determined according to the second matching degree.

[0169] For example, for rule R1, the server finds that there are 5 second matching degrees associated with it.

[0170] For rule R2, the server finds that there are 3 second matching degrees associated with it.

[0171] For rule R3, the server finds that there are 4 second matching degrees associated with it.

[0172] The server determines the minimum number among the numbers corresponding to each third reference anonymization rule as M. For example, among the above three rules, R2 has the least number of second matching degrees, namely 3. Therefore, the server determines the value of M to be 3.

[0173] In a possible implementation, determining the confidence level of the original communication text corresponding to each of the third reference anonymization rules includes:

[0174] Each of the third reference anonymization rules is traversed, and one or more target second matching degrees reflecting that the original communication text corresponds to the third reference anonymization rule are selected from each of the second matching degrees.

[0175] An average matching degree of the one or more target second matching degrees is determined, and the average matching degree is used as the confidence degree of the original communication text corresponding to each of the third reference anonymization rules.

[0176] In this embodiment, the server traverses each third reference anonymization rule and selects one or more target second matching degrees reflecting that the original communication text corresponds to these rules from the second matching degrees.

[0177] For example, for rule R1, the server selects five target second matching degrees: 0.85, 0.80, 0.75, 0.70, and 0.65.

[0178] Next, the server determines the average matching degree of these target second matching degrees. For example, for the 5 target second matching degrees of rule R1, the server calculates the average value as: (0.85 + 0.80 + 0.75 + 0.70 + 0.65) / 5 = 0.75.

[0179] Finally, the server uses this average matching degree as the confidence of the original communication text corresponding to each third reference anonymization rule. Therefore, the confidence of the original communication text corresponding to rule R1 is 0.75. The server performs the same operation on each third reference anonymization rule to determine their respective confidences.

[0180] In a possible implementation, determining the confidence level of the original communication text corresponding to each of the third reference anonymization rules includes:

[0181] Each of the third reference anonymization rules is traversed to obtain the number of the original communication texts corresponding to the third reference anonymization rules determined according to each of the second matching degrees.

[0182] Obtain association information between the quantity and the confidence level.

[0183] The confidence level of the original communication text corresponding to each of the third reference anonymization rules is determined according to the number corresponding to each of the third reference anonymization rules and the associated information.

[0184] In this embodiment, the server starts to traverse each determined third reference anonymization rule.

[0185] For example, assume that the server has determined three third reference anonymization rules, labeled Rule A, Rule B, and Rule C, respectively.

[0186] For each third reference anonymization rule, the server obtains the number of original communication texts corresponding to the rule according to the second matching degree.

[0187] For example, for rule A, the server finds that there are 5 parts in the original communication text that highly match it.

[0188] For rule B, the server finds that there are three parts in the original communication text that are highly matched with it.

[0189] For rule C, the server finds that there are 4 parts in the original communication text that highly match it.

[0190] Next, the server obtains correlation information between quantity and confidence, which may be pre-set or obtained through historical data analysis.

[0191] For example, the server retrieves the association data between the quantity and the confidence from the database, which may be a mapping table or a mathematical model for estimating the confidence according to the number of matches. For example, there may be a formula indicating a positive correlation between the confidence and the number of matches.

[0192] Next, based on the number and associated information corresponding to each third reference anonymization rule, the server determines the confidence level of the original communication text corresponding to each third reference anonymization rule.

[0193] For example, for rule A, since it has 5 matching parts, the server calculates its confidence as 0.9 based on the associated information (such as a formula or a mapping table).

[0194] For rule B, since it has 3 matching parts, the server calculates its confidence as 0.7.

[0195] For rule C, since it has 4 matching parts, the server calculates its confidence as 0.8.

[0196] In this way, the server obtains the confidence level of the original communication text corresponding to each third reference anonymization rule, which helps to subsequently select the most appropriate target anonymization rule to process the original communication text.

[0197] In a possible implementation, before step S110, the method further includes:

[0198] Step S101 : acquiring one or more anonymization rule text libraries corresponding to each of the anonymization rules, and extracting a second key semantic vector sequence of each of the anonymization rule text libraries.

[0199] Step S102, traversing each of the anonymization rules, generating a first anonymization rule information base by configuring the anonymization rules and the anonymous semantic vector sequences of the anonymization rules in a correlation manner, wherein the anonymous semantic vector sequence is a fusion semantic vector sequence of the second key semantic vector sequence of one or more anonymization rule text libraries corresponding to the anonymization rules.

[0200] Step S103, traversing each of the anonymization rule text libraries, and generating a second anonymization rule information library by configuring the anonymization rule text library, the second key semantic vector sequence of the anonymization rule text library, and the anonymization rules corresponding to the anonymization rule text library in a correlation manner.

[0201] In this embodiment, the server first obtains one or more anonymization rule text libraries corresponding to each anonymization rule.

[0202] For example, suppose the server is processing three anonymization rules, namely Rule 1, Rule 2, and Rule 3. For each rule, the server retrieves the corresponding anonymization rule text library from the database. For example, Rule 1 may correspond to a text library containing multiple text samples that have been anonymized by the rule.

[0203] Next, the server extracts a second key semantic vector sequence from each anonymized rule text library.

[0204] For example, the server uses natural language processing technology to perform semantic analysis on the text in each anonymized regular text library. Through word embedding models (such as Word2Vec, BERT, etc.), the server converts each text in the text library into a series of semantic vectors that capture the key semantic information of the text. For each text library, the server eventually extracts a second key semantic vector sequence, which is the collection of all text semantic vectors in the text library.

[0205] Next, the server iterates over each anonymization rule. For example, the server starts processing Rule 1, Rule 2, and Rule 3 mentioned above.

[0206] For each anonymization rule, the server configures the correlation between it and the corresponding anonymous semantic vector sequence. For example, for rule 1, the server fuses it with the second key semantic vector sequence extracted from the corresponding anonymization rule text library to generate a fused semantic vector sequence. The fusion process can be the average, clustering or other forms of integration of multiple semantic vectors to obtain a vector sequence that can represent the semantics of the entire text library.

[0207] Next, the server generates a first anonymization rule information base. For example, after completing the configuration of the correlation between all anonymization rules and the corresponding fused semantic vector sequences, the server integrates this information into a database to form a first anonymization rule information base, which contains each anonymization rule and its corresponding fused semantic vector sequence, facilitating subsequent semantic matching and rule selection.

[0208] The server traverses each anonymization rule text library again. For example, the server accesses the anonymization rule text library corresponding to rule 1, rule 2 and rule 3 again.

[0209] For each anonymization rule text library, the server configures the correlation between it and the corresponding second key semantic vector sequence and the anonymization rule.

[0210] For example, taking the text base of rule 1 as an example, the server associates and configures the text base, the second key semantic vector sequence extracted from the text base, and rule 1 itself, so that each text base is closely linked with its key semantic information and the corresponding anonymization rule.

[0211] Finally, the server generates a second anonymization rule information base.

[0212] For example, after completing the configuration of the correlation of all anonymization rule text libraries, key semantic vector sequences, and anonymization rules, the server integrates this information into another database to form a second anonymization rule information library, which not only contains the semantic information of each text library, but also directly links to the corresponding anonymization rules, providing rich reference information for subsequent text anonymization processing.

[0213] Figure 2 The NLP-based communication text anonymization system 100 shown includes: a processor 1001 and a memory 1003. The processor 1001 and the memory 1003 are connected, such as through a bus 1002. Optionally, the NLP-based communication text anonymization system 100 may also include a transceiver 1004, which can be used for data interaction between the server and other servers, such as data transmission and / or data reception. It should be noted that the transceiver 1004 is not limited to one in actual scheduling, and the structure of the NLP-based communication text anonymization system 100 does not constitute a limitation on the embodiments of the present application.

[0214] Processor 1001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 1001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0215] The bus 1002 may include a path to transmit information between the above components. The bus 1002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 1002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 2 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0216] The memory 1003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage medium, other magnetic storage devices, or any other medium that can be used to carry or store program code and can be read by a computer, without limitation herein.

[0217] The memory 1003 is used to store program codes for executing the embodiments of the present application, and the execution is controlled by the processor 1001. The processor 1001 is used to execute the program codes stored in the memory 1003 to implement the steps shown in the above method embodiments.

[0218] An embodiment of the present application provides a computer-readable storage medium having program code stored thereon. When the program code is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.

[0219] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless there is clear explanation in this article, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders based on demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages according to the actual implementation scenario, and some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios at the execution time, the execution order of these sub-steps or stages can be flexibly configured based on demand, and the embodiment of the present application does not limit this.

[0220] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the scheme of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.

Claims

1. A communication text anonymization method based on NLP, characterized in that: The method comprises: Performing semantic analysis on the original communication text to generate a first key semantic vector sequence of the original communication text; Determine a first matching degree between the first key semantic vector sequence and the anonymous semantic vector sequence of each anonymization rule of a preset anonymization rule library, and determine a first reference anonymization rule corresponding to the original communication text based on each first matching degree; Determining a second matching degree between the first key semantic vector sequence and a second key semantic vector sequence of each anonymization rule text library corresponding to each of the anonymization rules, and determining a second reference anonymization rule corresponding to the original communication text according to each of the second matching degrees; Determine a target anonymization rule corresponding to the original communication text according to the first reference anonymization rule and the second reference anonymization rule, and anonymize the original communication text according to the target anonymization rule; Before determining the first matching degree between the first key semantic vector sequence and the anonymous semantic vector sequence of each anonymization rule of the preset anonymization rule library, the method further includes: Traversing each of the anonymization rules, acquiring one or more target anonymization rule text libraries corresponding to the anonymization rule, and performing semantic analysis on each of the target anonymization rule text libraries to generate each target second key semantic vector sequence of the anonymization rule; Performing feature interaction on one or more target second key semantic vector sequences of the anonymization rule to generate a third key semantic vector sequence of the anonymization rule; Using the third key semantic vector sequence of the anonymization rule as the anonymous semantic vector sequence of the anonymization rule; The step of performing feature interaction on one or more target second key semantic vector sequences of the anonymization rule to generate a third key semantic vector sequence of the anonymization rule includes: Traversing each anonymization rule, obtaining one or more target anonymization rule text libraries corresponding to the anonymization rule, performing semantic analysis on each target anonymization rule text library, and generating a sequence of target second key semantic vectors of each anonymization rule; For each target second key semantic vector sequence, extract key features of the target second key semantic vector sequence, wherein the key features include at least one of a vocabulary feature, a phrase feature, a syntactic structure feature, or a semantic role feature; The key features are fused into a target vector representation by a feature fusion algorithm, wherein the target vector representation is used to capture the common information and difference information in the second key semantic vector sequence of each target; Learning the relationship between different target second key semantic vector sequences according to the target vector representation to identify significant related features in different target second key semantic vector sequences and generate an initial third key semantic vector sequence that incorporates information of multiple target second key semantic vector sequences; Fine-tuning the initial third key semantic vector sequence based on a gradient descent optimization algorithm to ensure that it can more accurately capture the semantic information of the original anonymization rule, and using the optimized third key semantic vector sequence as the final third key semantic vector sequence of the anonymization rule; The step of learning the relationship between different target second key semantic vector sequences according to the target vector representation to identify significant related features in different target second key semantic vector sequences and generating an initial third key semantic vector sequence that integrates information of multiple target second key semantic vector sequences includes: For all target vector representations, calculate the Pearson correlation coefficients between the target vector representations, and construct a corresponding correlation matrix based on the Pearson correlation coefficients between the target vector representations, wherein each element in the correlation matrix represents the correlation between two corresponding target vector representations; Analyzing the mutual relationship matrix to determine a target vector representation pair having a preset correlation; For each target vector representation pair, identifying significant correlation features between different target vector representations in the target vector representation pair based on a mutual information algorithm, wherein the significant correlation features represent lexical features, phrase features, or specified semantic pattern features that appear significantly in the target vector representation pair; An empty vector sequence is created as the basis of the initial third key semantic vector sequence, all the identified significance-related features are traversed, the significance-related features are sorted according to the corresponding importance scores, and the sorted significance-related features are added one by one to the initial third key semantic vector sequence, wherein, when adding each significance-related feature, a preset weighting mechanism is used so that the significance-related features with higher importance scores have greater influence weights in the final third key semantic vector sequence.

2. The NLP-based communication text anonymization method according to claim 1, characterized in that: The determining, based on each of the first matching degrees, a first reference anonymization rule corresponding to the original communication text includes: Selecting an anonymization rule having a first matching degree greater than a preset matching degree from the anonymization rules as a first reference anonymization rule corresponding to the original communication text; Alternatively, each of the anonymization rules is arranged in descending order according to each of the first matching degrees, and the first N anonymization rules in the arrangement result are selected as the first reference anonymization rules corresponding to the original communication text, where N is a positive integer greater than 1.

3. The communication text anonymization method based on NLP according to claim 1, characterized in that: The determining, based on each of the second matching degrees, a second reference anonymization rule corresponding to the original communication text includes: Arranging each of the anonymization rule text libraries in descending order according to each of the second matching degrees; Determine, from the anonymization rule text libraries, a target anonymization rule text library having a second matching degree greater than a preset matching degree; The anonymization rule corresponding to the target anonymization rule text library is used as the second reference anonymization rule corresponding to the original communication text.

4. The method for anonymizing communication text based on NLP according to claim 1, characterized in that: The first reference anonymization rules include at least two, and the second reference anonymization rules include at least two; determining the target anonymization rule corresponding to the original communication text according to the first reference anonymization rule and the second reference anonymization rule includes: Traversing each of the second reference anonymization rules to determine whether the second reference anonymization rule exists in a plurality of the first reference anonymization rules, and when the second reference anonymization rule exists in a plurality of the first reference anonymization rules, using the second reference anonymization rule as a third reference anonymization rule; If the number of the third reference anonymization rule is one, determining the third reference anonymization rule as the target anonymization rule corresponding to the original communication text; If the third reference anonymization rule includes at least two, traverse each of the third reference anonymization rules, and select one or more target second matching degrees reflecting that the original communication text corresponds to the third reference anonymization rule from each of the second matching degrees; Arrange the one or more target second matching degrees in descending order, and select the first M target matching degrees from the one or more target second matching degrees, where M is a positive integer greater than 0; The M target matching degrees are averaged to generate a reference matching degree of the third reference anonymization rule, and the reference matching degree is used as the confidence of the original communication text corresponding to the third reference anonymization rule, and the third reference anonymization rule corresponding to the maximum confidence is used as the target anonymization rule corresponding to the original communication text.

5. The NLP-based communication text anonymization method according to claim 4, characterized in that: Before selecting the first M target matching degrees, the method further includes: Each of the third reference anonymization rules is traversed to obtain the number of the original communication texts corresponding to the third reference anonymization rules determined according to each of the second matching degrees, and the minimum number among the numbers corresponding to each of the third reference anonymization rules is used as M.

6. The method for anonymizing communication text based on NLP according to claim 4, characterized in that: The determining of the confidence level of the original communication text corresponding to each of the third reference anonymization rules includes: Traversing each of the third reference anonymization rules, and selecting, from each of the second matching degrees, one or more target second matching degrees reflecting that the original communication text corresponds to the third reference anonymization rule; Arrange the one or more target second matching degrees in descending order, and select the first M target matching degrees from the one or more target second matching degrees, where M is a positive integer greater than 0; Calculating the mean of the M target matching degrees to generate a reference matching degree of the third reference anonymization rule, and using the reference matching degree as the confidence degree of the original communication text corresponding to the third reference anonymization rule; Alternatively, traverse each of the third reference anonymization rules, and select one or more target second matching degrees reflecting that the original communication text corresponds to the third reference anonymization rule from each of the second matching degrees; An average matching degree of the one or more target second matching degrees is determined, and the average matching degree is used as the confidence degree of the original communication text corresponding to each of the third reference anonymization rules.

7. The method for anonymizing communication text based on NLP according to claim 4, characterized in that: The determining of the confidence level of the original communication text corresponding to each of the third reference anonymization rules includes: Traversing each of the third reference anonymization rules, and obtaining the number of the original communication texts corresponding to the third reference anonymization rules determined according to each of the second matching degrees; Acquire association information between the quantity and the confidence level; The confidence level of the original communication text corresponding to each of the third reference anonymization rules is determined according to the number corresponding to each of the third reference anonymization rules and the associated information.

8. The method for anonymizing communication text based on NLP according to claim 1, characterized in that: Before performing semantic analysis on the original communication text to generate a first key semantic vector sequence of the original communication text, the method further includes: Acquire one or more anonymization rule text libraries corresponding to each of the anonymization rules, and extract a second key semantic vector sequence of each of the anonymization rule text libraries; Traversing each of the anonymization rules, generating a first anonymization rule information base by configuring the anonymization rules and the anonymous semantic vector sequences of the anonymization rules in a correlation manner, wherein the anonymous semantic vector sequence is a fused semantic vector sequence of the second key semantic vector sequence of one or more anonymization rule text bases corresponding to the anonymization rules; Each of the anonymization rule text libraries is traversed, and a second anonymization rule information library is generated by configuring the anonymization rule text library, the second key semantic vector sequence of the anonymization rule text library, and the anonymization rules corresponding to the anonymization rule text library in a correlation manner.

9. A communication text anonymization system based on NLP, characterized in that: It includes a processor and a computer-readable storage medium, wherein the computer-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are executed by the processor, the communication text anonymization method based on NLP according to any one of claims 1 to 8 is implemented.