A sensitive information analysis and identification method, system, device and readable storage medium
By using the technology of large language model and embedded model, combined with the hybrid search method, the existing sensitive information recognition technology has solved the problem of poor scalability and generalization of the recognition of synonymous substitution and obscure expressions and the recognition of new sensitive information, and achieved the High accuracy and strong generalization ability to identify sensitive information.
Patent Information
- Application Number
- CN202411260567.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-09-10
AI Technical Summary
Existing sensitive information recognition technologies are difficult to accurately identify synonymous replacement, obscure expression, etc., and the identification of new sensitive information requires manual remodeling or labeling of a large number of new samples, which has the problem of poor scalability and generalization.
The sample generation technology of large language models, the small sample learning technology of embedded models and the mixed search technology are used to complete the sensitive point analysis and identification tasks through a small number of seed samples and sensitive point descriptions.
It greatly improves the accuracy of sensitive information recognition and has strong generalization capabilities, which can maintain high levels of performance under different parameter settings and data characteristics.
Smart Images

Figure CN118779458B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information identification technology, and more specifically to a sensitive information analysis and identification method, system, device and readable storage medium. Background Art
[0002] At present, with the popularization of the Internet and the acceleration of the digitalization process, data security and privacy protection issues are increasingly valued. The development of technologies such as big data, cloud computing, and artificial intelligence has made the acquisition, storage, and processing of information more convenient and efficient. However, the advancement of these technologies has also brought risks of data leakage and privacy infringement. Most sensitive information leakage incidents are caused by internal threats and omissions when transmitting information with partners. Massive sensitive information has been leaked through various channels. Traditional methods have been difficult to deal with. Automated and intelligent sensitive information identification technology has become an inevitable choice.
[0003] The current sensitive information identification technology is mainly aimed at text information. Even if the carrier of the leaked information is a picture, video or audio, they can all be converted into text for unified analysis and identification. Therefore, the use of natural language processing technology is currently a commonly used solution, including the following technologies:
[0004] 1. Keyword matching technology: Keyword matching predefines a series of sensitive words or phrases and matches the text word by word to identify sensitive information. This method requires a pre-set word library, has poor flexibility, is prone to missing synonyms or new sensitive information, and has limited recognition effect.
[0005] 2. Rule matching technology: Rule matching technology analyzes text based on pre-set rules. These rules can include regular expressions, pattern matching and other methods. For example, when identifying sensitive information such as ID card numbers and credit card numbers, corresponding format rules can be set. This method relies on a manually defined rule base and is suitable for sensitive information with a fixed structure. It has poor scalability and is less effective for unstructured semantic information.
[0006] 3. Semantic analysis technology: Semantic analysis technology uses machine learning models to label text at the semantic level to identify sensitive information. This method requires the collection of a large amount of corresponding annotated data according to different tasks, and the model performance is affected by the data quality. Models trained in a specific field are difficult to directly apply to other fields and have poor field adaptability.
[0007] 4. File similarity calculation technology: This technology uses text vectorization technology to calculate the similarity between texts through matrix operations and screen the text to be tested through thresholds. This method is suitable for scenarios with known sensitive documents. By comparing the similarity between new documents and known sensitive documents, although this method has a certain generalization ability, it requires a large number of labeled sensitive documents as learning samples.
[0008] 5. Layout recognition technology: Layout recognition technology is mainly used to identify sensitive information in unstructured data such as PDF and images. Through optical character recognition (OCR) technology, the text in the image is converted into editable text, and then the document of a specific style / format is recognized. This method works well for formatted documents, but it cannot be applied to scenarios without layout information such as plain text.
[0009] It can be seen that the existing sensitive information recognition technology has the following common shortcomings: First, due to the lack of semantic understanding of the associated context, it is difficult to accurately identify synonymous substitutions, obscure expressions, etc. Secondly, for new sensitive information, a large number of new samples need to be manually remodeled or labeled, and there are defects such as poor scalability and generalization in the same field. In addition, when migrating the recognition model of one field to other fields, due to the large differences in sensitive information, it is necessary to re-collect data and train the model, which faces a lot of work. Summary of the invention
[0010] In view of the above problems, the purpose of the present invention is to provide a sensitive information analysis and identification method, system, device and readable storage medium, which use a small amount of seed samples and sensitive point descriptions, and use the sample generation technology of a large language model, the small sample learning technology of the embedded model, and the hybrid retrieval technology to complete the sensitive point analysis and identification tasks. It not only greatly improves the accuracy of recognition, but also has strong generalization capabilities and can maintain a high level of performance under different parameter settings and data characteristics.
[0011] In order to achieve the above object, the present invention is implemented through the following technical solutions:
[0012] In a first aspect, the present invention discloses a sensitive information analysis and identification method, comprising:
[0013] Obtain the original document, and execute the corresponding sample generation strategy according to whether the original document has the preset sensitive point description and / or sensitive information sample, classify and grade the original document, generate sample documents, annotate the sample documents with metadata, and store the sample documents in the document library;
[0014] Extract sample documents and their metadata from the document library, convert the sample documents into vectors using a pre-trained text embedding model, and store the vectors and corresponding metadata in the vector knowledge base;
[0015] The extracted sample documents and their metadata are added to the vector knowledge base for integration and processing to generate a sample corpus;
[0016] Obtain the text to be tested, perform block vector similarity matching and statistical feature similarity calculation on the text to be tested based on the vector knowledge base and the sample corpus, and generate vector similarity matching results and statistical feature matching results;
[0017] Use the Reciprocal Rank Fusion algorithm to mix and reorder the vector similarity matching results and statistical feature matching results to generate the final matching results;
[0018] A prompt instruction is generated based on the final matching result, and the prompt instruction is input into the large language model to generate an analysis result of the text to be tested.
[0019] Furthermore, the method of executing a corresponding sample generation strategy according to whether the original document has a preset sensitive point description and / or sensitive information sample, classifying and grading the original document, generating a sample document, and annotating metadata for the sample document includes:
[0020] If the original document has a preset sensitive point description and a sensitive information sample, the original document is classified and graded and annotated using a preset terminal according to the preset sensitive point description and the sensitive information sample to generate a sample document, and metadata is annotated for the sample document, where the metadata includes a sample document ID, a sample document name, a sample document category, a sensitivity level, and an associated sensitive point description;
[0021] If the original document has a preset sensitive point description or sensitive information sample, and the number of the preset sensitive point description or sensitive information sample is lower than a preset threshold, the relevant original document is classified and graded and annotated using a preset terminal according to the preset sensitive point description and sensitive information sample, a sample document is generated, and metadata is annotated for the sample document; a prompt template suitable for a large language model is generated based on the sample document and the associated sensitive point description, the prompt template including an instance and a related context scenario; based on the prompt template and the original document, a sample document annotated with metadata is generated using a large language model;
[0022] If the original document only has preset sensitive point descriptions, a large language model is used to generate initial samples for each type of sensitive point based on the sensitive point descriptions and predefined rules. Metadata is annotated for the initial samples based on the preset sensitivity description to generate constructed samples. The constructed samples are used as instances and related contextual scenarios, and a sample document annotated with metadata is generated based on the original document using a large language model.
[0023] Further, extracting sample documents and metadata thereof from the document library, converting the sample documents into vectors using a pre-trained text embedding model, and storing the vectors and corresponding metadata in a vector knowledge base includes:
[0024] Extracting sample documents from the document library, and extracting key information from the sample documents based on a preset metadata model; the key information includes but is not limited to: sample document ID, sample document name, sample document category, sensitivity level, and associated sensitive point description;
[0025] Use a Chinese pre-trained model based on the Transformer architecture to encode sample documents into fixed-dimensional text vectors;
[0026] Store the text vectors and corresponding metadata in the vector knowledge base.
[0027] Further, the step of obtaining the text to be tested, performing block vector similarity matching and statistical feature similarity calculation on the text to be tested based on the vector knowledge base and the sample corpus, and generating vector similarity matching results and statistical feature matching results includes:
[0028] Obtain the text to be tested, divide the text to be tested into blocks and perform vectorization to generate a vector of the text to be tested;
[0029] Calculate the cosine similarity between the block vector of the text to be tested and the text vector in the vector knowledge base, sort the text vectors in descending order of the cosine similarity, and record the sorting results in the first list as vector similarity matching results;
[0030] Use algorithms such as TF-IDF or BM25 to calculate the statistical feature similarity between the text to be tested and the sample documents in the sample corpus, sort the sample documents in descending order of the statistical feature similarity, and record the sorting results in the second list as the statistical feature matching results.
[0031] Furthermore, the Reciprocal Rank Fusion algorithm is used to mix and reorder the vector similarity matching results and the statistical feature matching results to generate the final matching results, including:
[0032] The Reciprocal Rank Fusion algorithm is used to perform mixed re-ranking on the first list and the second list based on the correspondence between the text vectors and the sample documents, and the ranking results are recorded in the third list as the final matching results.
[0033] Further, the generating of prompt instructions based on the final matching result includes:
[0034] Based on the third list, extracting a preset number of sorting results;
[0035] According to the extracted sorting results, obtain the corresponding sample documents and metadata;
[0036] Generate structured prompt instructions based on sample documents and metadata.
[0037] Furthermore, the step of inputting the prompt instruction into the large language model to generate the analysis result of the text to be tested includes:
[0038] Input the prompt command into the large language model to obtain the analysis result of the text to be tested;
[0039] The analysis results are sorted out, the sensitivity level judgment results and related sensitive point identification results are extracted and displayed.
[0040] In a second aspect, the present invention further discloses a sensitive information analysis and identification system, comprising:
[0041] The sample generation module is used to obtain the original document, and execute the corresponding sample generation strategy according to whether the original document has the preset sensitive point description and / or sensitive information sample, classify and grade the original document, generate sample documents, annotate metadata for the sample documents, and store the sample documents in the document library;
[0042] The vector knowledge base construction module is used to extract sample documents and their metadata from the document library, convert the sample documents into vectors using a pre-trained text embedding model, and store the vectors and corresponding metadata in the vector knowledge base;
[0043] The sample corpus integration module is used to add the extracted sample documents and their metadata to the vector knowledge base, perform integration processing, and generate a sample corpus;
[0044] The similarity matching module is used to obtain the text to be tested, perform block vector similarity matching and statistical feature similarity calculation on the text to be tested based on the vector knowledge base and the sample corpus, and generate vector similarity matching results and statistical feature matching results;
[0045] The re-ranking optimization module is used to use the Reciprocal Rank Fusion algorithm to hybridly re-rank the vector similarity matching results and the statistical feature matching results to generate the final matching results;
[0046] The analysis module is used to generate prompt instructions based on the final matching results, input the prompt instructions into the large language model, and generate analysis results of the text to be tested.
[0047] In a third aspect, the present invention further discloses a sensitive information analysis and identification device, comprising:
[0048] A memory device for storing a sensitive information analysis and identification program;
[0049] A processor is used to implement the steps of the sensitive information analysis and identification method as described in any one of the above items when executing the sensitive information analysis and identification program.
[0050] In a fourth aspect, the present invention further discloses a readable storage medium, on which a sensitive information analysis and identification program is stored. When the sensitive information analysis and identification program is executed by a processor, the steps of the sensitive information analysis and identification method as described in any one of the above items are implemented.
[0051] Compared with the prior art, the present invention has the following beneficial effects:
[0052] 1. The present invention uses a large language model and prompt engineering technology to quickly generate a large number of high-quality and diverse sensitive information samples. This method greatly reduces the workload of manual annotation while ensuring the quality and diversity of samples, providing rich knowledge sample data for sensitive information identification tasks.
[0053] 2. The present invention can effectively associate sensitive information scenarios and contexts in specific fields. By combining the generation capabilities of large language models, this method can create high-quality, context-rich prompt instructions. During the recognition process, this rich context information can be used by the system or as auxiliary information for manual analysis to more accurately understand and identify sensitive information in specific fields, greatly improving the accuracy and reliability of recognition.
[0054] 3. The present invention can generate a large number of high-quality representative samples from abstract sensitive point descriptions and a small number of seed samples. This method greatly reduces the dependence on large-scale annotated data while maintaining high recognition accuracy. By leveraging the semantic understanding and few-sample or zero-sample generation capabilities of a large language model, the present invention can generate a variety of specific samples based on abstract sensitive point descriptions. After expert review, these samples can be further used to generate more samples, forming a self-expanding process. This method not only greatly reduces the cost and time of data preparation, but also can quickly adapt to new types of sensitive information, improving the flexibility and scalability of the system.
[0055] 4. The multiple similarity hybrid retrieval and re-ranking algorithms adopted by the present invention significantly improve the generalization performance of the system. Through horizontal comparison experiments, under different parameter configurations (including text block size and different embedding models), the present method has demonstrated superior performance. Specifically, the multiple similarity hybrid retrieval + re-ranking algorithms proposed in the present invention can achieve higher accuracy under different parameter settings, which not only greatly improves the accuracy of recognition, but also demonstrates strong generalization ability, and can maintain a high level of performance under different parameter settings and data characteristics. This generalization ability enables the system to better cope with various complex situations in practical applications, and improves the practicality and reliability of the system.
[0056] It can be seen that compared with the prior art, the present invention has outstanding substantive features and significant progress, and the beneficial effects of its implementation are also obvious. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0058] Figure 1 It is a method flow chart of a specific implementation mode of the present invention.
[0059] Figure 2 It is another method flow chart of a specific embodiment of the present invention.
[0060] Figure 3 It is a system structure diagram of a specific implementation mode of the present invention.
[0061] In the figure, 1. Sample generation module; 2. Vector knowledge base construction module; 3. Sample corpus integration module; 4. Similarity matching module; 5. Reordering optimization module; 6. Analysis module. DETAILED DESCRIPTION
[0062] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0063] See also Figure 1 As shown, this embodiment provides a sensitive information analysis and identification method, including the following steps:
[0064] S1: Obtain the original document, and execute the corresponding sample generation strategy according to whether the original document has preset sensitive point descriptions and / or sensitive information samples, classify and grade the original document, generate sample documents, annotate metadata for the sample documents, and store the sample documents in the document library.
[0065] In the specific implementation, this step sets three sample generation strategies according to whether there are sensitive point descriptions and (or) sensitive information samples. In the data preparation stage, the annotation terminal and (or) large language model will be used to annotate the existing data; when the sample cannot cover the required sensitive points, the prompt engineering will be used to let the large language model generate new samples. After the samples are classified and graded, they are stored in the document library.
[0066] Among them, the three sample generation strategies are as follows:
[0067] 1. If the original document has a preset sensitive point description and sensitive information sample, the original document is classified and graded using the preset terminal according to the preset sensitive point description and sensitive information sample to generate a sample document, and metadata is annotated for the sample document, the metadata including the sample document ID, sample document name, sample document category, sensitivity level and associated sensitive point description. This sample generation strategy is suitable for high-precision, small-scale business scenarios, where sensitive information samples and sensitive point descriptions are already very comprehensive.
[0068] 2. If the original document has preset sensitive point descriptions or sensitive information samples, and the number of preset sensitive point descriptions or sensitive information samples is lower than the preset threshold. First, the relevant original documents are classified and graded according to the preset sensitive point descriptions and sensitive information samples using the preset terminal to generate sample documents, and metadata is annotated for the sample documents; then, based on the sample documents and the associated sensitive point descriptions, a prompt template suitable for the large language model is generated, and the prompt template includes instances and related contextual scenarios; finally, based on the prompt template and the original document, a sample document annotated with metadata is generated using the large language model. This sample generation strategy is suitable for situations where there are a certain number of samples, but the number of samples in each category is small.
[0069] 3. If the original document only has a preset sensitive point description, first generate an initial sample for each type of sensitive point based on the sensitive point description and predefined rules using a large language model; then annotate metadata for the initial sample based on the preset sensitivity description to generate a constructed sample; finally, use the constructed sample as an instance and related context scenario to generate a sample document annotated with metadata based on the original document using a large language model. This sample generation strategy is suitable for situations where there is no ready-made sensitive information sample at all, only a sensitive point description.
[0070] In the above three scenarios, this method focuses on the diversity and representativeness of samples. By combining terminal processing and automatic generation, this method can greatly improve the efficiency of sample generation while ensuring sample quality. Especially when using large language models, this step designs special prompt engineering technology to ensure that the generated samples are both consistent with the description of sensitive points and have sufficient variability. This method can not only generate a large amount of sample knowledge base data, but also help the model better understand and identify various forms of sensitive information, thereby improving the performance and generalization ability of the overall recognition system.
[0071] S2: Extract sample documents and their metadata from the document library, convert the sample documents into vectors using a pre-trained text embedding model, and store the vectors and corresponding metadata in the vector knowledge base.
[0072] In a specific implementation, a sample document is first extracted from a document library, and key information is extracted from the sample document based on a preset metadata model; the key information includes but is not limited to: sample document ID, sample document name, sample document category, sensitivity level, and associated sensitive point description. Then, the sample document is encoded into a text vector of fixed dimension using a Chinese pre-trained model based on the Transformer architecture. Finally, the text vector and the corresponding metadata are stored in a vector knowledge base. Among them, the semantic information of the text is encoded as a numerical vector of fixed dimension to facilitate subsequent similarity calculation and matching. The generated text vector is stored in the vector knowledge base together with the corresponding metadata. The vector knowledge base supports efficient vector similarity calculation, providing a basis for subsequent fast matching queries.
[0073] S3: Add the extracted sample documents and their metadata to the vector knowledge base for integration and generation of a sample corpus.
[0074] In a specific implementation, a sample corpus formed by integrating samples is additionally added to the vector knowledge base. The purpose of this step is to prepare for the calculation of statistical feature similarity and to make up for the deficiency of the vector knowledge base in vocabulary statistics.
[0075] In addition, after this step, data enhancement and context expansion can be performed as needed. The specific process is as follows:
[0076] The samples are semantically enhanced using contextual information in metadata, such as document category, sensitivity level, etc. This enhancement can help the model better understand the context of the text and improve recognition accuracy.
[0077] Through the above steps, the present invention not only builds an efficient vector knowledge base, but also retains the statistical characteristics of the original text. This dual structure enables the system to use semantic similarity and statistical similarity to identify sensitive information at the same time, thereby improving the accuracy and flexibility of identification. In addition, this method also facilitates subsequent model updates and iterations. As new sensitive information samples are added to the system, we can easily update the vector knowledge base and document corpus, so that the system can adapt to the ever-changing sensitive information identification needs.
[0078] S4: Obtain the text to be tested, perform block vector similarity matching and statistical feature similarity calculation on the text to be tested based on the vector knowledge base and the sample corpus, and generate vector similarity matching results and statistical feature matching results.
[0079] In a specific implementation, the text to be tested is first obtained, the text to be tested is divided into blocks and vectorized to generate a vector of the text to be tested; then, the cosine similarity between the block vectors of the text to be tested and the text vectors in the vector knowledge base is calculated, the text vectors are sorted in descending order of the cosine similarity, and the sorting results are recorded in a first list as vector similarity matching results; at the same time, algorithms such as TF-IDF or BM25 are used to calculate the statistical feature similarity between the text to be tested and the sample documents in the sample corpus, the sample documents are sorted in descending order of the statistical feature similarity, and the sorting results are recorded in a second list as statistical feature matching results.
[0080] As an example, this step first uses the cosine distance to calculate the semantic similarity between the test text block and the representative samples in the vector knowledge base. This step can quickly find the samples that are semantically closest to the test text. At the same time, in order to take into account the statistical characteristics of the text semantics and vocabulary, this step also uses a statistical similarity calculation method, mainly using TF-IDF (term frequency-inverse document frequency) or BM25 algorithm. These methods can capture the vocabulary distribution characteristics of the text and supplement the shortcomings of semantic similarity.
[0081] S5: Use the Reciprocal Rank Fusion algorithm to mix and reorder the vector similarity matching results and the statistical feature matching results to generate the final matching results.
[0082] In a specific implementation, a Reciprocal Rank Fusion algorithm is used to perform mixed re-ranking on the first list and the second list based on the correspondence between the text vectors and the sample documents, and the ranking results are recorded in a third list as the final matching results.
[0083] In this step, the matching results of multiple similarities are mixed and re-ranked to further optimize the query matching results. The hybrid re-ranking algorithm (Reciprocal rank fusion) takes into account more complex language features and context information, which can improve the matching accuracy.
[0084] S6: Generate prompt instructions based on the final matching results, input the prompt instructions into the large language model, and generate analysis results of the text to be tested.
[0085] In a specific implementation, first, based on the third list, a preset number of sorting results are extracted; and according to the extracted sorting results, corresponding sample documents and metadata are obtained. Then, structured prompt instructions are generated according to the sample documents and metadata, and the prompt instructions are input into the large language model to obtain the analysis results of the text to be tested. Finally, the analysis results are sorted, and the sensitivity level judgment results and related sensitive point identification results are extracted and displayed.
[0086] The present invention discloses a sensitive information analysis and identification method, which can more comprehensively and accurately identify sensitive information through a multi-dimensional analysis method, while providing a clear identification basis, effectively reducing the risk of false positives and false negatives. In addition, the flexibility of this method enables the system to adapt to the sensitive information identification needs of different fields and types, and has strong versatility and scalability.
[0087] Based on the above sensitive information analysis and identification methods, such as Figure 2 As shown, the present invention also discloses a sensitive information analysis and identification method, which specifically includes the following steps:
[0088] S201. Obtaining document samples: Obtain the original document, execute the corresponding sample generation strategy according to the application scenario of the original document, classify and grade the original document, and generate sensitive documents with labels and metadata as sample documents.
[0089] S202, Document storage and metadata extraction: All reviewed document samples are stored in the local document library. At the same time, key metadata such as document ID, name, category, sensitivity level, and associated sensitive point descriptions are extracted from these documents.
[0090] S203, Text embedding and constructing vector knowledge base: Use the pre-trained text embedding model to divide the document content into blocks and convert them into vector representations. These vectors are stored in the vector knowledge base together with the corresponding metadata, providing a basis for subsequent similarity matching.
[0091] S204, sample corpus integration: integrate the contents of all samples into a complete document corpus. This corpus will be used for subsequent statistical feature similarity calculations to supplement the deficiencies of vector matching.
[0092] S205, text block vector similarity matching: divide the text to be tested into blocks and vectorize them, and then calculate the cosine similarity between them and the samples in the vector knowledge base. This step quickly finds the most semantically similar samples.
[0093] S206, Statistical feature similarity calculation: Use algorithms such as TF-IDF or BM25 to calculate the statistical feature similarity between the text to be tested and the documents in the sample corpus. This step supplements the shortcomings of pure semantic matching, especially when dealing with professional terms and rare words.
[0094] S207, hybrid re-ranking optimization and metadata addition: hybrid re-ranking of the results of vector similarity and statistical feature similarity, such as using the Reciprocal Rank Fusion algorithm. This step further optimizes the accuracy of the matching results. At the same time, the corresponding metadata information is added to the matching results.
[0095] S208, domain knowledge and sample combination prompt generation: Generate structured prompt instructions based on the most relevant samples retrieved and their metadata. These instructions will be used to guide the large language model for subsequent analysis.
[0096] S209, sorting and displaying analysis results: Input the generated prompts into the large language model to obtain the analysis results of the text to be tested. These results are sorted, including sensitivity level judgment, relevant sensitive point identification, etc., and displayed to the user in a clear and easy-to-understand manner.
[0097] See also Figure 3 As shown, the present invention also discloses a sensitive information analysis and identification system, including: a sample generation module 1, a vector knowledge base construction module 2, a sample corpus integration module 3, a similarity matching module 4, a reordering optimization module 5 and an analysis module 6.
[0098] The sample generation module 1 is used to obtain the original document, execute the corresponding sample generation strategy according to whether the original document has preset sensitive point descriptions and / or sensitive information samples, classify and grade the original document, generate sample documents, annotate metadata for the sample documents, and store the sample documents in the document library.
[0099] The vector knowledge base construction module 2 is used to extract sample documents and their metadata from the document library, convert the sample documents into vectors using a pre-trained text embedding model, and store the vectors and corresponding metadata in the vector knowledge base.
[0100] The sample corpus integration module 3 is used to add the extracted sample documents and their metadata to the vector knowledge base, perform integration processing, and generate a sample corpus.
[0101] The similarity matching module 4 is used to obtain the text to be tested, perform vector similarity matching and statistical feature similarity calculation on the text to be tested based on the vector knowledge base and the sample corpus, and generate vector similarity matching results and statistical feature matching results.
[0102] The re-ranking optimization module 5 is used to use the Reciprocal Rank Fusion algorithm to perform mixed re-ranking on the vector similarity matching results and the statistical feature matching results to generate the final matching results.
[0103] The analysis module 6 is used to generate a prompt instruction based on the final matching result, input the prompt instruction into the large language model, and generate an analysis result of the text to be tested.
[0104] The specific implementation of the sensitive information analysis and identification system of this embodiment is basically the same as the specific implementation of the sensitive information analysis and identification method described above, and will not be repeated here.
[0105] The present invention also discloses a sensitive information analysis and identification device, comprising a processor and a memory; wherein, when the processor executes the sensitive information analysis and identification program stored in the memory, the steps of the sensitive information analysis and identification method as described in any one of the above items are implemented.
[0106] Furthermore, the sensitive information analysis and identification device in this embodiment may also include:
[0107] The input interface is used to obtain the sensitive information analysis and identification program imported from the outside, and save the obtained sensitive information analysis and identification program to the memory, and can also be used to obtain various instructions and parameters transmitted by the external terminal device, and transmit them to the processor, so that the processor can use the above various instructions and parameters to carry out corresponding processing. In this embodiment, the input interface can specifically include but is not limited to a USB interface, a serial interface, a voice input interface, a fingerprint input interface, a hard disk reading interface, etc.
[0108] The output interface is used to output various data generated by the processor to the terminal device connected thereto, so that other terminal devices connected to the output interface can obtain various data generated by the processor. In this embodiment, the output interface may specifically include but is not limited to a USB interface, a serial interface, etc.
[0109] The communication unit is used to establish a remote communication connection between the sensitive information analysis and identification device and the external server so that the sensitive information analysis and identification device can mount the image file to the external server. In this embodiment, the communication unit may specifically include but is not limited to a remote communication unit based on wireless communication technology or wired communication technology.
[0110] The keyboard is used to obtain various parameter data or instructions input by the user by tapping the keycaps in real time.
[0111] A display is used to display relevant information of the sensitive information analysis and identification process in real time.
[0112] The mouse can be used to assist users in inputting data and simplify user operations.
[0113] The present invention also discloses a readable storage medium, wherein the readable storage medium includes a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable hard disk, a CD-ROM, or any other form of storage medium known in the technical field. The readable storage medium stores a sensitive information analysis and identification program, and when the sensitive information analysis and identification program is executed by a processor, the steps of the sensitive information analysis and identification method described in any one of the above items are implemented.
[0114] In summary, the present invention uses a small amount of seed samples and sensitive point descriptions, and completes sensitive point analysis and recognition tasks with the help of sample generation technology of a large language model, small sample learning technology of an embedded model, and hybrid retrieval technology. It not only greatly improves the recognition accuracy, but also has strong generalization capabilities and can maintain a high level of performance under different parameter settings and data characteristics.
[0115] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. As for the method disclosed in the embodiment, since it corresponds to the system disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0116] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0117] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.
[0118] 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 on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0119] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit.
[0120] Similarly, each processing unit in each embodiment of the present invention may be integrated into one functional module, or each processing unit may exist physically, or two or more processing units may be integrated into one functional module.
[0121] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0122] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0123] The above is a detailed introduction to the sensitive information analysis and identification method, system, device and readable storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A sensitive information analysis and identification method, characterized in that: include: Obtain the original document, and execute the corresponding sample generation strategy according to whether the original document has the preset sensitive point description and / or sensitive information sample, classify and grade the original document, generate sample documents, annotate the sample documents with metadata, and store the sample documents in the document library; Extract sample documents and their metadata from the document library, convert the sample documents into vectors using a pre-trained text embedding model, and store the vectors and corresponding metadata in the vector knowledge base; The extracted sample documents and their metadata are added to the vector knowledge base for integration and processing to generate a sample corpus; Obtain the text to be tested, perform block vector similarity matching and statistical feature similarity calculation on the text to be tested based on the vector knowledge base and the sample corpus, and generate vector similarity matching results and statistical feature matching results; Use the Reciprocal Rank Fusion algorithm to mix and reorder the vector similarity matching results and statistical feature matching results to generate the final matching results; Generate prompt instructions based on the final matching results, input the prompt instructions into the large language model, and generate analysis results of the text to be tested; The method of executing a corresponding sample generation strategy based on whether the original document has a preset sensitive point description and / or sensitive information sample, classifying and grading the original document, generating a sample document, and annotating metadata for the sample document includes: If the original document has a preset sensitive point description and a sensitive information sample, the original document is classified and graded and annotated using a preset terminal according to the preset sensitive point description and the sensitive information sample to generate a sample document, and metadata is annotated for the sample document, where the metadata includes a sample document ID, a sample document name, a sample document category, a sensitivity level, and an associated sensitive point description; If the original document has a preset sensitive point description or sensitive information sample, and the number of the preset sensitive point description or sensitive information sample is lower than a preset threshold, the relevant original document is classified and graded and annotated using a preset terminal according to the preset sensitive point description and sensitive information sample, a sample document is generated, and metadata is annotated for the sample document; a prompt template suitable for a large language model is generated based on the sample document and the associated sensitive point description, the prompt template including an instance and a related context scenario; based on the prompt template and the original document, a sample document annotated with metadata is generated using a large language model; If the original document only has preset sensitive point descriptions, a large language model is used to generate initial samples for each type of sensitive point based on the sensitive point descriptions and predefined rules. Metadata is annotated for the initial samples based on the preset sensitivity description to generate constructed samples. The constructed samples are used as instances and related contextual scenarios, and a sample document annotated with metadata is generated based on the original document using a large language model.
2. The sensitive information analysis and identification method according to claim 1, characterized in that: The method of extracting sample documents and metadata thereof from the document library, converting the sample documents into vectors using a pre-trained text embedding model, and storing the vectors and corresponding metadata in a vector knowledge base includes: Extracting sample documents from the document library, and extracting key information from the sample documents based on a preset metadata model; the key information includes but is not limited to: sample document ID, sample document name, sample document category, sensitivity level, and associated sensitive point description; Use a Chinese pre-trained model based on the Transformer architecture to encode sample documents into fixed-dimensional text vectors; Store the text vectors and corresponding metadata in the vector knowledge base.
3. The sensitive information analysis and identification method according to claim 2, characterized in that: The method of obtaining the text to be tested, performing block vector similarity matching and statistical feature similarity calculation on the text to be tested based on the vector knowledge base and the sample corpus, and generating vector similarity matching results and statistical feature matching results includes: Obtain the text to be tested, divide the text to be tested into blocks and perform vectorization to generate a vector of the text to be tested; Calculate the cosine similarity between the block vector of the text to be tested and the text vector in the vector knowledge base, sort the text vectors in descending order of the cosine similarity, and record the sorting results in the first list as vector similarity matching results; Use the TF-IDF or BM25 algorithm to calculate the statistical feature similarity between the text to be tested and the sample documents in the sample corpus, sort the sample documents in descending order of the statistical feature similarity, and record the sorting results in the second list as the statistical feature matching results.
4. The sensitive information analysis and identification method according to claim 3 is characterized in that: The ReciprocalRank Fusion algorithm is used to mix and reorder the vector similarity matching results and the statistical feature matching results to generate the final matching results, including: The Reciprocal Rank Fusion algorithm is used to perform mixed re-ranking on the first list and the second list based on the correspondence between the text vectors and the sample documents, and the ranking results are recorded in the third list as the final matching results.
5. The sensitive information analysis and identification method according to claim 4, characterized in that: The generating of prompt instructions based on the final matching result includes: Based on the third list, extracting a preset number of sorting results; According to the extracted sorting results, obtain the corresponding sample documents and metadata; Generate structured prompt instructions based on sample documents and metadata.
6. The sensitive information analysis and identification method according to claim 5, characterized in that: The step of inputting the prompt instruction into the large language model to generate the analysis result of the text to be tested includes: Input the prompt command into the large language model to obtain the analysis result of the text to be tested; The analysis results are sorted out, the sensitivity level judgment results and related sensitive point identification results are extracted and displayed.
7. A sensitive information analysis and identification system, characterized in that: The system adopts the sensitive information analysis and identification method as described in any one of claims 1 to 6; The system comprises: The sample generation module is used to obtain the original document, and execute the corresponding sample generation strategy according to whether the original document has the preset sensitive point description and / or sensitive information sample, classify and grade the original document, generate sample documents, annotate metadata for the sample documents, and store the sample documents in the document library; The vector knowledge base construction module is used to extract sample documents and their metadata from the document library, convert the sample documents into vectors using a pre-trained text embedding model, and store the vectors and corresponding metadata in the vector knowledge base; The sample corpus integration module is used to add the extracted sample documents and their metadata to the vector knowledge base, perform integration processing, and generate a sample corpus; The similarity matching module is used to obtain the text to be tested, perform block vector similarity matching and statistical feature similarity calculation on the text to be tested based on the vector knowledge base and the sample corpus, and generate vector similarity matching results and statistical feature matching results; The re-ranking optimization module is used to use the Reciprocal Rank Fusion algorithm to hybridly re-rank the vector similarity matching results and the statistical feature matching results to generate the final matching results; The analysis module is used to generate prompt instructions based on the final matching results, input the prompt instructions into the large language model, and generate analysis results of the text to be tested.
8. A sensitive information analysis and identification device, characterized in that: include: A memory device for storing a sensitive information analysis and identification program; A processor, used to implement the steps of the sensitive information analysis and identification method as described in any one of claims 1 to 6 when executing the sensitive information analysis and identification program.
9. A readable storage medium, characterized in that: The readable storage medium stores a sensitive information analysis and identification program, which, when executed by a processor, implements the steps of the sensitive information analysis and identification method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Intelligent robot integrating chat, knowledge and task questions and answers
CN113515613A
Keyword extraction method and device, electronic equipment and storage medium
CN115757680A