Text processing method and device, storage medium and electronic equipment
By semantic encoding, noise addition and restore the original transaction text in the transaction processing scenario of the large language model, desensitized transaction text is generated, which solves the problem of private information leakage in the large language model and realizes data privacy protection.
Patent Information
- Application Number
- CN202510410066.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-01
- Publication Date
- 2025-07-25
AI Technical Summary
The large language model has the risk of privacy information leakage when processing user data, and how to protect user data privacy has become an urgent problem.
By semantic encoding of the original transaction text, the text semantic encoding data is generated, and the noise-added semantic encoding data is obtained after noise addition. Finally, the desensitized transaction text is obtained through semantic restoration processing. The noise intensity is controlled using encoding and decoding model and privacy budget parameters to ensure that the desensitized text is similar to the original text semantics.
It effectively hides private information or sensitive content in the original transaction text, avoids leakage during the processing of large language models, and protects data privacy.
Smart Images

Figure CN120372641A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer technology, and particularly to a text processing method, apparatus, storage medium, and electronic device. Background Art
[0002] With the rapid development of artificial intelligence technology, large language models (LLMs) have made remarkable progress in the field of natural language processing. Based on deep learning algorithms and learning from a vast amount of text data, large language models can perform various tasks such as text generation, translation, question answering, and sentiment analysis. The powerful capabilities of these models enable them to be widely applied in fields such as chatbots, automated writing, and intelligent assistants.
[0003] However, with the popularization of large language models, data privacy issues have gradually become the focus of attention. The training of large language models usually requires a large amount of text data, and this data often contains privacy information. Directly using this data is likely to cause privacy leakage. During the application process of large language models, users may directly input questions involving privacy information to the interfaces provided by third-party large model service providers, and the privacy information involved in the questions also brings risks of privacy leakage. Therefore, how to protect the privacy of user data in large language models is a technical problem that urgently needs to be solved. Summary of the Invention
[0004] This specification provides a text processing method, apparatus, storage medium, and electronic device, and the technical solutions are as follows:
[0005] In a first aspect, this specification provides a text processing method, and the method includes:
[0006] Determine the original transaction text in the large language model transaction processing scenario;
[0007] Perform semantic encoding processing on the original transaction text to obtain text semantic encoding data, perform noise addition processing on the text semantic encoding data to obtain noise-added semantic encoding data, and perform semantic restoration processing on the noise-added semantic encoding data to obtain the de-sensitized transaction text corresponding to the original transaction text;
[0008] Perform transaction processing using the large language model based on the de-sensitized transaction text.
[0009] In combination with the first aspect, in some possible implementation manners, the performing semantic encoding processing on the original transaction text to obtain text semantic encoding data, performing noise addition processing on the text semantic encoding data to obtain noise-added semantic encoding data, and performing semantic restoration processing on the noise-added semantic encoding data to obtain the de-sensitized transaction text corresponding to the original transaction text includes:
[0010] Semantically encode the original transaction text using an encoding and decoding model to obtain text semantic encoding data;
[0011] Obtain the privacy budget parameter corresponding to the original transaction text, determine the privacy data noise addition intensity based on the privacy budget parameter, and perform noise addition processing on the text semantic encoding data based on the privacy data noise addition intensity to obtain noisy semantic encoding data;
[0012] Use the encoding and decoding model to perform semantic reduction processing on the noisy semantic encoding data to obtain the desensitized transaction text corresponding to the original transaction text.
[0013] Combined with the first aspect and the above embodiments, in some possible embodiments, the obtaining of the privacy budget parameter corresponding to the original transaction text includes:
[0014] Perform sensitive content detection processing on the original transaction text to obtain text sensitivity, perform text analysis processing on the original transaction text to obtain text semantic complexity, and determine the transaction application scenario corresponding to the original transaction text;
[0015] Perform privacy budget allocation processing based on the text sensitivity, the text semantic complexity, and the transaction application scenario to obtain the privacy budget parameter.
[0016] Combined with the first aspect and the above embodiments, in some possible embodiments, the performing of privacy budget allocation processing based on the text sensitivity, the text semantic complexity, and the transaction application scenario to obtain the privacy budget parameter includes:
[0017] Generate a privacy detection prompt word based on the text sensitivity, the text semantic complexity, and the transaction application scenario;
[0018] Perform privacy budget allocation processing based on the privacy detection prompt word using a privacy detection large model to obtain the privacy budget parameter.
[0019] Combined with the first aspect and the above embodiments, in some possible embodiments, the semantically encoding the original transaction text using an encoding and decoding model to obtain text semantic encoding data includes:
[0020] Perform word embedding processing on the original transaction text using the encoder in the encoding and decoding model to obtain word embedding vectors, and perform context semantic encoding processing based on the word embedding vectors to obtain word-level context semantic encoding data;
[0021] Perform sentence-level semantic aggregation processing on the word-level context semantic encoding data to obtain text semantic encoding data.
[0022] Combined with the first aspect and the above embodiments, in some possible embodiments, the process of using the encoding and decoding model to perform semantic restoration processing on the noise-added semantic encoded data to obtain the desensitized transaction text corresponding to the original transaction text includes:
[0023] Using the decoder in the encoding and decoding model to perform decoding conversion processing on the noise-added semantic encoded data to obtain a vector to be decoded, and performing semantic restoration processing on the vector to be decoded to obtain the desensitized transaction text corresponding to the original transaction text.
[0024] Combined with the first aspect and the above embodiments, the method further includes:
[0025] Creating an initial encoding and decoding model for the text transaction processing scenario;
[0026] Obtaining training transaction texts for the text transaction processing scenario, and annotating transaction text labels for the training transaction texts;
[0027] Based on the training transaction texts and the transaction text labels, performing at least one round of model training on the initial encoding and decoding model to obtain the encoding and decoding model after model training.
[0028] Combined with the first aspect, in some possible embodiments, the process of using the large language model to perform transaction processing based on the desensitized transaction text includes:
[0029] Determining a large language model to be trained for the desensitized transaction text, and using the desensitized transaction text to perform model training processing on the large language model to be trained; and / or,
[0030] Obtaining a text processing large language model for the desensitized transaction text, inputting the desensitized transaction text into the text processing large language model, and performing text question and answer processing on the desensitized transaction text through the text processing large language model to obtain the target transaction text.
[0031] In a second aspect, this specification provides a text processing device, and the device includes:
[0032] A text determination module, configured to determine the original transaction text in the large language model transaction processing scenario;
[0033] A text desensitization module, configured to perform semantic encoding processing on the original transaction text to obtain text semantic encoded data, perform noise addition processing on the text semantic encoded data to obtain noise-added semantic encoded data, and perform semantic restoration processing on the noise-added semantic encoded data to obtain the desensitized transaction text corresponding to the original transaction text;
[0034] A text processing module, configured to perform transaction processing using a large language model based on the desensitized transaction text.
[0035] In a third aspect, this specification provides a computer storage medium having a plurality of instructions adapted to be loaded and executed by a processor to perform the above method.
[0036] In a fourth aspect, this specification provides a computer program product storing at least one instruction, and the at least one instruction is loaded and executed by a processor to perform the above method.
[0037] In a fifth aspect, this specification provides an electronic device, which may include: a memory and a processor; wherein, the memory stores a computer program adapted to be loaded and executed by the memory to perform the above method.
[0038] The beneficial effects brought by the technical solution provided in this specification at least include:
[0039] The text processing method provided in the embodiments of this specification, after determining the original transaction text in the large language model transaction processing scenario, performs semantic encoding processing on the original transaction text to obtain text semantic encoding data, then performs noise addition processing on the text semantic encoding data to obtain noisy semantic encoding data, and further performs semantic restoration processing on the noisy semantic encoding data to obtain a desensitized transaction text that can hide the privacy information or sensitive content in the original transaction text and is semantically similar to the original transaction text. Thus, when using a large language model to perform transaction processing based on the desensitized transaction text, it is possible to avoid the leakage of privacy information or sensitive content in the original transaction text, achieving the effect of protecting the data privacy of transaction texts in the large model scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention, and those skilled in the art can obtain other drawings without creative efforts based on these drawings.
[0041] Figure 1 is a schematic diagram of the scenario of a text processing system provided in the embodiments of this specification;
[0042] Figure 2 is a schematic flowchart of a text processing method provided in the embodiments of this specification;
[0043] Figure 3 is a schematic flowchart of another text processing method provided in the embodiments of this specification;
[0044] Figure 4It is a schematic flowchart of a method for training an encoding and decoding model provided by an embodiment of this specification;
[0045] Figure 5 It is a schematic structural diagram of a text processing device provided by an embodiment of this specification;
[0046] Figure 6 It is a schematic structural diagram of an electronic device provided by an embodiment of this specification. Detailed implementation manners
[0047] To make the objectives, features, and advantages of the invention in the embodiments of this specification more obvious and understandable, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this specification.
[0048] In the description of this specification, it should be understood that terms such as "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance. In the description of this specification, it should be noted that unless otherwise clearly defined and limited, "including" and "having", and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes unlisted steps or units, or optionally further includes other steps or units inherent to these processes, methods, products, or devices. For those of ordinary skill in the art, the specific meanings of the above terms in this specification can be understood according to specific circumstances. In addition, in the description of this specification, unless otherwise stated, "a plurality of" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0049] Please refer to Figure 1 , which is a schematic diagram of a scenario of a text processing system provided by an embodiment of this specification. As Figure 1 shown, the schematic diagram of this scenario may at least include a terminal cluster and a server.
[0050] In some embodiments, the terminal cluster may include at least one terminal. As Figure 1 shown, it specifically includes terminal 1 corresponding to user 1, terminal 2 corresponding to user 2,..., terminal n corresponding to user n, where n is an integer greater than 0.
[0051] Each terminal in the terminal cluster can be an intelligent device with communication capabilities. Such intelligent devices include, but are not limited to: wearable devices, handheld devices, personal computers, tablet computers, smartphones, computing devices, or other processing devices connected to a wireless modem, etc. In different networks, intelligent devices can be called different names. For example: user equipment, access terminal, user unit, user station, mobile station, mobile device, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device, cellular phone, cordless phone, personal digital assistant (PDA), electronic devices in 5G networks or future evolved networks, etc.
[0052] In some embodiments, the server is a hardware device with strong computing capabilities. Specifically, the server can use a single server device. For example: rack-mounted, blade, tower, or cabinet-style server devices, or use hardware devices such as workstations and mainframes; it can also use a server cluster composed of multiple servers. The servers in the service cluster can be composed symmetrically, where each server is functionally equivalent and has an equivalent status in the transaction link. Each server can provide services externally independently. Providing services independently can be understood as not requiring the assistance of another server.
[0053] In some embodiments, the electronic device that executes the text processing method can be a server. The server can establish a communication connection with the terminals in the terminal cluster and complete data interaction during the text processing process based on this communication connection. For example, in the text processing method, the terminals in the terminal cluster obtain the original transaction text in the large language model transaction processing scenario. The server obtains the original transaction text from the terminal to determine the original transaction text in the large language model transaction processing scenario. The server performs semantic encoding processing on the original transaction text to obtain text semantic encoding data, performs noise addition processing on the text semantic encoding data to obtain noisy semantic encoding data, and performs semantic restoration processing on the noisy semantic encoding data to obtain the de-sensitized transaction text corresponding to the original transaction text. The server uses the large language model to perform transaction processing based on the de-sensitized transaction text.
[0054] It should be noted that the server and the terminal establish a communication connection through the network for interactive communication. Among them, the network can be a wireless network or a wired network. The wireless network includes but is not limited to a cellular network, a wireless local area network, an infrared network, or a Bluetooth network. The wired network includes but is not limited to an Ethernet, a universal serial bus (USB), or a controller area network. In one or more embodiments of the specification, technologies and / or formats including HyperText Mark-up Language (HTML), Extensible Markup Language (XML), etc. are used to represent data (such as a target compressed package) exchanged through the network. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), and Internet Protocol Security (IPsec) can be used to encrypt all or some of the links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.
[0055] The text processing system embodiments provided in this specification and the text processing methods described in one or more embodiments belong to the same concept. The execution subject corresponding to the text processing method involved in one or more embodiments of the specification can be an electronic device. The electronic device can be the above-mentioned server, or the electronic device can also be the above-mentioned terminal. The execution subject can be specifically determined according to the actual application scenario. The specific implementation process of the text processing system embodiments can be seen in detail in the following method embodiments and will not be elaborated here.
[0056] In one embodiment, as Figure 2 shown, a text processing method is specifically proposed. This method can be implemented depending on a computer program and can run on a text processing device based on the von Neumann architecture. The computer program can be integrated in an application or run as an independent tool class application.
[0057] Specifically, the text processing method includes:
[0058] S102, determining the original transaction text in the large language model transaction processing scenario.
[0059] Among them, the large language model transaction processing scenario refers to using a large language model for specific transaction processing. Specifically, the large language model transaction processing scenario may include, but is not limited to, the model training transaction scenario for the large language model and the model application transaction scenario for the large language model. The model training transaction scenario for the large language model can be understood as, for example, using a basic large language model to train in a specific field or specific task to obtain an artificial intelligence large model with better performance in that field or on that task. The model application transaction scenario for the large language model can be understood as, for example, using the interface provided by the large language model service provider to perform intelligent question and answer interaction processing.
[0060] The original transaction text refers to the original text including unwrapped privacy elements used when using a large language model for specific transaction processing. For example, in the model training transaction scenario for the large language model, the original transaction text is the original text including specific domain privacy data as training data. Another example is that in the model application transaction scenario for the large language model, the original transaction text is the question including personal privacy information input by the user into the large language model.
[0061] In some embodiments, when performing step S102, it may specifically include: obtaining a text input operation for the large language model transaction processing scenario, and determining the original transaction text in the large language model transaction processing scenario based on the text input operation. Among them, the text input operation may be an operation in which the user inputs text on the text input interface corresponding to the large language model transaction processing scenario, and the text input by the user on this text input interface is the original transaction text.
[0062] In some embodiments, when performing step S102, it may specifically include: obtaining the original transaction text in the large language model transaction processing scenario from the client. Among them, the client may be a terminal device used by the relevant personnel for transaction processing in the large language model transaction processing scenario. The client may, in response to the text input operation performed by the user on the text input interface corresponding to the large language model transaction processing scenario, send the original transaction text in the large language model transaction processing scenario input by this text input operation to the electronic device. In this way, the electronic device can obtain the original transaction text.
[0063] In still other embodiments, when performing step S102, it may include: obtaining a text database for the large language model transaction processing scenario, and obtaining the original transaction text in the large language model transaction processing scenario from the text database. Among them, the text database is used to store at least one original transaction text in the large language model transaction processing scenario. The relevant personnel for transaction processing in the large language model transaction processing scenario have the management authority for the text database, and the relevant personnel for transaction processing can use the terminal device to upload the original transaction text to the text database.
[0064] S104. Semantically encode the original transaction text to obtain text semantic encoding data, add noise to the text semantic encoding data to obtain noisy semantic encoding data, and perform semantic restoration on the noisy semantic encoding data to obtain the de-sensitized transaction text corresponding to the original transaction text.
[0065] Among them, the text semantic encoding data refers to the encoding data obtained by taking the entire original transaction text as a sentence and used to represent the semantic information of the sentence.
[0066] The noisy semantic encoding data refers to the semantic encoding data obtained by adding noise to the text semantic encoding data.
[0067] The de-sensitized transaction text refers to the text obtained by hiding the privacy content in the original transaction text.
[0068] In some embodiments, the original transaction text can be semantically encoded by the encoder in the pre-trained encoding-decoding model to obtain text semantic encoding data. The text semantic encoding data can be added noise by a pre-configured processing tool with noise-adding ability to obtain noisy semantic encoding data, and then the noisy semantic encoding data can be semantically restored by the encoder in the pre-trained encoding-decoding model to obtain the de-sensitized transaction text corresponding to the original transaction text.
[0069] S106. Use a large language model to process the transaction based on the de-sensitized transaction text.
[0070] It can be understood that since the original transaction text can be the transaction text in the model training transaction scenario of the large language model or the transaction text in the model application transaction scenario of the large language model. When the de-sensitized transaction text is the de-sensitized text corresponding to the original transaction text in the above model training transaction scenario, the de-sensitized transaction text can be used as the training data of the large language model to be trained, so as to perform transaction processing for model training using the large language model to be trained. When the de-sensitized transaction text is the de-sensitized text corresponding to the original transaction text in the above model application transaction scenario, the large language model can be directly used to perform transaction processing for text Q&A on the de-sensitized transaction text.
[0071] The text processing method provided in the embodiments of this specification, after determining the original transaction text in the large language model transaction processing scenario, performs semantic encoding processing on the original transaction text to obtain text semantic encoding data, then performs noise addition processing on the text semantic encoding data to obtain noisy semantic encoding data, and further performs semantic restoration processing on the noisy semantic encoding data to obtain a desensitized transaction text that can hide the privacy information or sensitive content in the original transaction text and is semantically similar to the original transaction text. Thus, when using the large language model to perform transaction processing based on the desensitized transaction text, the privacy information or sensitive content in the original transaction text can be prevented from being leaked, achieving the effect of protecting the data privacy of the transaction text in the large model scenario.
[0072] Please refer to Figure 3 , which is a schematic flowchart of another embodiment of a text processing method provided in the embodiments of this specification. Specifically, the method may include the following steps:
[0073] S202. Determine the original transaction text in the large language model transaction processing scenario.
[0074] Specifically, for the implementation manner of step S202, please specifically refer to Figure 2 the description of the relevant steps in the embodiments shown, which will not be elaborated here.
[0075] S204. Use an encoding-decoding model to perform semantic encoding processing on the original transaction text to obtain text semantic encoding data.
[0076] Among them, the encoding-decoding model refers to a model with text restoration ability composed of an encoder and a decoder. It can be understood that when an input text is given to the encoding-decoding model, the encoding-decoding model can restore the same output text as the input text. The encoding-decoding model can be integrated locally in the electronic device and can be directly called and used by the electronic device.
[0077] In some embodiments, when performing step S204, it may specifically include the following steps:
[0078] A2: Use the encoder in the encoding-decoding model to perform word embedding processing on the original transaction text to obtain word embedding vectors, and perform context semantic encoding processing based on the word embedding vectors to obtain word-level context semantic encoding data;
[0079] A4: Perform sentence-level semantic aggregation processing based on the word-level context semantic encoding data to obtain text semantic encoding data.
[0080] In step A2, inside the encoder of the encoding and decoding model, first, the original transaction text is tokenized to obtain sub-word units, and then the sub-word units are subjected to word embedding processing to obtain word embedding vectors. Further, positional encoding is added to the word embedding vectors to obtain first embedding vectors. The first embedding vectors are processed through a multi-head self-attention mechanism to extract context information to obtain second embedding vectors. The second embedding vectors are processed through a feed-forward neural network to extract word semantics to obtain word-level context semantic encoding data. It can be understood that the word embedding vectors are a vector representation of the sub-word units; the first embedding vectors are vector representations with positional encoding added to the word embedding vectors; the second embedding vectors are obtained based on the first embedding vectors, and the second embedding vectors can include vectors for characterizing the context dependence relationships between each sub-word unit and other sub-word units; the word-level context semantic encoding data can include vector data for characterizing the semantic information and context information of each sub-word unit.
[0081] In step A4, the text semantic encoding data can be understood as the semantic encoding data of the sentence obtained by taking the original transaction text as a sentence. Specifically, performing step A4 can specifically include: performing sentence-level semantic aggregation processing on the word-level context semantic encoding data through the global pooling layer built in the encoder to obtain the text semantic encoding data.
[0082] Optionally, a sentence-level semantic aggregation process of the above global pooling layer can be: assuming that the word-level context semantic encoding data of the i-th sub-word unit is the first vector h i , the dimension of the first vector h i is d, calculate the average value of all first h i on each dimension k (the value range of k is 1 to d), and combine the average values of all dimensions into a first aggregation vector v, and this aggregation vector v is the text semantic encoding data. Another sentence-level semantic aggregation process of the global pooling layer can be: assuming that the word-level context semantic encoding data of the i-th sub-word unit is the first vector h i , the dimension of the first vector h i is d, determine the maximum value of all h i on each dimension k (the value range of k is 1 to d), and combine the maximum values of all dimensions into a second aggregation vector u, and this second vector u is the text semantic encoding data.
[0083] In the embodiments of this specification, the encoding and decoding model can be pre-trained. Specifically, refer to Figure 4 , which is a schematic flowchart of a training method for an encoding and decoding model provided in this specification. This training method can include the following steps:
[0084] S302, create an initial encoding and decoding model for the text transaction processing scenario.
[0085] S304. Obtain training transaction texts for the text transaction processing scenario, and label the training transaction texts with transaction text labels.
[0086] S306. Perform at least one round of model training on the initial encoder-decoder model based on the training transaction texts and the transaction text labels to obtain the encoder-decoder model after model training.
[0087] In step S302, create an initial encoder-decoder model for the text transaction processing scenario based on the neural network model. Optionally, the initial encoder-decoder model can be obtained by fine-tuning the parameters of the basic neural network according to the text transaction processing scenario.
[0088] In step S304, the training transaction texts can be transaction texts artificially constructed based on the text transaction processing scenario. After obtaining the training transaction texts, the expert-side service can be introduced based on the requirements of the text transaction processing scenario, and the training transaction texts can be labeled with transaction text labels by humans. The transaction text labels include texts that are the same as or similar in semantics to each training transaction text.
[0089] In step S306, input the training transaction texts into the initial encoder-decoder model for at least one round of model training to obtain predicted transaction texts. The predicted transaction texts are texts predicted by the initial encoder-decoder model that have the same or similar semantics as the training transaction texts. Determine the model loss value based on the predicted transaction texts and the transaction text labels using a loss function, and adjust the model parameters of the initial encoder-decoder model based on the model loss value until the model training conditions are met to obtain the encoder-decoder model.
[0090] Optionally, the loss function can be selected from cross-entropy loss, mean squared error loss, edit distance loss, cosine similarity loss, etc.
[0091] Optionally, the model end training conditions of the model can include, for example, that the value of the loss function is less than or equal to a preset loss function threshold, the number of iterations reaches a preset number threshold, etc. The specific model end training conditions can be determined based on the actual situation and are not specifically limited here.
[0092] It should be noted that the neural network models involved in one or more embodiments of this specification include, but are not limited to, the fitting of one or more of neural network models such as the Sequence-to-Sequence (Seq2Seq) model, the Transformer model, the Recurrent Neural Networks (RNN) model, the Bidirectional and Auto-Regressive Transformers (BART) model, and the Text-To-Text Transfer Transformer model.
[0093] S206. Obtain the privacy budget parameter corresponding to the original transaction text, determine the privacy data noise addition intensity based on the privacy budget parameter, and perform noise addition processing on the text semantic coding data based on the privacy data noise addition intensity to obtain the noise-added semantic coding data.
[0094] In some embodiments, the execution of obtaining the privacy budget parameter corresponding to the original transaction text may specifically include the following steps:
[0095] A2: Perform sensitive content detection processing on the original transaction text to obtain the text sensitivity, perform text analysis processing on the original transaction text to obtain the text semantic complexity, and determine the transaction application scenario corresponding to the original transaction text;
[0096] A4: Perform privacy budget allocation processing based on the text sensitivity, text semantic complexity, and transaction application scenario to obtain the privacy budget parameter.
[0097] In step A2, the text sensitivity can be used to characterize the sensitive degree of the privacy information in the original transaction text. It can be understood that when the original transaction text includes highly sensitive privacy information (such as phone numbers, addresses, names, etc.), the text sensitivity corresponding to the original transaction text is higher; when the original transaction text includes privacy information with a lower sensitive degree (such as cities, genders, etc.), the text sensitivity corresponding to the original transaction text is lower. Performing sensitive content detection processing on the original transaction text to obtain the text sensitivity, the specific implementation can be: adopting a preset sensitive content detection rule to identify the privacy information in the original transaction text, and determining the text sensitivity based on the privacy information.
[0098] In step A2, the text semantic complexity can be used to characterize the semantic complexity degree of the original transaction text. Performing text analysis processing on the original transaction text to obtain the text semantic complexity, the specific implementation can be: determining the grammatical structure, sentence length, and lexical richness of the original transaction text, and determining the text semantic complexity according to the grammatical structure, sentence length, and lexical richness.
[0099] In step A2, the transaction application scenario can be understood as determining the usage or function of the original transaction text in a specific environment.
[0100] To determine the transaction application scenario corresponding to the original transaction text, specifically, it can be: determining the transaction application scenario according to at least one of the content, text sensitivity, semantic complexity, and actual application requirements of the original transaction text. Among them, the actual application requirements can be determined according to the text description information input by the user for the original transaction text.
[0101] When performing step A4, it can specifically include: generating privacy detection prompt words based on text sensitivity, text semantic complexity, and transaction application scenario; and performing privacy budget allocation processing using a privacy detection large model based on the privacy detection prompt words to obtain privacy budget parameters.
[0102] It can be understood that the privacy budget parameter is a parameter used to control the differential privacy protection intensity. When the value of the privacy budget parameter is smaller, the privacy protection intensity is greater; when the value of the privacy budget parameter is larger, the privacy protection intensity is smaller.
[0103] It can be understood that generating privacy detection prompt words can specifically be: obtaining role description information, background description information, input prompt information, privacy detection task description information, and output description information, and generating privacy detection prompt words based on text sensitivity, text semantic complexity, transaction application scenario, role description information, background description information, input prompt information, privacy detection task description, and output description information. Among them, the role description information refers to the description information of the identity, responsibilities, or specific character image played by the large model, etc. The role description information is used to indicate the perspective, position, and style that the large model should follow when answering questions or performing tasks. The background description information refers to some pre-information, environmental description, relevant knowledge, or historical conversations related to the privacy detection task, etc. The background description information is used to provide the context and background of the problem for the large model to help the model better understand the ins and outs and related factors of the problem. The input prompt information refers to the prompt information used to describe the interpretation of text sensitivity, the interpretation of text semantic complexity, and the interpretation of text application scenario. The input prompt information is used to indicate the interpretation of text sensitivity, text semantic complexity, and transaction application scenario to facilitate the large model to understand these parameters. The privacy detection task description information refers to the task description information that instructs the large model to perform privacy detection task processing to obtain privacy budget parameters. The output description information refers to the requirements and specifications for the output content to be generated by the large model, including specific descriptions of the output format, structure, language style, length, etc.
[0104] In step A4, perform privacy budget allocation processing using a privacy detection large model based on privacy detection prompt words to obtain privacy budget parameters, which may specifically include: inputting the privacy detection prompt words into the privacy detection large model, determining a first weight for text sensitivity, a second weight for text semantic complexity, and a third weight for transaction application scenarios through the privacy detection large model, calculating a target privacy score for text sensitivity, text semantic complexity, and transaction application scenarios by weighted calculation using the first weight, the second weight, and the third weight through the privacy detection large model, and performing privacy budget allocation processing based on the target privacy score through the privacy detection large model to obtain privacy budget parameters. Among them, the target privacy score may be inversely proportional to the value of the privacy budget parameter. When the target privacy score is larger, the value of the privacy budget parameter is smaller, and when the target privacy score is smaller, the value of the privacy budget parameter is larger.
[0105] In some embodiments, determine the noise addition intensity for privacy data based on the privacy budget parameter, and perform noise addition processing on the text semantic coding data based on the noise addition intensity for privacy data to obtain noise-added semantic coding data, which may specifically include: obtaining a preset privacy protection algorithm, calculating the noise intensity based on the privacy budget parameter using the preset privacy protection algorithm to obtain the noise addition intensity, obtaining the noise type, generating a noise vector with the same dimension as the text semantic coding data according to the noise type and the noise addition intensity, and performing element-by-element addition processing on the noise vector and the text semantic coding data to obtain the noise-added semantic coding data. It can be understood that the preset privacy protection algorithm may include, but is not limited to, Renyi Differential Privacy (RDP), Gaussian Differential Privacy. The noise type may include one of the Gaussian noise type and the Laplace noise type.
[0106] In this way, the semantic coding data obtained by taking the entire original transaction text as a sentence is sentence-level semantic coding data, rather than word-level coding data. By adding noise to the sentence-level semantic coding data, the privacy content or sensitive content in the entire sentence is removed or hidden, thus achieving the desensitization effect at the sentence level.
[0107] S208, use an encoding-decoding model to perform semantic restoration processing on the noise-added semantic coding data to obtain a desensitized transaction text corresponding to the original transaction text.
[0108] In some embodiments, when performing step S208, it may specifically include: using the decoder in the encoding-decoding model to perform decoding conversion processing on the noise-added semantic coding data to obtain a vector to be decoded, and performing semantic restoration processing on the vector to be decoded to obtain a desensitized transaction text corresponding to the original transaction text.
[0109] It can be understood that the vector to be decoded refers to the vector obtained by converting the noisy semantic encoded data through vector conversion and is suitable for processing by the encoder. The specific way to obtain the vector to be decoded can be: inside the decoder in the encoding and decoding model, map the noisy semantic encoded data to a preset feature space to obtain the vector to be decoded.
[0110] Perform semantic restoration processing on the vector to be decoded to obtain the desensitized transaction text corresponding to the original transaction text. Specifically, it can be: inside the decoder in the encoding and decoding model, perform context modeling processing on the vector to be decoded to obtain a first context vector, perform weighted processing on the first context vector through an attention mechanism to obtain a second context vector, and gradually generate text according to the second context vector until the decoder generates a complete desensitized transaction text. During the process of the decoder gradually generating text, at each step, the decoder combines the second context vector and the generated text to generate the next word, and this process continues until the decoder generates a complete text sequence, and this complete text sequence is the desensitized transaction text corresponding to the original transaction text.
[0111] S210. Perform transaction processing on the desensitized transaction text using a large language model.
[0112] In some embodiments, performing step S210 may specifically include at least one of the following:
[0113] B2: Determine the large language model to be trained for the desensitized transaction text, and use the desensitized transaction text to perform model training processing on the large language model to be trained;
[0114] B4: Obtain the text processing large language model for the desensitized transaction text, input the desensitized transaction text into the text processing large language model, and perform text question and answer processing on the desensitized transaction text through the text processing large language model to obtain the target transaction text.
[0115] In step B2, the large language model to be trained can be a basic large model, and this basic large model can be a pre-trained large language model, such as large models in the GPT series, etc. Using the desensitized transaction text to perform model training processing on the large language model to be trained may specifically include: using the desensitized transaction text as sample data, annotating the corresponding transaction result labels for the sample data based on the large language model transaction processing scenario, using the sample data to perform at least one round of model training on the large language model to be trained. During the model training process, use the large language model to be trained to perform transaction prediction processing on the sample data to obtain the predicted transaction result, determine the model loss value based on the predicted transaction result and the transaction result label, and use the model loss value to perform model parameter adjustment on the large language model to be trained until the model training condition is met to obtain the trained target large language model corresponding to the large language model transaction processing scenario.
[0116] In step B4, the text processing large language model can be a general large model or a large model involving a specific transaction domain pre-trained for the large language model transaction processing scenario. Specifically, the desensitized transaction text can be used as a prompt to input into the text processing large language model to obtain the target transaction text through text question and answer processing by the text processing large language model. Or, if the original transaction text does not include a question statement, the target prompt can be generated by combining the desensitized transaction text with the question statement corresponding to the original transaction text, and the target prompt is input into the text processing large language model to obtain the target transaction text through text question and answer processing by the text processing large language model.
[0117] In the text processing method provided in the embodiments of this specification, after determining the original transaction text in the large language model transaction processing scenario, an encoding and decoding model is used to perform semantic encoding processing on the original transaction text to obtain the semantic representation data of the original transaction text, that is, semantic encoding data. Then, the privacy budget parameter corresponding to the original transaction text is obtained, the privacy data noise addition intensity is determined based on the privacy budget parameter, the text semantic encoding data is subjected to noise addition processing based on the privacy data noise addition intensity to obtain the noisy semantic encoding data, and then the encoding and decoding model is used to perform semantic restoration processing on the noisy semantic encoding data to obtain the desensitized transaction text corresponding to the original transaction text. Then, based on the desensitized transaction text, the large language model is used for transaction processing. In this way, the embodiments of this specification complete the encoding processing process of the original transaction text and the decoding processing process of the noisy semantic encoding data through a simple-structured encoding and decoding model, and can obtain a desensitized transaction text that can hide the privacy information or sensitive content in the original transaction text and is semantically similar to the original transaction text, avoiding the use of complex models with high computing power consumption. Therefore, the embodiments of this specification can use less computing power resources to protect the privacy content of transaction texts in the large model scenario.
[0118] The following will be combined with Figure 5 , and a detailed introduction will be given to the text processing device provided in the embodiments of this specification. It should be noted that Figure 5 The text processing device shown is used to execute the method of the embodiments of this specification Figures 2 to 4 shown. For the sake of convenience of description, only the parts related to the embodiments of this specification are shown. For the specific technical details not disclosed, please refer to the embodiments Figures 2 to 4 shown in this specification.
[0119] Please refer to Figure 5 , which shows a schematic structural diagram of the text processing device of the embodiments of this specification. The text processing device 1 can be implemented as all or part of the device through software, hardware, or a combination of both. According to some embodiments, the text processing device 1 includes a text determination module 11, a text desensitization module 12, and a text processing module 13, and is specifically used for:
[0120] A text determination module 11 for determining the original transaction text in the large language model transaction processing scenario;
[0121] A text desensitization module 12 for performing semantic encoding processing on the original transaction text to obtain text semantic encoding data, performing noise addition processing on the text semantic encoding data to obtain noise-added semantic encoding data, and performing semantic restoration processing on the noise-added semantic encoding data to obtain the desensitized transaction text corresponding to the original transaction text;
[0122] A text processing module 13 for performing transaction processing based on the desensitized transaction text using a large language model.
[0123] Optionally, the text desensitization module 12 includes:
[0124] A first desensitization unit for performing semantic encoding processing on the original transaction text using an encoding-decoding model to obtain text semantic encoding data;
[0125] A second desensitization unit for obtaining the privacy budget parameter corresponding to the original transaction text, determining the privacy data noise addition intensity based on the privacy budget parameter, and performing noise addition processing on the text semantic encoding data based on the privacy data noise addition intensity to obtain noise-added semantic encoding data;
[0126] A third desensitization unit for performing semantic restoration processing on the noise-added semantic encoding data using the encoding-decoding model to obtain the desensitized transaction text corresponding to the original transaction text.
[0127] Optionally, the second desensitization unit specifically includes:
[0128] A first desensitization processing subunit for performing sensitive content detection processing on the original transaction text to obtain text sensitivity, performing text analysis processing on the original transaction text to obtain text semantic complexity, and determining the transaction application scenario corresponding to the original transaction text;
[0129] A second desensitization processing subunit for performing privacy budget allocation processing based on the text sensitivity, the text semantic complexity, and the transaction application scenario to obtain a privacy budget parameter.
[0130] Optionally, the second desensitization processing subunit is specifically used for:
[0131] Generating a privacy detection prompt word based on the text sensitivity, the text semantic complexity, and the transaction application scenario;
[0132] Performing privacy budget allocation processing based on the privacy detection prompt word using a privacy detection large model to obtain a privacy budget parameter.
[0133] Optionally, the first desensitization unit includes:
[0134] The first encoding processing subunit is configured to perform word embedding processing on the original transaction text by using an encoder in an encoding-decoding model to obtain a word embedding vector, and perform context semantic encoding processing based on the word embedding vector to obtain word-level context semantic encoding data;
[0135] The second encoding processing subunit is configured to perform sentence-level semantic aggregation processing on the word-level context semantic encoding data to obtain text semantic encoding data.
[0136] Optionally, the third desensitization unit is specifically configured to:
[0137] Perform decoding conversion processing on the noisy semantic encoding data by using a decoder in the encoding-decoding model to obtain a vector to be decoded, and perform semantic restoration processing on the vector to be decoded to obtain a desensitized transaction text corresponding to the original transaction text.
[0138] Optionally, the text processing device 1 further includes:
[0139] The first model training module is configured to create an initial encoding-decoding model for a text transaction processing scenario;
[0140] The second model training module is configured to obtain training transaction texts for the text transaction processing scenario, and label transaction text labels for the training transaction texts;
[0141] The third model training module is configured to perform at least one round of model training on the initial encoding-decoding model based on the training transaction texts and the transaction text labels to obtain an encoding-decoding model after model training.
[0142] Optionally, the text processing module is specifically configured to:
[0143] Determine a large language model to be trained for the desensitized transaction text, and perform model training processing on the large language model to be trained by using the desensitized transaction text; and / or,
[0144] Obtain a text processing large language model for the desensitized transaction text, input the desensitized transaction text into the text processing large language model, and perform text question-answering processing on the desensitized transaction text by using the text processing large language model to obtain a target transaction text.
[0145] The text processing device provided in the embodiments of this specification, after determining the original transaction text in the large language model transaction processing scenario, performs semantic encoding processing on the original transaction text to obtain text semantic encoding data, then performs noise addition processing on the text semantic encoding data to obtain noisy semantic encoding data, and further performs semantic restoration processing on the noisy semantic encoding data to obtain a desensitized transaction text that can hide privacy information or sensitive content in the original transaction text and is semantically similar to the original transaction text. Thus, when using the large language model to perform transaction processing based on the desensitized transaction text, it is possible to avoid the leakage of privacy information or sensitive content in the original transaction text, achieving the effect of protecting the data privacy of the transaction text in the large model scenario.
[0146] Please refer to Figure 6 , which shows a schematic structural diagram of an electronic device provided by an exemplary embodiment of this specification. The electronic device in this specification may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected through the bus 150.
[0147] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts within the entire terminal, and by running or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and by calling data stored in the memory 120, it executes various functions of the terminal 100 and processes data. Optionally, the processor 110 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 110 may integrate a combination of one or several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem, etc. Among them, the CPU mainly processes the operating system, user interface, and application programs, etc.; the GPU is responsible for rendering and drawing the display content; the modem is used to process wireless communication. It can be understood that the above modem may not be integrated into the processor 110 and may be implemented separately through a communication chip.
[0148] The memory 120 may include a random access memory (RAM) and may also include a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area. Among them, the program storage area can store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The operating system can be an Android system, including a system developed based on the Android system in depth, an IOS system developed by Apple Inc., including a system developed based on the IOS system in depth, or other systems.
[0149] In order for the operating system to distinguish the specific application scenarios of third-party application programs, it is necessary to establish data communication between the third-party application programs and the operating system, so that the operating system can obtain the current scenario information of the third-party application programs at any time, and then perform targeted system resource adaptation based on the current scenario.
[0150] Among them, the input device 130 is used to receive input instructions or data. The input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone or a touch device. The output device 140 is used to output instructions or data. The output device 140 includes, but is not limited to, a display device and a speaker, etc. In one example, the input device 130 and the output device 140 can be integrated, and the input device 130 and the output device 140 are a touch display screen.
[0151] The touch display screen can be designed as a full-screen, a curved screen or a special-shaped screen. The touch display screen can also be designed as a combination of a full-screen and a curved screen, a combination of a special-shaped screen and a curved screen. The embodiments of this specification do not limit this.
[0152] In addition, those skilled in the art can understand that the structure of the electronic device shown in the above figures does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figures, or combine some components, or have different component arrangements. For example, the electronic device also includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a Bluetooth module, etc., which will not be elaborated here.
[0153] In some embodiments, Figure 6In the electronic device shown, the processor 110 can be used to call the program of the text processing method stored in the memory 120 and specifically perform the following operations:
[0154] Determine the original transaction text in the large language model transaction processing scenario;
[0155] Perform semantic encoding processing on the original transaction text to obtain text semantic encoding data, perform noise addition processing on the text semantic encoding data to obtain noisy semantic encoding data, and perform semantic restoration processing on the noisy semantic encoding data to obtain the de-sensitized transaction text corresponding to the original transaction text;
[0156] Perform transaction processing using the large language model based on the de-sensitized transaction text.
[0157] Optionally, when the processor 110 executes the steps of performing semantic encoding processing on the original transaction text to obtain text semantic encoding data, performing noise addition processing on the text semantic encoding data to obtain noisy semantic encoding data, and performing semantic restoration processing on the noisy semantic encoding data to obtain the de-sensitized transaction text corresponding to the original transaction text, it specifically performs the following operations:
[0158] Perform semantic encoding processing on the original transaction text using an encoding-decoding model to obtain text semantic encoding data;
[0159] Obtain the privacy budget parameter corresponding to the original transaction text, determine the privacy data noise addition intensity based on the privacy budget parameter, and perform noise addition processing on the text semantic encoding data based on the privacy data noise addition intensity to obtain noisy semantic encoding data;
[0160] Perform semantic restoration processing on the noisy semantic encoding data using the encoding-decoding model to obtain the de-sensitized transaction text corresponding to the original transaction text.
[0161] Optionally, when the processor 110 executes the step of obtaining the privacy budget parameter corresponding to the original transaction text, it specifically performs the following operations:
[0162] Perform sensitive content detection processing on the original transaction text to obtain text sensitivity, perform text analysis processing on the original transaction text to obtain text semantic complexity, and determine the transaction application scenario corresponding to the original transaction text;
[0163] Perform privacy budget allocation processing based on the text sensitivity, the text semantic complexity, and the transaction application scenario to obtain a privacy budget parameter.
[0164] Optionally, when the processor 110 executes the step of performing privacy budget allocation processing based on the text sensitivity, the text semantic complexity, and the transaction application scenario to obtain privacy budget parameters, it specifically performs the following operations:
[0165] Generate privacy detection prompt words based on the text sensitivity, the text semantic complexity, and the transaction application scenario;
[0166] Perform privacy budget allocation processing using a privacy detection large model based on the privacy detection prompt words to obtain privacy budget parameters.
[0167] Optionally, when the processor 110 executes the step of performing semantic encoding processing on the original transaction text using an encoding and decoding model to obtain text semantic encoding data, it specifically performs the following operations:
[0168] Perform word embedding processing on the original transaction text using the encoder in the encoding and decoding model to obtain word embedding vectors, and perform context semantic encoding processing based on the word embedding vectors to obtain word-level context semantic encoding data;
[0169] Perform sentence-level semantic aggregation processing based on the word-level context semantic encoding data to obtain text semantic encoding data.
[0170] Optionally, when the processor 110 executes the step of performing semantic restoration processing on the noisy semantic encoding data using the encoding and decoding model to obtain the desensitized transaction text corresponding to the original transaction text, it specifically performs the following operations:
[0171] Perform decoding conversion processing on the noisy semantic encoding data using the decoder in the encoding and decoding model to obtain a vector to be decoded, and perform semantic restoration processing on the vector to be decoded to obtain the desensitized transaction text corresponding to the original transaction text.
[0172] Optionally, the processor 110 also performs the following operations:
[0173] Create an initial encoding and decoding model for the text transaction processing scenario;
[0174] Obtain training transaction texts for the text transaction processing scenario, and label transaction text labels for the training transaction texts;
[0175] Perform at least one round of model training on the initial encoding and decoding model based on the training transaction texts and the transaction text labels to obtain the encoding and decoding model after model training.
[0176] Optionally, when the processor 110 executes the step of performing transaction processing on the desensitized transaction text using a large language model, it specifically performs the following operations:
[0177] Determine the large language model to be trained for the desensitized transaction text, and use the desensitized transaction text to perform model training processing on the large language model to be trained; and / or,
[0178] Obtain a text processing large language model for the desensitized transaction text, input the desensitized transaction text into the text processing large language model, and perform text question and answer processing on the desensitized transaction text through the text processing large language model to obtain a target transaction text.
[0179] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of this specification are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the original transaction text involved in this specification is obtained under the full authorization of the user.
[0180] The embodiments of this specification also provide a computer-readable storage medium, which stores at least one instruction for being executed by a processor to implement the text processing method as described in each of the above embodiments.
[0181] The embodiments of this specification also provide a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the text processing method as described in each of the above embodiments.
[0182] Those skilled in the art should be able to realize that in one or more of the above examples, the functions described in the embodiments of this specification can be implemented by hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, where communication media includes any medium that facilitates the transfer of a computer program from one place to another. The storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0183] The above are only optional embodiments of this specification and are not intended to limit this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of this specification shall be included within the protection scope of this specification.
[0184] The foregoing describes particular embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
Claims
1. A text processing method, the method comprising: Determine the original transaction text in the large language model transaction processing scenario; Perform semantic encoding processing on the original transaction text to obtain text semantic encoding data, perform noise addition processing on the text semantic encoding data to obtain noisy semantic encoding data, and perform semantic restoration processing on the noisy semantic encoding data to obtain the de-sensitized transaction text corresponding to the original transaction text; Perform transaction processing using a large language model based on the de-sensitized transaction text.
2. The method according to claim 1, wherein the performing semantic encoding processing on the original transaction text to obtain text semantic encoding data, performing noise addition processing on the text semantic encoding data to obtain noisy semantic encoding data, and performing semantic restoration processing on the noisy semantic encoding data to obtain the de-sensitized transaction text corresponding to the original transaction text, comprises: Perform semantic encoding processing on the original transaction text using an encoder-decoder model to obtain text semantic encoding data; Obtain the privacy budget parameter corresponding to the original transaction text, determine the privacy data noise addition intensity based on the privacy budget parameter, and perform noise addition processing on the text semantic encoding data based on the privacy data noise addition intensity to obtain noisy semantic encoding data; Perform semantic restoration processing on the noisy semantic encoding data using the encoder-decoder model to obtain the de-sensitized transaction text corresponding to the original transaction text.
3. The method according to claim 2, wherein the obtaining the privacy budget parameter corresponding to the original transaction text, comprises: Perform sensitive content detection processing on the original transaction text to obtain text sensitivity, perform text analysis processing on the original transaction text to obtain text semantic complexity, and determine the transaction application scenario corresponding to the original transaction text; Perform privacy budget allocation processing based on the text sensitivity, the text semantic complexity, and the transaction application scenario to obtain a privacy budget parameter.
4. The method according to claim 3, wherein the performing privacy budget allocation processing based on the text sensitivity, the text semantic complexity, and the transaction application scenario to obtain a privacy budget parameter, comprises: Generate a privacy detection prompt based on the text sensitivity, the text semantic complexity, and the transaction application scenario; Perform privacy budget allocation processing using a privacy detection large model based on the privacy detection prompt to obtain a privacy budget parameter.
5. The method according to claim 2, wherein the performing semantic encoding processing on the original transaction text using an encoder-decoder model to obtain text semantic encoding data, comprises: Perform word embedding processing on the original transaction text using the encoder in the encoder-decoder model to obtain word embedding vectors, and perform context semantic encoding processing based on the word embedding vectors to obtain word-level context semantic encoding data; Perform sentence-level semantic aggregation processing based on the word-level context semantic encoding data to obtain text semantic encoding data.
6. The method according to claim 2, wherein the performing semantic restoration processing on the noisy semantic encoding data using the encoder-decoder model to obtain the de-sensitized transaction text corresponding to the original transaction text, comprises: The decoder in the encoding and decoding model is used to perform decoding conversion processing on the noisy semantic encoded data to obtain a vector to be decoded, and perform semantic restoration processing on the vector to be decoded to obtain the desensitized transaction text corresponding to the original transaction text.
7. The method according to claim 2, the method further comprising: Create an initial encoding and decoding model for the text transaction processing scenario; Obtain training transaction texts for the text transaction processing scenario, and label transaction text tags for the training transaction texts; Based on the training transaction texts and the transaction text tags, perform at least one round of model training on the initial encoding and decoding model to obtain the encoding and decoding model after model training.
8. The method according to claim 1, the performing transaction processing using a large language model based on the desensitized transaction text includes: Determine a large language model to be trained for the desensitized transaction text, and perform model training processing on the large language model to be trained using the desensitized transaction text; and / or Obtain a text processing large language model for the desensitized transaction text, input the desensitized transaction text into the text processing large language model, and perform text question and answer processing on the desensitized transaction text through the text processing large language model to obtain the target transaction text.
9. A text processing device, the device comprising: A text determination module, configured to determine an original transaction text in a large language model transaction processing scenario; A text desensitization module, configured to perform semantic encoding processing on the original transaction text to obtain text semantic encoded data, perform noise addition processing on the text semantic encoded data to obtain noisy semantic encoded data, and perform semantic restoration processing on the noisy semantic encoded data to obtain the desensitized transaction text corresponding to the original transaction text; A text processing module, configured to perform transaction processing using a large language model based on the desensitized transaction text.
10. A computer storage medium, the computer storage medium stores multiple instructions, and the instructions are adapted to be loaded and executed by a processor to perform the method according to any one of claims 1 to 8.
11. A computer program product, the computer program product stores at least one instruction, and the at least one instruction is loaded and executed by a processor to perform the method according to any one of claims 1 to 8.
12. An electronic device, comprising: A processor and a memory; wherein, the memory stores a computer program, and the computer program is adapted to be loaded and executed by the processor to perform the method according to any one of claims 1 to 8.
Citation Information
Cited By
Enterprise project digital management and control method and equipment based on AI large model, and medium
CN120911778A