Method and apparatus for electronic text desensitization, computing device, and storage medium

By using word segmentation and word vector analysis, and utilizing entity-related word segmentation of replacement candidate sentences for desensitization processing of electronic text, the problem of inaccurate location of identity and privacy information in existing technologies is solved, and accurate identification and protection of privacy information is achieved.

CN116263828BActive Publication Date: 2026-06-09CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD
Filing Date
2022-08-25
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing technologies are inaccurate in locating identity and privacy information in electronic texts, resulting in poor desensitization effects and an inability to effectively identify quasi-identity information.

Method used

By analyzing word segmentation and word vectors, entity word segments and their word vectors in electronic text are identified. The entity-related word segments of the replacement candidate sentences are used for desensitization and replacement, accurately identifying and replacing privacy-sensitive word segments, thus achieving desensitization processing of electronic text.

Benefits of technology

It improves the accuracy of identifying privacy information in electronic texts, avoids missing privacy information, effectively obfuscates the correspondence between entities and privacy information, and protects privacy security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116263828B_ABST
    Figure CN116263828B_ABST
Patent Text Reader

Abstract

The application discloses an electronic text desensitization method and device, a computing device and a storage medium. The method comprises the following steps: analyzing an electronic text to obtain a sentence set containing multiple sentences, and word segmentation and word vectors corresponding to the word segmentation of any sentence in the sentence set; wherein the sentence set comprises a target sentence and a replacement candidate sentence; for any sentence in the sentence set, identifying an entity contained in the sentence, determining the word segmentation corresponding to the entity as entity word segmentation, and determining the word vector corresponding to the entity word segmentation as an entity word vector; determining an entity-related word vector corresponding to the entity word vector of any sentence; obtaining a privacy word segmentation corresponding to the target sentence and an entity-related word segmentation corresponding to the target sentence in the replacement candidate sentence according to the entity-related word vector; and performing desensitization replacement processing on the privacy word segmentation of the target sentence by using the entity-related word segmentation in the replacement candidate sentence to obtain a desensitized target sentence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of IT applications, specifically to an electronic text desensitization method, apparatus, computing device, and storage medium. Background Technology

[0002] Personal Identity Information (PII) refers to information that can accurately identify a specific individual. Common PII information includes document-related information (such as ID card numbers, driver's license numbers, etc.) and account-related information (such as bank account numbers, medical account numbers, social security card numbers, etc.). Besides PII, there is also information that has a clear correspondence with a particular person, called quasi-identifiers, which can also facilitate individual identification. For example, in a medical record database, there is a unique correspondence between specific disease names and patients; knowing the disease name allows identification of the patient. Both PII and quasi-identifier information involve the privacy of individual entities and must be protected to prevent leakage.

[0003] For identity and privacy information contained in electronic text, existing technologies generally desensitize it before public display. This is done by first locating the identity and privacy information within the text, such as by scanning each sentence to determine the starting position of the information in each sentence, and then replacing the identity and privacy information with special symbols (such as symbols). Alternatively, identity and privacy information can be replaced with other text (such as text with the same or higher-level concepts) to complete the desensitization process. However, existing technologies suffer from inaccurate positioning of privacy information, such as the inability to identify quasi-identity information, resulting in poor desensitization effects. Summary of the Invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide an electronic text desensitization method, apparatus, computing device, and storage medium that overcomes or at least partially solves the above problems.

[0005] According to one aspect of the present invention, an electronic text desensitization method is provided, the method comprising:

[0006] The word segmentation step analyzes the electronic text to obtain a sentence set containing multiple sentences, as well as the word segmentation and corresponding word vector of any sentence in the sentence set; wherein, the sentence set includes the target sentence and the alternative sentences;

[0007] The entity determination step involves identifying the entities contained in any statement in the statement set, determining the word segment corresponding to the entity as the entity word segment, and the word vector corresponding to the entity word segment as the entity word vector.

[0008] The desensitization step involves determining the corresponding entity-related word vector based on the entity word vector of any statement; obtaining the privacy-related word segment corresponding to the target statement and the corresponding entity-related word segment in the replacement candidate statement based on the entity-related word vector; and using the entity-related word segment in the replacement candidate statement to perform desensitization and replacement processing on the privacy-related word segment of the target statement to obtain the desensitized target statement.

[0009] According to another aspect of the present invention, an electronic text desensitization device is provided, comprising:

[0010] The word segmentation module is suitable for analyzing electronic text to obtain a sentence set containing multiple sentences, as well as the word segmentation and word vector of any sentence in the sentence set; wherein, the sentence set includes the target sentence and the alternative sentences;

[0011] The entity determination module is suitable for identifying the entities contained in any statement in a statement set, determining the word segment corresponding to the entity as the entity word segment, and the word vector corresponding to the entity word segment as the entity word vector.

[0012] The desensitization module is suitable for determining the corresponding entity-related word vectors based on the entity word vectors of any statement; obtaining the privacy-related word segments corresponding to the target statement and the corresponding entity-related word segments in the replacement candidate statements based on the entity-related word vectors; and performing desensitization and replacement processing on the privacy-related word segments of the target statement using the entity-related word segments in the replacement candidate statements to obtain the desensitized target statement.

[0013] According to another aspect of the present invention, a computing device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;

[0014] The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the above-described electronic text desensitization method.

[0015] According to another aspect of the present invention, a computer storage medium is provided, the storage medium storing at least one executable instruction, the executable instruction causing a processor to perform an operation corresponding to the above-described electronic text desensitization method.

[0016] The electronic text desensitization method, apparatus, computing device, and storage medium provided by embodiments of the present invention identify entities contained in electronic text. Based on the word vectors of each segmented word, various privacy-related segmented words associated with entities can be accurately identified, avoiding the omission of privacy information. Furthermore, based on the target sentence and replacement candidate sentences in the electronic text, entity-related segmented words in the replacement candidate sentences can be used to replace the privacy segmented words of the target sentence, completing the desensitization and replacement processing of the electronic text. This further facilitates obfuscating the privacy information of entities and avoids the leakage of privacy information.

[0017] The above description is merely an overview of the technical solutions of the embodiments of the present invention. In order to better understand the technical means of the embodiments of the present invention and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of the present invention more obvious and understandable, specific implementation methods of the embodiments of the present invention are described below. Attached Figure Description

[0018] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0019] Figure 1 A flowchart of an electronic text desensitization method according to an embodiment of the present invention is shown;

[0020] Figure 2 A schematic diagram of an electronic text desensitization device according to an embodiment of the present invention is shown;

[0021] Figure 3 A schematic diagram of the structure of a computing device according to an embodiment of the present invention is shown. Detailed Implementation

[0022] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.

[0023] Figure 1 A flowchart of an electronic text desensitization method according to an embodiment of the present invention is shown, such as... Figure 1 As shown, the method includes the following steps:

[0024] Step S101: Analyze the electronic text to obtain a sentence set containing multiple sentences, as well as the word segmentation and word vector corresponding to any sentence in the sentence set.

[0025] Electronic text can contain multiple different statements. Analyzing electronic text yields a statement set containing multiple statements. This statement set includes the target statement and candidate replacement statements. The target statement can be any statement in the statement set, and the candidate replacement statements are other statements in the set that are not the target statement.

[0026] Any sentence in the sentence set is segmented into words. This segmentation can be implemented using natural language processing techniques. For example, the sentence "Zhang San lives in Shandong" can be divided into multiple words, resulting in "Zhang San", "lives in", and "Shandong". These segmented words can then be input into a trained word vector model to obtain their corresponding word vectors. The word vector model can be a Skip-gram model like Word2Vec. Parameter settings could include 300 hidden neurons, a co-occurrence window of 5, and using two segmented words with a co-occurrence frequency greater than 0 as training samples. Each segmented word is then input into the Skip-gram model to obtain its corresponding word vector. This is just an example; other word vector models can be used in practice, and this is not a limitation.

[0027] Step S102: For any statement in the statement set, identify the entities contained in any statement, determine the word segment corresponding to the entity as the entity word segment, and the word vector corresponding to the entity word segment as the entity word vector.

[0028] After obtaining the word segments and word vectors of each sentence, entity recognition can be used to determine whether each word segment in any sentence in the sentence set contains entity information. If so, the word segment containing entity information is identified as an entity word segment. For example, using named entity recognition technology to identify whether each sentence contains an entity, for the sentence "Zhang San lives in Shandong", named entity recognition (NER) technology can identify that the sentence contains the entity "Zhang San". Correspondingly, the word segment "Zhang San" is an entity word segment, and the word vector of the word segment "Zhang San" is an entity word vector.

[0029] Furthermore, if a statement contains multiple entities, the first entity segment containing entity information can be selected as the entity segment based on the order of the segmented words in the statement. Subsequent privacy segmentation judgments and desensitization processing can then be completed based on the first entity segment.

[0030] Step S103: Determine the corresponding entity-related word vector based on the entity word vector of any statement, and obtain the privacy-related word segmentation corresponding to the target statement and the corresponding entity-related word segmentation in the replacement candidate statement based on the entity-related word vector.

[0031] The target statement can be any statement in the statement set. For example, the first statement can be selected as the target statement according to the order of the statements in the statement set, and the other statements can be used as replacement candidate statements. Alternatively, a statement can be randomly selected as the target statement, and the other statements can be used as replacement candidate statements. There are no restrictions here.

[0032] For the target statement and replacement candidate statements, after determining the entity word vectors of each statement, for any given statement, based on the entity word vectors in each statement, the first relationship between the entity word vector and other word vectors in that statement is calculated. This first relationship can be calculated by taking the cosine similarity between the entity word vector and other word vectors in that statement, selecting the word vector with the highest cosine similarity as the entity-related word vector, and using the corresponding word segmentation as the entity-related word segmentation. The cosine similarity can be calculated using the following formula:

[0033] (1)

[0034] (2)

[0035] Formula (2) is the formula for calculating the similarity between two word vectors A and B. It can be applied to formula (1) to calculate the similarity between word vectors v(w) and v(e). In formula (1), the most_relate function takes the entity word as its parameter e and the sentence s containing e as its parameter s. v(e) is the entity word vector, q(s) is the word segmentation sequence after the sentence s is segmented. w is the other words in the word segmentation sequence q(s) besides the entity word e. v(w) is the word vector corresponding to the word w.

[0036] Applying formula (2), replacing A with word vector v(w) and B with v(e), if word vectors v(w) and v(e) contain n feature vectors, then A i For each feature vector corresponding to the word vector v(w), B i Each feature vector corresponds to a word vector v(e). If word vectors v(w) and v(e) contain a single feature vector, then n is 1. The cosine similarity between the entity word vector v(e) and each word vector v(w) is calculated using the similarity formula. Formula (1) uses the argmax function to obtain the word segment w corresponding to the maximum cosine similarity. w is an entity-related word segment, and the word vector v(w) corresponding to w is an entity-related word vector.

[0037] After calculating the entity word vectors and entity-related word vectors in the target statement and the candidate replacement statement, for the candidate replacement statement, the privacy segmentation of the target statement is determined based on the second relationship between the entity word vectors and entity-related word vectors in the target statement and the entity word vectors and entity-related word vectors in the candidate replacement statement. For example, the first difference between the entity word vector v(e) and the entity-related word vector v(w) in the target statement is calculated, and the second difference between the entity word vector v(e') and the entity-related word vector v(w') in the candidate replacement statement is also calculated. For example, the first difference = abs(v(e) - v(w)), where the abs function is an absolute value function, taking the absolute value of the difference between the entity word vector and the entity-related word vector in the target statement for convenient subsequent calculations. The second difference = abs(v(e') - v(w')), where the abs function is an absolute value function, taking the absolute value of the difference between the entity word vector and the entity-related word vector in the candidate replacement statement for convenient subsequent calculations. The difference between the first difference and the second difference is calculated to obtain the second relationship between the entity word vectors and entity-related word vectors in the target statement and the entity word vectors and entity-related word vectors in the replacement candidate statement. The second relationship is then evaluated to determine whether the difference between the first difference and the second difference meets the second preset condition. Specifically, it is determined whether the difference between the first difference and the second difference is less than or equal to a preset threshold. The preset threshold can take a range of values, such as 0.0-0.1. When the preset threshold is set to 0, abs(v(e)-v(w)) = abs(v(e')-v(w')). When v(e)-v(w) is greater than 0 and v(e')-v(w') is greater than 0, v(e)-v(w) and v(e')-v(w') are equal. That is, the cosine similarity between the entity word vector and the entity-related word vector in the target sentence is the same as the cosine similarity between the entity word vector and the entity-related word vector in the replacement candidate sentence. The entity-related word segment in the target sentence is determined to be the privacy word segment of the target sentence. The privacy information category of the entity-related word segment in the replacement candidate sentence is relatively close, and their second relationship is that they can be mutually replaced.

[0038] Step S104: Use entity-related word segments in the candidate replacement sentences to perform desensitization and replacement processing on the privacy word segments of the target sentence to obtain the desensitized target sentence.

[0039] In this embodiment, the closer the preset threshold of the second preset condition is to 0, the more similar the cosine similarity between the entity word vector and the entity-related word vector in the target statement is to the cosine similarity between the entity word vector and the entity-related word vector in the replacement candidate statement. When the difference between the first difference and multiple second differences is less than or equal to the preset threshold, the entity-related word vector in the target statement that meets the second preset condition can be determined as a privacy word vector. Then, the privacy word segmentation of the target statement is desensitized and replaced using the entity-related word segmentation of the replacement candidate statement to obtain the desensitized target statement. Similarly, the entity-related word segmentation of the replacement candidate statement is the privacy word segmentation of the replacement candidate statement. Furthermore, the entity-related word segmentation of the replacement candidate statement can be used to replace the privacy word segmentation of the target statement to obtain the desensitized target statement, or the privacy word segmentation of the target statement can be used to replace the entity-related word segmentation of the replacement candidate statement to obtain the desensitized replacement candidate statement. For example, if the target statement is "Zhang San lives in Shandong" and the alternative statement is "Li Si lives in Shanxi", the entity segmentation for the target statement is "Zhang San" and the privacy segmentation is "Shandong". For the alternative statement, the entity segmentation is "Li Si" and the privacy segmentation is "Shanxi". After desensitization and replacement processing, the target statement "Zhang San lives in Shanxi" and the alternative statement "Li Si lives in Shandong" are obtained. Compared to the original electronic text "Zhang San lives in Shandong", this process obscures the one-to-one correspondence between "Zhang San" and "Shanxi", thus protecting the privacy of "Zhang San".

[0040] If there are multiple candidate replacement statements, i.e., when the candidate replacement statements include multiple statements, the first difference between the entity word vector and the entity-related word vector in the target statement can be calculated, and multiple second differences between the entity word vectors and the entity-related word vectors in the multiple candidate replacement statements can be calculated. It is then determined whether the difference between the first difference and the multiple second differences is less than or equal to a preset threshold. When there is a first difference and a certain second difference that is less than or equal to the preset threshold, the entity-related word vector in the target statement that meets the second preset condition is determined to be a privacy word vector. Correspondingly, the privacy word segmentation of the target statement is desensitized and replaced using the entity-related word segmentation of the candidate replacement statement corresponding to the second difference, and the desensitized target statement is obtained.

[0041] In this embodiment, the identification of privacy-related word segmentation in electronic text is not limited to personal identity information. Based on the cosine similarity between word vectors, entity-related word segmentation can be accurately analyzed, avoiding the omission of privacy information. After accurately identifying entity-related word segmentation of the target sentence, based on the second relationship between the entity word vectors and entity-related word vectors in the target sentence and the entity word vectors and entity-related word vectors in the replacement candidate sentences, privacy-related word segmentation is determined. At the same time, the word segmentation used for desensitization and replacement processing is reasonably determined, realizing the desensitization processing of privacy information, confusing the correspondence between entities and privacy information, and further protecting privacy security.

[0042] According to the electronic text desensitization method provided in this embodiment of the invention, entities contained in the electronic text are identified. Based on the first relationship between the word vectors of each segment, various privacy-related segment words related to the entities can be accurately identified, avoiding the omission of privacy information. Furthermore, based on the target sentence and replacement candidate sentences in the electronic text, entity-related segment words in the replacement candidate sentences can be used to replace the privacy segment words of the target sentence, completing the desensitization and replacement processing of the electronic text. This is more conducive to obfuscating the privacy information of entities and avoiding the leakage of privacy information.

[0043] Figure 2 A schematic diagram of the electronic text desensitization device provided in an embodiment of the present invention is shown. Figure 2 As shown, the device includes:

[0044] The word segmentation module 210 is suitable for analyzing electronic text to obtain a sentence set containing multiple sentences, as well as the word segmentation of any sentence in the sentence set and the word vector corresponding to the segmentation; wherein, the sentence set includes the target sentence and the replacement candidate sentences;

[0045] The entity determination module 220 is adapted to identify the entities contained in any statement in the statement set, determine the word segment corresponding to the entity as the entity word segment, and the word vector corresponding to the entity word segment as the entity word vector.

[0046] The desensitization module 230 is adapted to determine the corresponding entity-related word vector based on the entity word vector of any statement; obtain the privacy segmentation corresponding to the target statement and the corresponding entity-related segmentation in the replacement candidate statement based on the entity-related word vector; and perform desensitization and replacement processing on the privacy segmentation of the target statement using the entity-related segmentation in the replacement candidate statement to obtain the desensitized target statement.

[0047] Optionally, the entity determination module 220 is further adapted to:

[0048] Based on entity recognition, determine whether each word segment in a sentence contains entity information;

[0049] If so, then the segmentation containing entity information is determined to be entity segmentation.

[0050] Optionally, the entity determination module 220 is further adapted to:

[0051] If the statement contains multiple entities, the first segment containing entity information is selected as the entity segment based on the order of the segmented words in the statement.

[0052] Optionally, the desensitization module 230 is further adapted to:

[0053] The first relationship between entity word vectors and other word vectors in the sentence is calculated. Word vectors whose first relationship meets the first preset condition are identified as entity-related word vectors, and the word segments corresponding to the entity-related word vectors are identified as entity-related word segments. The first relationship includes the cosine similarity between entity word vectors and other word vectors in the sentence. The first preset condition includes obtaining the maximum cosine similarity.

[0054] Based on the second relationship between the entity word vectors and entity-related word vectors in the target sentence and the entity word vectors and entity-related word vectors in the replacement candidate sentences, the entity-related word vectors in the target sentence that meet the second preset conditions are determined to be privacy word vectors, and the entity-related word segments are determined to be privacy word segments.

[0055] The privacy-sensitive words in the target statement are desensitized and replaced by entity-related words that meet the second preset condition in the replacement candidate statements, resulting in the desensitized target statement.

[0056] Optionally, the replacement candidate statements include multiple statements; the desensitization module 230 is further adapted to:

[0057] The first difference between the entity word vector and the entity-related word vector in the target statement is calculated, and multiple second differences between the entity word vectors and the entity-related word vectors in multiple alternative candidate statements are calculated.

[0058] Determine whether the difference between the first difference and the plurality of second differences is less than or equal to a preset threshold;

[0059] If so, the entity-related word vectors in the target statement that meet the second preset condition are identified as privacy word vectors; the privacy word vectors of the target statement are desensitized and replaced using the entity-related word segmentation of the replacement candidate statement to obtain the desensitized target statement.

[0060] Optionally, the desensitization module 230 is further adapted to:

[0061] The privacy-sensitive target statement is obtained by replacing the privacy-sensitive segmentation of the target statement with the entity-related segmentation of the replacement candidate statement.

[0062] Optionally, the device further includes: a candidate desensitization module 240, adapted to replace the entity-related words of the replacement candidate statement with the privacy-sensitive word segmentation of the target statement to obtain the desensitized replacement candidate statement.

[0063] The descriptions of the above modules refer to the corresponding descriptions in the method embodiments, and will not be repeated here.

[0064] This invention also provides a non-volatile computer storage medium storing at least one executable instruction that can execute the electronic text desensitization method in any of the above method embodiments.

[0065] Figure 3 The diagram illustrates the structure of a computing device according to an embodiment of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the computing device.

[0066] like Figure 3 As shown, the computing device may include: a processor 302, a communications interface 304, a memory 306, and a communications bus 308.

[0067] Its features are:

[0068] The processor 302, communication interface 304, and memory 306 communicate with each other via communication bus 308.

[0069] Communication interface 304 is used to communicate with other network elements such as clients or other servers.

[0070] The processor 302 is used to execute program 310, specifically to perform the relevant steps in the above-described electronic text desensitization method embodiment.

[0071] Specifically, program 310 may include program code that includes computer operation instructions.

[0072] Processor 302 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The computing device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0073] Memory 306 is used to store program 310. Memory 306 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0074] Specifically, program 310 can be used to cause processor 302 to execute the electronic text desensitization method in any of the above method embodiments. The specific implementation of each step in program 310 can be found in the corresponding descriptions of the steps and units in the above electronic text desensitization embodiments, and will not be repeated here. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be repeated here.

[0075] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, the embodiments of the present invention are not directed to any particular programming language. It should be understood that the embodiments of the present invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing preferred embodiments of the present invention.

[0076] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0077] Similarly, it should be understood that, in order to streamline the embodiments of the invention and aid in understanding one or more of the various inventive aspects, features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this disclosure should not be construed as reflecting an intention that the claimed embodiments of the invention require more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, characterized in that each claim itself is a separate embodiment of the invention.

[0078] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0079] Furthermore, those skilled in the art will understand that although some embodiments herein include certain features included in other embodiments but not others, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.

[0080] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components according to the embodiments of the present invention. The embodiments of the present invention can also be implemented as device or apparatus programs (e.g., computer programs and computer program products) for performing part or all of the methods described herein. Such programs implementing the embodiments of the present invention can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0081] It should be noted that the above embodiments are illustrative of the present invention and not restrictive of the invention, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. Embodiments of the present invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.

Claims

1. A method for desensitizing electronic text, characterized in that, The methods include: The word segmentation step analyzes the electronic text to obtain a sentence set containing multiple sentences, as well as the word segmentation of any sentence in the sentence set and the corresponding word vector; wherein, the sentence set includes the target sentence and alternative sentences; The entity determination step involves identifying the entity contained in any statement in the statement set, determining the word segment corresponding to the entity as the entity word segment, and the word vector corresponding to the entity word segment as the entity word vector. The desensitization step involves: determining the corresponding entity-related word vector based on the entity word vector of any given statement; obtaining the privacy-related word segment corresponding to the target statement and the corresponding entity-related word segment in the replacement candidate statement based on the entity-related word vector; performing desensitization and replacement processing on the privacy-related word segment of the target statement using the entity-related word segment in the replacement candidate statement to obtain the desensitized target statement; wherein, a first relationship is calculated between the entity word vector and other word vectors in the statement, and word vectors whose first relationship meets a first preset condition are determined as entity-related word vectors, and word segments corresponding to the entity-related word vectors are determined as entity-related word segments; the first relationship includes the cosine similarity between the entity word vector and other word vectors in the statement; the first preset condition includes obtaining the maximum cosine similarity; based on the second relationship between the entity word vector and entity-related word vector in the target statement and the entity word vector and entity-related word vector in the replacement candidate statement, entity-related word vectors in the target statement that meet the second preset condition are determined as privacy-related word vectors, and entity-related word segments are determined as privacy-related word segments; and performing desensitization and replacement processing on the privacy-related word segments of the target statement using the entity-related word segments in the replacement candidate statement that meet the second preset condition to obtain the desensitized target statement.

2. The method according to claim 1, characterized in that, The entity determination step further includes: Based on entity recognition, determine whether each word segment in a sentence contains entity information; If so, then the segmentation containing entity information is determined to be entity segmentation.

3. The method according to claim 2, characterized in that, The entity determination step further includes: If the statement contains multiple entities, the first segment containing entity information is selected as the entity segment based on the order of the segmented words in the statement.

4. The method according to claim 1, characterized in that, The alternative statements include multiple statements; The desensitization step further includes: The first difference between the entity word vector and the entity-related word vector in the target statement is calculated, and multiple second differences between the entity word vectors and the entity-related word vectors in multiple alternative candidate statements are calculated. Determine whether the difference between the first difference and the plurality of second differences is less than or equal to a preset threshold; If so, the entity-related word vectors in the target statement that meet the second preset condition are identified as privacy word vectors; the privacy word vectors of the target statement are desensitized and replaced using the entity-related word segmentation of the replacement candidate statement to obtain the desensitized target statement.

5. The method according to claim 4, characterized in that, The desensitization step further includes: The privacy-sensitive target statement is obtained by replacing the privacy-sensitive segmentation of the target statement with the entity-related segmentation of the replacement candidate statement.

6. The method according to any one of claims 1-5, characterized in that, The method further includes: The privacy-sensitive word segmentation of the target statement is used to replace the entity-related word segmentation of the replacement candidate statement to obtain the desensitized replacement candidate statement.

7. An electronic text desensitization device, characterized in that the device comprises: The word segmentation module is adapted to analyze the electronic text to obtain a sentence set containing multiple sentences, as well as the word segmentation of any sentence in the sentence set and the word vector corresponding to the segmentation; wherein, the sentence set includes the target sentence and the alternative sentences; The entity determination module is adapted to identify the entity contained in any statement in the statement set, determine the word segment corresponding to the entity as the entity word segment, and the word vector corresponding to the entity word segment as the entity word vector; The desensitization module is adapted to: determine the corresponding entity-related word vector based on the entity word vector of any statement; obtain the privacy-related word segment corresponding to the target statement and the corresponding entity-related word segment in the replacement candidate statement based on the entity-related word vector; perform desensitization and replacement processing on the privacy-related word segment of the target statement using the entity-related word segment in the replacement candidate statement to obtain the desensitized target statement; wherein, a first relationship is calculated between the entity word vector and other word vectors in the statement, and word vectors whose first relationship meets a first preset condition are determined as entity-related word vectors, and word segments corresponding to the entity-related word vectors are determined as entity-related word segments; the first relationship includes the cosine similarity between the entity word vector and other word vectors in the statement; the first preset condition includes obtaining the maximum cosine similarity; based on the second relationship between the entity word vector and entity-related word vector in the target statement and the entity word vector and entity-related word vector in the replacement candidate statement, determine the entity-related word vector in the target statement that meets the second preset condition as privacy word vector, and entity-related word segments as privacy word segments; perform desensitization and replacement processing on the privacy word segments of the target statement using the entity-related word segments in the replacement candidate statement that meet the second preset condition to obtain the desensitized target statement.

8. A computing device, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the electronic text desensitization method as described in any one of claims 1-6.

9. A computer storage medium, characterized in that, The storage medium stores at least one executable instruction that causes the processor to perform the operation corresponding to the electronic text desensitization method as described in any one of claims 1-6.