Sensitive information detection method based on large model, electronic device and storage medium

CN120407809BActive Publication Date: 2026-11-03AISPEECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510510296.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2026-11-03
Estimated Expiration
2045-04-22

AI Technical Summary

Technical Problem

Existing sensitive word identification methods cannot effectively handle guidance during multiple rounds of user input, resulting in large models outputting inappropriate sensitive information, and existing technologies cannot fully understand the user's context.

Method used

By acquiring a customized dataset, splitting it into first and second datasets, and training the large model using supervised fine-tuning and direct preference optimization training methods, the internal parameters were adjusted. Furthermore, by constructing a direct preference optimization training dataset through an improved deterministic finite state automaton algorithm and manual data verification, the ability of the large model to identify sensitive information was enhanced.

Benefits of technology

It improves the accuracy of sensitive information recognition in multi-turn dialogue scenarios of large models, reduces the possibility of misjudgment, and can better understand user context and output results that meet human expectations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407809B_ABST
    Figure CN120407809B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a sensitive information detection method based on a large model, an electronic device and a storage medium, comprising: obtaining a customized dataset, the customized dataset comprising a first dataset and a second dataset; using a supervised fine-tuning method to train and adjust internal parameters of an original large model using the first dataset to obtain a trained large model; inputting the second dataset into the trained large model for sensitive word detection to obtain data with detection errors for constructing direct preference optimization training data; and simultaneously using different datasets to perform direct preference optimization training and supervised fine-tuning training on the original large model, so that the trained large model can discriminate against input and output whether it is sensitive information and a specific sensitive information category.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of large model technology, and particularly relates to a sensitive information detection method, electronic device and storage medium based on large models. Background Technology

[0002] With the booming development of the internet, human-computer dialogue systems have become an indispensable part of people's daily lives and have been widely used in fields such as intelligent customer service, chatbots, and virtual assistants. With the rise of large-scale models, more and more dialogue systems are beginning to use large-scale models to replace traditional QA databases. Generally speaking, large-scale models are trained on a large amount of data and are highly aligned with human preferences, thus avoiding responses containing sensitive information. However, existing large-scale models are still easily influenced by user input in multiple rounds, resulting in the output of inappropriate content containing sensitive information. For example, a user might break down a question containing sensitive information into multiple sentences; these sentences themselves do not carry sensitive information, but they still achieve the original intent.

[0003] The existing methods for identifying sensitive words are mainly divided into two types: (1) Matching model, which identifies sensitive words by matching key sensitive words. However, this method cannot cope with the multiple rounds of user guidance and relies on the construction of a dictionary, which can only identify sensitive words in the dictionary; (2) Semantic model, which makes judgments by word embedding and model training. Although this method can parse the semantic meaning of the sentence to a certain extent, it still does not associate the context of the user input and only considers the current input.

[0004] After extensive training on human preferences, large-scale models possess a certain ability to identify sensitive information. Furthermore, their rich pre-training background allows them to deeply understand the user's context. Through carefully designed prompts and fine-tuning strategies, we can more fully activate the prior knowledge of large-scale models, thereby more accurately identifying sensitive information.

[0005] In view of the above problems, this invention uses a large model to identify sensitive words, and further enhances the large model's ability to identify sensitive words by using prompt word engineering and model fine-tuning, so that it can better understand the user's context and identify sensitive word information from it. Summary of the Invention

[0006] This invention provides a sensitive information detection method, electronic device, and storage medium based on a large model, which are used to solve at least one of the above-mentioned technical problems.

[0007] In a first aspect, embodiments of the present invention provide a sensitive information detection method based on a large model, comprising: acquiring a customized dataset, the customized dataset including a first dataset and a second dataset; using a supervised fine-tuning method to train and adjust the internal parameters of an original large model using the first dataset to obtain a trained large model; inputting the second dataset into the trained large model to perform sensitive word detection, and obtaining data of detection errors to construct a direct preference optimization training dataset; simultaneously performing direct preference optimization training and supervised fine-tuning training on the original large model using different datasets, so that the trained large model can discriminate against inputs and output whether they are sensitive information and the specific sensitive information category.

[0008] In a second aspect, embodiments of the present invention also provide an electronic device comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of the method described in the first aspect.

[0009] Thirdly, embodiments of the present invention also provide a storage medium storing a computer program thereon, characterized in that the computer program, when executed by a processor, implements the steps of the method described in the first aspect.

[0010] In the method of this application embodiment, a customized dataset is obtained, which is then divided into two parts to obtain a first dataset and a second dataset. After obtaining the original large model, supervised fine-tuning is used on the first training data to train the original large model according to standard data and adjust its internal parameters to obtain a trained large model. After obtaining the trained large model, the second dataset is input into the trained large model for sensitive word detection. The detected data is checked for errors such as non-sensitive words being judged as sensitive words or sensitive words being judged as normal words. These error detection data are integrated to obtain a training dataset for constructing direct preference optimization. After obtaining the direct preference optimization training dataset and the supervised fine-tuning training dataset, the untrained original large model is obtained. The original large model is simultaneously subjected to supervised fine-tuning training and direct preference optimization (DPO) training. Supervised fine-tuning training performs supervised learning on the training data. Direct preference optimization training receives paired decisions or outputs during the training process and is informed which one is more in line with human preferences, thereby enabling the model to produce behaviors or outputs that are more in line with human expectations. Once trained, the large model can discriminate based on the input, determining whether the output is sensitive information and the specific category of sensitive information. This allows it to learn and adapt quickly, reducing the possibility of misjudgment. Attached Figure Description

[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 A flowchart illustrating a sensitive information detection method based on a large model, as provided in an embodiment of the present invention; Figure 2 A flowchart illustrating another embodiment of a sensitive information detection method based on a large model, provided as an embodiment of the present invention; Figure 3 A flowchart of a sensitive information detection method based on a large model is provided for an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

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

[0014] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.

[0015] This invention can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, elements, data structures, etc., that perform a specific task or implement a specific abstract data type. This invention can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0016] In this invention, terms such as "module," "device," and "system" refer to relevant entities applied to a computer, such as hardware, combinations of hardware and software, software, or software in execution. More specifically, for example, an element can be, but is not limited to, a process running on a processor, a processor, an object, an executable element, an execution thread, a program, and / or a computer. Furthermore, an application program or script running on a server, and the server itself, can also be an element. One or more elements may be in an execution process and / or thread, and elements may be localized on a single computer and / or distributed across two or more computers, and may be run on various computer-readable media. Elements can also communicate via local and / or remote processes based on signals having one or more data packets, for example, signals from data interacting with another element in a local system, a distributed system, and / or interacting with other systems via signals over a network on the Internet.

[0017] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising" or "including" include not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0018] This invention provides a sensitive information detection method based on a large model, which can be applied to electronic devices. The electronic device can be a computer, server, or other electronic product, etc., and this invention does not limit this to any particular device.

[0019] Please refer to Figure 1 This illustrates a sensitive information detection method based on a large model provided by an embodiment of the present invention.

[0020] like Figure 1 As shown, in step 101, a customized dataset is obtained, which includes a first dataset and a second dataset; In step 102, a supervised fine-tuning method is used to train and adjust the internal parameters of the original large model using the first dataset to obtain the trained large model. In step 103, the second dataset is input into the trained large model for sensitive word detection, and the data of detection errors are used to construct a direct preference optimization training dataset. In step 104, the original large model is simultaneously trained using different datasets for direct preference optimization and supervised fine-tuning, so that the trained large model can discriminate the input and output whether it is sensitive information and the specific category of sensitive information.

[0021] In this embodiment, for step 101, a customized dataset is obtained, which includes a first dataset and a second dataset. For example, to obtain a customized dataset, the customized dataset is divided into two parts to obtain a first dataset and a second dataset. One part is used for training, and the other part is used to create a new dataset.

[0022] Then, for step 102, a supervised fine-tuning method is used to train and adjust the internal parameters of the original large model using the first dataset to obtain the trained large model. For example, after obtaining the original large model, supervised fine-tuning (SFT) is used on the first training data to train the original large model according to the standard data and adjust the internal parameters of the original large model to obtain the trained large model, so that the trained large model can minimize the difference between the predicted output and the actual label.

[0023] Then, for step 103, the second dataset is input into the trained large model for sensitive word detection, and the data of detection errors are used to construct the direct preference optimization training dataset. For example, after obtaining the trained large model, the second dataset is input into the trained large model for sensitive word detection, and the detected data is checked for errors such as non-sensitive words being judged as sensitive words or sensitive words being judged as normal words. These error detection data are integrated to obtain the data used to construct the direct preference optimization training dataset.

[0024] Finally, in step 104, the original large model is simultaneously trained using different datasets for both direct preference optimization (DPO) training and supervised fine-tuning training. This allows the trained large model to discriminate inputs and outputs, identifying whether the output is sensitive information and specifying the sensitive information category. For example, after obtaining the datasets for DPO training and supervised fine-tuning training, an untrained original large model is obtained. This original large model is then simultaneously trained using both supervised fine-tuning and DPO. Supervised fine-tuning training performs supervised learning on the training data. DPO training, on the other hand, receives paired decisions or outputs during training and is informed which one better aligns with human preferences, enabling the model to produce behaviors or outputs that better meet human expectations. The trained large model can then discriminate inputs and outputs, identifying whether the output is sensitive information and specifying the sensitive information category.

[0025] This embodiment's method acquires a customized dataset by splitting it into two parts: a first dataset and a second dataset. After obtaining the original large model, supervised fine-tuning is applied to the first training data to train the original large model on standard data and adjust its internal parameters, resulting in a trained large model. The second dataset is then input into the trained large model for sensitive word detection. The detected data is checked for errors, such as non-sensitive words being incorrectly identified as sensitive words or sensitive words being incorrectly identified as normal words. These error-detected data are integrated to obtain a training dataset for constructing Direct Preference Optimization (DPO). After obtaining the DPO training dataset and the supervised fine-tuning training dataset, the untrained original large model is obtained. Both supervised fine-tuning and DPO training are performed simultaneously on the original large model. Supervised fine-tuning training performs supervised learning on the training data. DPO training receives paired decisions or outputs during training and is informed which one better aligns with human preferences, enabling the model to produce behaviors or outputs that better meet human expectations. Once trained, the large model can discriminate based on the input, determining whether the output is sensitive information and the specific category of sensitive information. This allows it to learn and adapt quickly, reducing the possibility of misjudgment.

[0026] In some optional embodiments, the different datasets include a customized dataset and a direct preference optimization training dataset. The simultaneous use of different datasets for direct preference optimization training and supervised fine-tuning of the original large model includes: using the direct preference optimization training dataset to perform direct preference optimization training on the original large model; and simultaneously using the customized dataset to perform supervised fine-tuning training on the original large model. For example, the different datasets used for training include a customized dataset and a direct preference optimization training dataset. Different datasets are input into their respective training datasets to train the large model simultaneously, thereby ensuring that after training, the large model will discriminate the input and output whether it is sensitive information and the specific category of sensitive information.

[0027] In some optional embodiments, the step of acquiring the data of detection errors to construct the direct preference optimization training dataset includes: selecting the data of prediction errors from the output of the trained large model; constructing the direct preference optimization training dataset by adding multiple fields based on the data of prediction errors. For example, after acquiring the output data of the trained large model, the prediction error information is filtered out from the output data of the trained large model, fields are added based on the prediction error information, and the direct preference optimization training dataset is constructed based on the added fields.

[0028] In some optional embodiments, the plurality of fields include an identifier for words misjudged as sensitive words and a category of sensitive words that are incorrectly predicted, for example, an identifier REJECTION1 for words misjudged as sensitive words and a category of sensitive words that are incorrectly predicted REJECTION2.

[0029] Please refer to Figure 2 It shows a flowchart of another embodiment of a sensitive information detection method based on a large model provided in one embodiment of this application; like Figure 1 As shown, in step 201, the historically accumulated word library and the publicly available sensitive word library are obtained, and the sensitive words are clustered and summarized through a clustering model to obtain multiple categories of sensitive words. The corresponding sensitive word definitions and prompt words are written for the multiple categories of sensitive words respectively. In step 202, the return data is first filtered using an improved deterministic finite state automaton algorithm, and then second filtered using manual verification. In step 203, the data after secondary screening is augmented with a single round of dialogue and augmented with multiple rounds of dialogue. The data augmented with single rounds of dialogue, the data augmented with multiple rounds of dialogue, and the real sensitive data are stored in a fixed format to obtain the customized dataset.

[0030] In this embodiment, for step 201, the historically accumulated lexicon and the publicly available sensitive word lexicon are acquired. A clustering model is used to summarize and categorize the sensitive words into multiple categories. Corresponding sensitive word definitions and prompts are then written for each category. For example, a clustering model (TF-IDF+K-means) is used to combine the historically accumulated lexicon and the sensitive word lexicon to classify existing sensitive words, thereby acquiring different categories of sensitive words. Corresponding definitions and prompts are then written for each category, providing basic data support for subsequent steps. The different categories of sensitive words include at least abusive language, pornography, terrorism, illegal activities, political content, and other negative information; this application does not impose any limitations on this. Then, for step 202, the returned data is first filtered using an improved deterministic finite state automaton algorithm, and then second filtered through manual verification. For example, an improved deterministic finite state automaton algorithm (DFA) is used. Automaton filters the returned real data, and then further filters the filtered information through manual verification to obtain the second-filtered data. This avoids incorrectly segmenting and identifying normal words as sensitive words and ensures the accuracy of the data. Finally, for step 203, single-round dialogue augmentation and multi-round dialogue augmentation are performed on the second-filtered data. The single-round dialogue augmented data, multi-round dialogue augmented data, and real sensitive data are stored in a fixed format to obtain the customized dataset. For example, after obtaining the second-filtered data, multi-round dialogue augmentation and single-round dialogue augmentation are performed on the second-filtered data respectively to obtain the single-round augmented data and multi-round augmented data. The single-round augmented data, multi-round augmented data, and real sensitive data are arranged in a fixed format to obtain the customized dataset.

[0031] In some optional embodiments, the improved deterministic finite state automaton algorithm is: adding a whitelist mechanism to the original deterministic finite state automaton algorithm to avoid incorrectly segmenting and identifying normal words as sensitive words. For example, the improved deterministic finite state automaton algorithm refers to an algorithm improvement that adds a whitelist mechanism to the deterministic finite state automaton algorithm. This improvement can prevent some normal words from being incorrectly separated and identified as sensitive words.

[0032] In some optional embodiments, the single-round dialogue augmentation of the data after secondary screening includes: by combining a lexicon and real data, using prompt words to bypass the limitations of the large language model, and further generating some supplementary sensitive word data. For example, the single-round dialogue augmentation of the data after secondary screening uses a combination of a lexicon and real data, using prompt words to bypass the limitations of the large model, and further generating some supplementary sensitive word data, where the large language model refers to a large language model with 14B parameters.

[0033] In some optional embodiments, the specific steps of performing multi-turn dialogue augmentation on the data after secondary screening are as follows: the single-turn data augmented after secondary screening is decomposed using the large language model to obtain at least the multi-turn dialogue data with reference, the multi-turn dialogue data with omission, and the multi-turn dialogue data with rewritten form. For example, the single-turn data augmented after the second screening is decomposed using the large language model to generate multi-turn dialogue data including reference, omission, and rewritten form, thereby enriching the diversity of the dataset through multi-turn dialogue data with reference, omission, and rewritten form.

[0034] In some optional embodiments, the customized dataset includes the following fields: the prompt word defined by the sensitive word, the user's first round of questions, the system's first round of responses, the user's second round of questions, the system's second round of responses, the user's Nth round of questions, whether it is a sensitive word, the category of the sensitive word, and the sentence structure of the user's Nth round of questions, where N is a natural number greater than 1. For example, the fields are: the prompt word defined by the sensitive word, the user's first round of questions Q1, the system's first round of responses A1, the user's second round of questions Q2, the system's second round of responses Q2, and so on up to the user's Nth round of questions Qn, whether it is a sensitive word OUTPUT1, the category of the sensitive word OUTPUT2, and the sentence structure of Qn (declarative sentence, interrogative sentence, etc.).

[0035] Please refer to Figure 3 It shows a flowchart of a sensitive information detection method based on a large model provided by an embodiment of the present invention; like Figure 3 As shown, this invention proposes a method for sensitive information detection based on a large model, comprising the following steps: S1: Use a clustering model to classify and summarize the historically accumulated word library and the publicly available sensitive word library, resulting in five categories of sensitive words, and write corresponding definitions and prompts for these sensitive words; S2: The collected vocabulary is filtered using an improved Deterministic Finite Automaton (DFA) algorithm to select the real data from the returned data, and further filtered by manual verification. S3: Perform single-round dialogue augmentation on manually verified data, using a combination of a lexicon and real data to bypass the limitations of the large model through prompt words, and further generate some supplementary sensitive word data; S4: Perform single-round and multi-round dialogue augmentation on manually verified data. Use a large model to decompose the existing data, breaking down the single-round data into multi-round data, including data containing references, omissions, rewriting, etc. All of these multi-round data can ultimately yield the results of the single-round data. S5: Store real sensitive data, single-turn dialogue data augmented by large models, and multi-turn data augmented by large models in a fixed format to form a custom dataset, and divide the data into two parts, one part is used as training data, and the other part is used to create a new dataset. S6: Fine-tune the training of the large open-source model, and use the supervised fine-tuning (SFT) method on the training data to train and adjust the parameters inside the model; S7: Use the trained large model to judge another set of data, and select the data that were predicted incorrectly to construct new data with a fixed format, i.e., Direct Preference Optimization (DPO) training data; S8: Retrain the original model using both SFT and DPO training methods on their respective training data. After training, the large model will judge the input and output whether it is sensitive information and the specific category of sensitive information. As an implementation method of the present invention, in step S1, the existing sensitive words are first categorized using a combination of TF-IDF and K-means clustering models from both historically accumulated and publicly available sensitive word databases. Five categories of sensitive words are summarized, including abusive language, pornography, terrorism and illegal activities, political information, and other negative information. Subsequently, corresponding definitions and warning words are written for these sensitive words to provide basic data support for subsequent steps.

[0036] In step S2, an improved DFA algorithm is used to filter the returned real data from the collected lexicon. The improved DFA algorithm introduces a whitelist mechanism to avoid incorrectly segmenting and identifying normal words as sensitive words. The filtered data undergoes further verification and optimization through manual validation to ensure accuracy.

[0037] In step S3, the manually verified data is augmented through a single-turn dialogue. By combining a lexicon and real data, and utilizing prompts to circumvent the limitations of the large model, supplementary sensitive word data is generated. The large model used here is a large language model with 14 bytes of parameters.

[0038] In step S4, the manually verified data is further augmented with single-turn and multi-turn dialogues. The existing single-turn data is broken down using a large model to generate multi-turn dialogue data that includes referencing, ellipsis, and rewriting. These multi-turn data are logically equivalent to the single-turn data and ultimately yield the same results, thus enriching the diversity of the dataset.

[0039] In step S5, the real sensitive data, single-turn dialogue data augmented by the large model, and multi-turn data augmented by the large model are stored in a fixed format to form a customized dataset. The fixed format includes the following fields: prompt words defining sensitive words, the user's first-round question Q1, the system's first-round response A1, the user's second-round question Q2, the system's second-round response A2, and so on up to the user's Nth-round question Qn, whether it is a sensitive word OUTPUT1, the category of the sensitive word OUTPUT2, and the sentence structure of Qn (declarative, interrogative, etc.). Subsequently, the dataset is divided into two parts: one for training and the other for creating a new dataset.

[0040] In step S6, a large language model with 1.5B parameters is fine-tuned. The SFT method is used on the training data, and the model undergoes supervised learning based on the labeled data. Adjustments are made using the input data and its corresponding correct outputs to minimize the difference between the predicted output and the actual label.

[0041] In step S7, the trained large model is used to judge another set of data, and the data with incorrect predictions are selected to construct new data with a fixed format, namely DPO training data. The DPO training data is based on the fixed format of step S5, with the following fields added: REJECTION1, the identifier of the misjudged sensitive word, and REJECTION2, the category of the sensitive word with incorrect predictions.

[0042] In step S8, the original model is retrained using both SFT and DPO training methods. The SFT method performs supervised learning on the training data, while the DPO method receives paired decisions or outputs during training and is informed which one better aligns with human preferences, enabling the model to produce behaviors or outputs that more closely match human expectations. After training, the large model can discriminate inputs, outputting whether the output is sensitive information and its specific category. The method provided in this application applies a large model to the field of sensitive word recognition in multi-turn dialogues, improving the ability to identify sensitive words and reducing the error rate of misclassifying sensitive words, while better adapting to the complex scenarios of multi-turn dialogues. By introducing a large model, the method of this invention can capture deeper semantic information, thereby improving the accuracy of sensitive word recognition. Simultaneously, the powerful generalization ability of the large model allows the system to quickly learn and adapt when faced with newly emerging sensitive words, reducing the possibility of misclassification.

[0043] In some embodiments, the present invention provides a non-volatile computer-readable storage medium storing one or more programs including execution instructions, which can be read and executed by electronic devices (including but not limited to computers, servers, or network devices, etc.) to perform any of the above-described sensitive information detection methods based on large models of the present invention.

[0044] In some embodiments, the present invention also provides a computer program product, the computer program product including a computer program stored on a non-volatile computer-readable storage medium, the computer program including program instructions, which, when executed by a computer, cause the computer to perform any of the above-described sensitive information detection methods based on a large model.

[0045] In some embodiments, the present invention also provides an electronic device comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a sensitive information detection method based on a large model.

[0046] Figure 4 This is a schematic diagram of the hardware structure of an electronic device that performs a sensitive information detection method based on a large model, according to another embodiment of this application. Figure 4 As shown, the device includes: One or more processors 410 and memory 420, Figure 4 Take a processor 410 as an example.

[0047] The device for performing the sensitive information detection method based on a large model may also include an input device 430 and an output device 440.

[0048] The processor 410, memory 420, input device 430, and output device 440 can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.

[0049] The memory 420, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the sensitive information detection method based on a large model in the embodiments of this application. The processor 410 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions, and modules stored in the memory 420, thereby realizing the sensitive information detection method based on a large model in the above-described method embodiments.

[0050] The memory 420 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the large-scale sensitive information detection device. Furthermore, the memory 420 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 420 may optionally include memory remotely located relative to the processor 410, and these remote memories can be connected to the large-scale sensitive information detection device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0051] Input device 430 can receive input digital or character information, and generate signals related to user settings and function control of the large-scale sensitive information detection device. Output device 440 may include display devices such as a display screen.

[0052] The one or more modules are stored in the memory 420, and when executed by the one or more processors 410, they execute the sensitive information detection method based on a large model in any of the above method embodiments.

[0053] The above-described product can perform the methods provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects for performing the methods. Technical details not described in detail in this embodiment can be found in the methods provided in the embodiments of this application.

[0054] The electronic devices in this application embodiments exist in various forms, including but not limited to: (1) Mobile communication devices: These devices are characterized by their mobile communication capabilities and primarily aim to provide voice and data communication. These terminals include smartphones, multimedia phones, feature phones, and low-end phones.

[0055] (2) Ultra-mobile personal computer devices: These devices fall under the category of personal computers, possessing computing and processing capabilities, and generally also have mobile internet access features. These terminals include: PDAs, MIDs, and UMPCs, etc.

[0056] (3) Portable entertainment devices: These devices can display and play multimedia content. This category includes audio and video players, handheld game consoles, e-book readers, as well as smart toys and portable car navigation devices.

[0057] (4) Other airborne electronic devices with data interaction capabilities, such as vehicle-mounted systems installed on vehicles.

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

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

[0060] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A sensitive information detection method based on a large model, comprising: A customized dataset is obtained, comprising a first dataset and a second dataset. The process includes: acquiring a historically accumulated lexicon and a publicly available sensitive word lexicon; performing clustering analysis using a clustering model to derive multiple categories of sensitive words; and writing corresponding sensitive word definitions and prompts for each category; performing a first screening of the returned data using an improved deterministic finite state automaton algorithm, followed by a second screening through manual verification; performing single-round dialogue augmentation and multi-round dialogue augmentation on the data after the second screening; and storing the single-round dialogue augmentation data, multi-round dialogue augmentation data, and real sensitive data in a fixed format to obtain the customized dataset. The supervised fine-tuning method is used to train and adjust the internal parameters of the original large model using the first dataset to obtain the trained large model. The second dataset is input into the trained large model for sensitive word detection, and the data of detection errors are used to construct a direct preference optimization training dataset. The original large model is simultaneously trained using different datasets for direct preference optimization and supervised fine-tuning, enabling the trained large model to discriminate whether the input is sensitive information and the specific category of sensitive information. The different datasets include a customized dataset and a direct preference optimization training dataset. The process of simultaneously training the original large model using different datasets for direct preference optimization and supervised fine-tuning includes: performing direct preference optimization training on the original large model using the direct preference optimization training dataset; and simultaneously performing supervised fine-tuning training on the original large model using the customized dataset.

2. The method according to claim 1, wherein, The process of acquiring data to detect errors and using it to construct a direct preference optimization training dataset includes: Select the data that were predicted incorrectly from the output of the trained large model; Based on the data with the aforementioned prediction errors, several additional fields were added to construct a direct preference optimization training dataset.

3. The method according to claim 2, wherein, The multiple fields include identifiers for words misclassified as sensitive words and categories of sensitive words that were incorrectly predicted.

4. The method according to claim 1, wherein, The improved deterministic finite state automaton algorithm is as follows: a whitelist mechanism is added to the original deterministic finite state automaton algorithm to avoid incorrectly segmenting and identifying normal words as sensitive words.

5. The method according to claim 1, wherein, The single-round dialogue augmentation of the data after secondary screening includes: by combining the lexicon and real data, using prompt words to bypass the limitations of the large language model, and further generating some supplementary sensitive word data.

6. The method according to claim 1, wherein, The specific steps for multi-turn dialogue augmentation of the data after secondary screening are as follows: the single-turn data augmented after secondary screening is decomposed by a large language model to obtain at least the multi-turn dialogue data, the omitted multi-turn dialogue data, and the rewritten multi-turn dialogue data.

7. The method according to claim 1, wherein, The customized dataset includes the following fields: the prompt word defined by the sensitive word, the user's first round of questions, the system's first round of responses, the user's second round of questions, the system's second round of responses, the user's Nth round of questions, whether it is a sensitive word, the category of the sensitive word, and the sentence structure of the user's Nth round of questions, where N is a natural number greater than 1.

8. An electronic device comprising: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Automatic generation method and system for purchase technical specification book

    CN118569220A

  • Reinforcement learning buying and selling point prediction model training method based on historical experience

    CN119831073A