Sensitive information detection method based on large model, electronic equipment and storage medium
By conducting customized data set training and optimization of the large model, combined with improved algorithms and manual verification, the sensitivity of the large model in multiple rounds of dialogue scenarios is improved, and the problem of insufficient identification of users during multiple rounds of input in the existing technology is solved, and more accurate detection of sensitive information is achieved.
Patent Information
- Application Number
- CN202510510296.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-08-01
AI Technical Summary
The existing sensitive word recognition methods cannot effectively deal with the recognition of sensitive information during multiple rounds of input by users, especially the big model has shortcomings in understanding the user's context.
By acquiring customized data sets, segmenting them into first and second data sets, the big model is trained using supervised fine-tuning and direct preference optimization training methods, adjusting its internal parameters, and combining improved deterministic finite state automata algorithm and manual verification, the direct preference optimization training data set is built to improve the big model's ability to identify sensitive information.
It improves the recognition accuracy of sensitive information of the big model in multiple rounds of dialogue scenarios, reduces the possibility of misjudgment, enhances the understanding of user context, and can quickly learn and adapt to emerging sensitive words.
Smart Images

Figure CN120407809A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of large models, and particularly relates to a sensitive information detection method, an electronic device, and a storage medium based on a large model. Background Art
[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 models, more and more dialogue systems have started to use large models to replace the original QA question-and-answer libraries. Generally speaking, large models are trained with a large amount of data and highly aligned with human preferences, and can avoid replying to users' sensitive information. However, existing large models are still easily guided by users when facing multi-round user inputs, and thus output some inappropriate content containing sensitive information. For example, a user splits a question with sensitive information into multiple sentences, and these sentences themselves do not carry sensitive information, but the original intention of the words can still be achieved through these sentences.
[0003] Existing methods for identifying sensitive words are mainly divided into two types: (1) matching models, which identify by using the method of matching key sensitive words. However, this method cannot handle this kind of multi-round guidance from users and relies on the construction of a dictionary, and can only identify sensitive words in the dictionary; (2) semantic models, which are discriminated by means of word embedding and model training. Although this method can parse the semantic meaning in a sentence to a certain extent, it still does not associate the context of the user input and only considers the current input.
[0004] After a large amount of human preference learning and training, large models already have a certain ability to identify sensitive information. At the same time, their rich pre-training background enables them to deeply understand the context of users. Through carefully designed prompt words and fine-tuning strategies, we can more fully activate the prior knowledge of large models, thereby more accurately identifying sensitive information.
[0005] In view of the above problems, the present invention uses a large model to identify sensitive words, and on this basis, through the methods of prompt engineering and model fine-tuning, further strengthens the large model's identification of sensitive words, enabling it to better understand the context of users and identify sensitive word information from it. Summary of the Invention
[0006] Embodiments of the present invention provide a sensitive information detection method, an electronic device, and a storage medium based on a large model, which are used to solve at least one of the above technical problems.
[0007] In a first aspect, an embodiment of the present invention provides a sensitive information detection method based on a large model, including: obtaining a customized data set, where the customized data set includes a first data set and a second data set; using the method of supervised fine-tuning to train and adjust the internal parameters of the original large model by using the first data set, and obtaining a trained large model; inputting the second data set into the trained large model for sensitive word detection, and obtaining the data with detection errors for constructing a direct preference optimization training data set; performing direct preference optimization training and supervised fine-tuning training on the original large model simultaneously using different data sets, so that the trained large model can make a discrimination for the input, and output whether it is sensitive information and the specific category of sensitive information.
[0008] In a second aspect, an embodiment of the present invention further provides an electronic device, which includes: at least one processor, and a memory communicatively connected to the at least one processor, where the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the steps of the method in the first aspect.
[0009] In a third aspect, an embodiment of the present invention further provides a storage medium, on which a computer program is stored, and characterized in that the computer program, when executed by a processor, implements the steps of the method in the first aspect.
[0010] In the method of the embodiment of the present application, by obtaining a customized data set, the customized data set is split into two parts of data to obtain a first data set and a second data set. After obtaining the original large model, the original large model is trained in a supervised fine-tuning manner on the first training data, so that the original large model is trained according to the standard data, and the internal parameters of the original large model are adjusted to obtain the trained large model. After obtaining the trained large model, the second data set is input into the trained large model for sensitive word detection, and the detected data is checked for error information where non-sensitive words judged incorrectly are judged as sensitive words or sensitive words are judged as normal words. These information-detected error data are integrated to obtain a data set for constructing direct preference optimization training. After obtaining the data set for direct preference optimization training and the data set for supervised fine-tuning training, an untrained original large model is obtained, and the original large model is simultaneously subjected to supervised fine-tuning training and direct preference optimization (DPO) training. Through supervised fine-tuning training, supervised learning is carried out on the training data. Through direct preference optimization training, the model receives paired decisions or outputs during the training process and is informed which one of them is more in line with human preferences, so that the model can generate behaviors or outputs that are more in line with human expectations. The trained large model can make a judgment on the input, output whether it is sensitive information and the specific category of sensitive information, so as to be able to learn and adapt quickly and reduce the possibility of misjudgment. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0012] Figure 1 The flowchart of a method for detecting sensitive information based on a large model provided by an embodiment of the present invention; Figure 2 The flowchart of another embodiment of a method for detecting sensitive information based on a large model provided by an embodiment of the present invention; Figure 3 The flowchart of a method for detecting sensitive information based on a large model provided by an embodiment of the present invention; Figure 4 The schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0013] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0014] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments may be combined with each other.
[0015] The present invention may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention may also be practiced in a distributed computing environment where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media including storage devices.
[0016] In the present invention, "module", "device", "system", etc. refer to relevant entities applied to a computer, such as hardware, a combination of hardware and software, software, or software in execution. Specifically, for example, a component may, but is not limited to, be a process running on a processor, a processor, an object, an executable component, an execution thread, a program, and / or a computer. Also, an application program or a script program running on a server, and the server may both be components. One or more components may be in a process and / or thread in execution, and the components may be localized on one computer and / or distributed between two or more computers, and may be run by various computer-readable media. The components may also communicate through local and / or remote processes according to a signal having one or more data packets, for example, a signal from data that interacts with another component in a local system, a distributed system, and / or interacts with other systems through a network in the Internet.
[0017] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising" and "including" not only include those elements, but also other elements not explicitly listed, or elements inherent to such a process, method, article, or device. Without further limitation, an element defined by the statement "comprising..." does not exclude the existence of additional identical elements in the process, method, article, or device that includes the said element.
[0018] An embodiment of the present invention provides a method for detecting sensitive information based on a large model, and this method can be applied to an electronic device. The electronic device can be a computer, a server, or other electronic products, etc., and the present invention does not make any limitations in this regard.
[0019] Please refer to Figure 1 , which shows a method for detecting sensitive information based on a large model provided by an embodiment of the present invention.
[0020] As Figure 1 shown, in step 101, a customized data set is obtained, and the customized data set includes a first data set and a second data set; In step 102, the internal parameters of the original large model are trained and adjusted using the first data set by means of supervised fine-tuning to obtain a trained large model; In step 103, the second data set is input into the trained large model for sensitive word detection, and the data with detection errors is obtained for constructing a direct preference optimization training data set; In step 104, the original large model is simultaneously trained using different data sets for direct preference optimization training and supervised fine-tuning training, so that the trained large model can make a discrimination for 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 data set is obtained, and the customized data set includes a first data set and a second data set. For example, a customized data set is obtained, and the customized data set is split into two parts of data to obtain a first data set and a second data set, one for training and the other for making a new data set.
[0022] Then, for step 102, the internal parameters of the original large model are trained and adjusted using the first dataset by means of supervised fine-tuning to obtain the trained large model. For example, after obtaining the original large model, the supervised fine-tuning (SFT, Supervised Fine-Tuning) method 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, so as to obtain the trained large model, enabling the trained large model to 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 misdetected data is obtained for constructing 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 error information where non-sensitive words are misjudged as sensitive words or sensitive words are misjudged as normal words. These misdetected data are integrated to obtain the data for constructing the direct preference optimization training dataset.
[0024] Finally, for step 104, the original large model is simultaneously trained using different datasets for direct preference optimization training and supervised fine-tuning training, so that the trained large model can discriminate against the input and output whether it is sensitive information and the specific category of sensitive information. For example, after obtaining the datasets for direct preference optimization training and supervised fine-tuning training, the untrained original large model is obtained, and the original large model is simultaneously subjected to supervised fine-tuning training and direct preference optimization (DPO, Direct Preference Optimization) training. Through supervised fine-tuning training, supervised learning is carried out on the training data. Through direct preference optimization training, the model receives pairs of decisions or outputs during the training process and is informed which one of them is more in line with human preferences, enabling the model to generate behaviors or outputs that are more in line with human expectations. The trained large model can discriminate against the input and output whether it is sensitive information and the specific category of sensitive information.
[0025] The method of this embodiment obtains a customized dataset, divides the customized dataset into two parts of data to obtain a first dataset and a second dataset, obtains an original large model, and uses supervised fine-tuning on the first training data to train the original large model according to standard data and adjust the internal parameters of the original large model 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, and the detected data is checked for error information where non-sensitive words with incorrect judgments are judged as sensitive words or sensitive words are judged as normal words. These information detection error data are integrated to obtain a dataset for constructing direct preference optimization training. After obtaining the datasets for direct preference optimization training and supervised fine-tuning training, an untrained original large model is obtained, and the original large model is simultaneously subjected to supervised fine-tuning training and direct preference optimization (DPO) training. Through supervised fine-tuning training, supervised learning is performed on the training data. Through direct preference optimization training, paired decisions or outputs are received during the training process and informed which one is more in line with human preferences, so that the model can generate behaviors or outputs that are more in line with human expectations. The trained large model can make a judgment on the input, output whether it is sensitive information and the specific category of sensitive information, so as to be able to learn and adapt quickly and reduce 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 training of the original large model includes: using the direct preference optimization training dataset to perform direct preference optimization training on the original large model; simultaneously using the customized dataset to perform supervised fine-tuning training on the original large model. For example, the different datasets for training include a customized dataset and a direct preference optimization training dataset. The different datasets are input into the corresponding training to simultaneously train the large model, so as to ensure that after training, the large model will make a judgment on the input and output whether it is sensitive information and the specific category of sensitive information.
[0027] In some optional embodiments, the obtaining of the data with detection errors for constructing the direct preference optimization training dataset includes: selecting the data with incorrect predictions from the output of the trained large model; constructing the direct preference optimization training dataset by adding multiple fields based on the data with incorrect predictions. For example, after obtaining the output data of the trained large model, the incorrect prediction information is screened out from the output data of the trained large model, fields are added according to the incorrect prediction information, and the direct preference optimization training dataset is constructed according to the added fields.
[0028] In some alternative embodiments, the multiple fields include an identifier misjudged as a sensitive word and a sensitive word category with a prediction error. For example, the identifier REJECTION1 misjudged as a sensitive word and the sensitive word category REJECTION2 with a prediction error.
[0029] Please refer to Figure 2 , which shows a flowchart of another embodiment of a sensitive information detection method based on a large model provided by an embodiment of the present application; As Figure 1 shown, in step 201, a historically accumulated word library and a publicly available sensitive word library are obtained, and multiple categories of sensitive words are obtained through clustering and summarization by a clustering model, and 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 screened by an improved deterministic finite state automaton algorithm and secondarily screened by manual verification; In step 203, single-round dialogue amplification is performed on the data after the secondary screening, and multi-round dialogue amplification is performed on the data after the secondary screening. The data amplified by the single-round dialogue, the data amplified by the multi-round dialogue, and the real sensitive data are stored in a fixed format, so as to obtain the customized data set.
[0030] In this embodiment, for step 201, the historically accumulated word library and the publicly available sensitive word library are obtained, and clustering and summarization are performed through a clustering model to obtain sensitive words of multiple categories, and corresponding sensitive word definitions and prompt words are respectively compiled for the sensitive words of the multiple categories. For example, by combining the historically accumulated word library and the sensitive word library through a clustering model (TF-IDF + K-means), the existing sensitive words are classified, and sensitive words of different categories are obtained, and corresponding definitions and prompt words are compiled for the sensitive words of different categories, so as to provide basic data support for the subsequent steps. Among them, the sensitive words of different categories at least include abuse, porn, violent terror and prohibited items, politics, and other negative information, and this application has no limitation on this. Then, for step 202, the return data is first screened through an improved deterministic finite state automaton algorithm, and secondary screening is performed through manual verification. For example, the return real data is screened through an improved deterministic finite state automaton algorithm (DFA, Deterministic Finite Automaton), and the screened information is further screened through manual verification to obtain the data after the second screening, so as to avoid mis-segmenting and identifying normal words as sensitive words and ensure the accuracy of the data. Finally, for step 203, single-round dialogue amplification is performed on the data after the second screening, and multi-round dialogue amplification is performed on the data after the second screening. The data amplified by single-round dialogue, the data amplified by multi-round dialogue, and the real sensitive data are stored in a fixed format, so as to obtain the customized data set. For example, after obtaining the data after the second screening, multi-round dialogue amplification and single-round dialogue amplification are respectively performed on the data after the second screening to obtain the data amplified by single-round and the data amplified by multi-round. The data amplified by single-round, the data amplified by multi-round, and the real sensitive data are arranged in a fixed format to obtain the customized data set.
[0031] In some alternative embodiments, the improved deterministic finite state automaton algorithm is: adding a whitelist mechanism to the original deterministic finite state automaton algorithm to avoid mis-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. Through this improvement, some normal words can be prevented from being wrongly separated and judged as sensitive words.
[0032] In some alternative embodiments, the single-round dialogue amplification of the data after the second screening includes: by combining the word library and the real data, using the prompt words to bypass the limitations of the large language model, and further generating some supplementary sensitive word data. For example, for the single-round dialogue amplification of the data after the second screening, the word library and the real data are combined, and the limitations of the large model are bypassed through the prompt words, and some supplementary sensitive word data are further generated, where the large language model refers to a large language model with a parameter scale of 14B.
[0033] In some alternative embodiments, the specific steps for performing multi-round dialogue amplification on the data after secondary screening are as follows: The large language model disassembles the amplified single-round data after secondary screening, so as to obtain at least anaphoric multi-round dialogue data, elliptical multi-round dialogue data, and rewritten multi-round dialogue data. For example, the large language model disassembles the amplified single-round data after the second screening to generate multi-round dialogue data including anaphora, ellipsis, rewriting, etc. Thus, the diversity of the data set is enriched through anaphoric, elliptical, rewritten and other multi-round dialogue data.
[0034] In some alternative embodiments, the customized data set includes the following fields: the prompt words defined by the sensitive words, the user's first-round question, the system's first-round reply, the user's second-round question, the system's second-round reply, the user's Nth-round question, whether it is a sensitive word, the category of the sensitive word, and the sentence pattern of the user's Nth-round question, where N is a natural number greater than 1. For example, the fields are: the prompt words defined by the sensitive words, the user's first-round question Q1, the system's first-round reply A1, the user's second-round question Q2, the system's second-round reply Q2... and so on 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 pattern of Qn (declarative sentence, interrogative sentence, etc.).
[0035] Please refer to Figure 3 , which shows a flowchart of a method for detecting sensitive information based on a large model provided by an embodiment of the present invention; As Figure 3 shown, the present invention proposes a method for detecting sensitive information based on a large model, including the following steps: S1: Use a clustering model to classify and summarize the historically accumulated word library and the publicly available sensitive word library, and a total of five categories of sensitive words are obtained, and corresponding definitions and prompt words are compiled for these sensitive words; S2: Screen the real data flowing back through the improved deterministic finite state automaton algorithm (DFA, Deterministic Finite Automaton) algorithm for the collected word library, and further screen through manual verification; S3: Perform single-round dialogue amplification on the manually verified data, use the method of combining the word library and real data, 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 amplification on the manually verified data, use the large model to disassemble the existing data, disassemble the single-round data into multi-round data, including disassembling into those containing anaphora, ellipsis, rewriting, etc. These multi-round data can finally obtain the results of the single-round data; S5: Store the real sensitive data, the single-round conversation data amplified by the large model, and the multi-round data amplified by the large model in a fixed format to form a customized data set, and divide the data into two parts, one part is used as training data, and the other part is used to create a new data set; S6: Fine-tune and train the open-source large model, and use the method of supervised fine-tuning (SFT) on the training data to train and adjust the internal parameters of the model; S7: Use the trained large model to judge the other part of the data, and select the data with incorrect predictions from it to construct new data in a fixed format, that is, the direct preference optimization (DPO) training data; S8: Retrain the original model, and use both SFT and DPO training methods to train on their respective training data. After training, the large model will discriminate against 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, first, for the historically accumulated sensitive word library and the publicly available sensitive word library, the existing sensitive words are classified using the method of combining the clustering model TF-IDF + K-means, and five categories of sensitive words are summarized, including abuse, porn, violence, terrorism, prohibited items, politics, and other negative information. Subsequently, corresponding definitions and prompt words are written for these sensitive words to provide basic data support for the subsequent steps.
[0036] In step S2, for the collected word library, an improved DFA algorithm is used to screen the real data in the return flow. The improved DFA algorithm introduces a whitelist mechanism on the original basis to avoid mis-segmenting and identifying normal words as sensitive words. The screened data is further verified and optimized through manual verification to ensure the accuracy of the data.
[0037] In step S3, single-round conversation amplification is performed on the data verified manually. By combining the word library and the real data, the limitations of the large model are bypassed using prompt words to further generate some supplementary sensitive word data. The large model used here is a large language model with a parameter scale of 14B.
[0038] In step S4, continue to perform single-round and multi-round conversation amplification on the data verified manually. The large model is used to disassemble the existing single-round data to generate multi-round conversation data including reference, ellipsis, rewriting, etc. These multi-round data are logically equivalent to the single-round data and can ultimately obtain the results of the single-round data, thus enriching the diversity of the data set.
[0039] In step S5, the real sensitive data, the single-round dialogue data amplified by the large model, and the multi-round data amplified by the large model are stored in a fixed format to form a customized data set. The fixed format includes the following fields: the prompt words defined by 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 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 pattern of Qn (declarative sentence, interrogative sentence, etc.). Subsequently, the data set is divided into two parts, one for training and the other for making a new data set.
[0040] In step S6, fine-tuning training is performed on a large language model with a parameter scale of 1.5B. The SFT method is used on the training data, and the model performs supervised learning based on the labeled data, adjusting through the input data and its corresponding correct output to minimize the difference between the predicted output and the actual label.
[0041] In step S7, the trained large model is used to judge the other data, and the data with incorrect predictions is selected from it to construct new fixed-format data, that is, DPO training data. Based on the fixed format in step S5, the DPO training data adds the following fields: the identifier REJECTION1 misjudged as a sensitive word and the category of the sensitive word with incorrect prediction REJECTION2.
[0042] In step S8, the original model is retrained, using both the 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 the training process and is informed which one of them is more in line with human preferences, so that the model can produce behaviors or outputs more in line with human expectations. After training is completed, the large model can discriminate against the input and output whether it is sensitive information and the specific category of sensitive information. The method provided in this application applies the large model to the field of sensitive word recognition in multi-round dialogues, which can improve the ability to recognize sensitive words and reduce the error rate of misjudging sensitive words, and can better adapt to the complex scenarios of multi-round dialogues. By introducing the large model, the method of the present invention can capture deeper semantic information, thereby improving the recognition accuracy of sensitive words. At the same time, the powerful generalization ability of the large model enables the system to quickly learn and adapt when facing newly emerging sensitive words, reducing the possibility of misjudgment.
[0043] In some embodiments, the embodiments of the present invention provide a non-volatile computer-readable storage medium, in which one or more programs including execution instructions are stored, and the execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to be used to execute any one of the above-mentioned large model-based sensitive information detection methods of the present invention.
[0044] In some embodiments, the embodiments of the present invention further provide a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium. The computer program includes program instructions that, when executed by a computer, cause the computer to execute any one of the above-mentioned large model-based sensitive information detection methods.
[0045] In some embodiments, the embodiments of the present invention further provide an electronic device, which includes: 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, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the large model-based sensitive information detection method.
[0046] Figure 4 is a schematic hardware structure diagram of an electronic device for executing the large model-based sensitive information detection method provided by another embodiment of the present application, as Figure 4 shown, the device includes: one or more processors 410 and a memory 420, Figure 4 Taking one processor 410 as an example.
[0047] The device for executing the large model-based sensitive information detection method may further include: an input device 430 and an output device 440.
[0048] The processor 410, the memory 420, the input device 430 and the output device 440 may be connected by a bus or other means, Figure 4 Taking connection by bus as an example.
[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 large model-based sensitive information detection method in the embodiments of the present 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, that is, implements the large model-based sensitive information detection method in the above method embodiments.
[0050] The memory 420 may include a program storage area and a data storage area. The program storage area may store an operating system and application programs required for at least one function. The data storage area may store data created according to the use of the sensitive information detection device of the large model, etc. In addition, the memory 420 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 420 may optionally include a memory remotely provided with respect to the processor 410, and these remote memories may be connected to the sensitive information detection device of the large model through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0051] The input device 430 may receive input digital or character information and generate signals related to user settings and function controls of the sensitive information detection device of the large model. The output device 440 may include a display device 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, execute the method for detecting sensitive information based on a large model in any of the above method embodiments.
[0053] The above product may execute the method provided in the embodiments of the present application and has corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in this embodiment, reference may be made to the method provided in the embodiments of the present application.
[0054] The electronic device in the embodiments of the present application exists in various forms, including but not limited to: (1) Mobile communication devices: These devices are characterized by having mobile communication functions and mainly aim to provide voice and data communication. Such terminals include: smart phones, multimedia phones, functional phones, and low-end phones, etc.
[0055] (2) Ultra-mobile personal computer devices: These devices belong to the category of personal computers, have computing and processing functions, and generally also have the characteristic of mobile Internet access. Such terminals include: PDAs, MIDs, and UMPC devices, etc.
[0056] (3) Portable entertainment devices: These devices can display and play multimedia content. Such devices include: audio and video players, handheld game consoles, e-books, and smart toys and portable vehicle navigation devices.
[0057] (4) Other airborne electronic devices with data interaction functions, such as in-vehicle device installed on a vehicle.
[0058] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0059] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution or the part that contributes 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 for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment 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 the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of each embodiment of the present application.
Claims
1. A sensitive information detection method based on a large model, including obtaining a customized dataset, where the customized dataset includes a first dataset and a second dataset; using the method of supervised fine-tuning to train and adjust the internal parameters of the original large model using the first dataset, and obtaining the trained large model; inputting the second dataset into the trained large model for sensitive word detection, and obtaining the misdetected data for constructing a direct preference optimization training dataset; simultaneously using different datasets for direct preference optimization training and supervised fine-tuning training on the original large model, so that the trained large model can make a discrimination for the input, and output whether it is sensitive information and the specific sensitive information category.
2. The method according to claim 1, wherein 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 training on the original large model includes: performing direct preference optimization training on the original large model using the direct preference optimization training dataset; simultaneously performing supervised fine-tuning training on the original large model using the customized dataset.
3. The method according to claim 2, wherein The obtaining of the misdetected data for constructing a direct preference optimization training dataset includes: selecting the mispredicted data from the output of the trained large model; constructing a direct preference optimization training dataset by adding multiple fields based on the mispredicted data.
4. The method according to claim 3, wherein, The multiple fields include the identification misjudged as a sensitive word and the sensitive word category with a misprediction.
5. The method according to claim 1, wherein The steps of obtaining the customized dataset include: obtaining the historically accumulated word library and the publicly available sensitive word library, clustering and summarizing through a clustering model to obtain sensitive words in multiple categories, and writing corresponding sensitive word definitions and prompt words for the sensitive words in multiple categories respectively; performing a first screening on the reflux data through an improved deterministic finite state automaton algorithm, and performing a second screening through manual verification; performing single-round dialogue amplification on the data after the second screening and performing multi-round dialogue amplification on the data after the second screening, and storing the single-round dialogue amplified data, multi-round dialogue amplified data and real sensitive data in a fixed format, so as to obtain the customized dataset.
6. The method according to claim 5, wherein, The improved deterministic finite state automaton algorithm is: adding a whitelist mechanism to the original deterministic finite state automaton algorithm to avoid mis-segmenting and misidentifying normal words as sensitive words.
7. The method according to claim 5, wherein, The performing of single-round dialogue amplification on the data after the second screening includes: by combining the word library and real data, using the prompt words to bypass the limitations of the large language model, and further generating some supplementary sensitive word data.
8. The method according to claim 5, wherein, The specific steps of performing multi-round dialogue amplification on the data after the second screening are as follows: disassembling the amplified single-round data after the second screening through the large language model, so as to obtain at least the referring multi-round dialogue data, the omitted multi-round dialogue data and the rewritten multi-round dialogue data.
9. The method according to claim 1 or 5, wherein The customized dataset includes the following fields: the prompt words defined by the sensitive words, the user's first-round question, the system's first-round response, the user's second-round question, the system's second-round response, the user's Nth-round question, whether it is a sensitive word, the category of the sensitive word, and the sentence pattern of the user's Nth-round question, where N is a natural number greater than 1.
10. 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, and the instructions are executed 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 2 to 9.
Citation Information
Patent Citations
Automatic generation method and system for purchase technical specification book
CN118569220A
DPO-Tune method for fine tuning and reasoning stages of pre-trained large language model
CN119204156A
Metadata processing method, computer equipment and readable storage medium
CN119783637A
RLHF-based large language model generation content privacy protection method
CN119830350A
Reinforcement learning buying and selling point prediction model training method based on historical experience
CN119831073A