Website privacy declaration compliance detection method and device based on continuous pre-training strategy

By further pre-training the language model and enhancing it with structure-aware masks, combined with a multi-level, multi-label classification system, the problems of legal and regulatory adaptability and insufficient data samples in privacy statement compliance detection are solved, achieving efficient and accurate detection and fuzziness assessment of privacy statements.

CN121637557APending Publication Date: 2026-03-10CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing methods for detecting privacy statement compliance have shortcomings in terms of legal and regulatory adaptability, insufficient data samples, and ambiguity detection, leading to biased and inaccurate test results.

Method used

We employ a pre-training-based approach, constructing a training dataset for a specific domain to adapt the language model to that domain. We also introduce structure awareness and structure masking enhancement strategies, combined with a multi-level, multi-label classification system and sentence readability evaluation, to improve the model's accuracy in detecting privacy statements.

Benefits of technology

It significantly improves the model's ability to extract legal text features and understand semantics, enhances its ability to represent the structure and terminology of privacy statement clauses, realizes automated and accurate identification and integrity detection of privacy statements, improves the legal coverage and clause relevance of detection, and provides a quantitative basis for fuzziness assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121637557A_ABST
    Figure CN121637557A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of data security, and relates to a website privacy declaration compliance detection method and device based on a continuous pre-training strategy, and the method comprises the steps: obtaining a privacy declaration text to be detected, inputting the privacy declaration text into a trained integrity detection model, obtaining a detection result, and calculating an integrity score according to the detection result; the training process of the integrity detection model comprises the following steps: acquiring and preprocessing a privacy declaration text and a law and regulation document to obtain a training data set; continuing pre-training the language model according to the training data set to obtain a language model after continuing pre-training; constructing a classification label system of the website privacy declaration to mark labels on the training data set, and performing fine tuning training on the language model and the classification model after continuous pre-training according to the training data set marked with the labels; according to the method, the training data set of the website privacy declaration field is constructed, field-adaptive continuous pre-training is performed on the universal language model, and the performance of the model in the aspects of legal text feature extraction and semantic understanding is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of data security in information security, and relates to a website privacy statement compliance detection method and device based on a continued pre-training strategy. BACKGROUND

[0002] The research on privacy statement content compliance detection mainly focuses on two dimensions: content integrity and expression ambiguity, forming a multi-level method system.

[0003] The privacy statement content integrity detection method includes: rule-based method: early research adopts keyword matching technology driven by laws and regulations. By systematically analyzing the core requirements of GDPR, PDPA and other laws and regulations, researchers construct a detection framework containing a privacy element keyword library and a compliance rule library, and realize the positioning and integrity verification of key information points through a text analysis engine. Machine learning-based method: as the detection demand becomes more complex, scholars begin to use multi-label classification technology. This method decomposes legal provisions into standardized labels such as "collection of personal information (CPI)", "data retention period (DRP)", and "user access rights (RA)", and maps text to a high-dimensional semantic space through feature engineering. Then, various machine learning models such as SVM and decision tree are used to perform multi-label classification prediction on privacy statement sentences. Finally, the integrity of the privacy statement content is detected by summarizing the multi-label classification prediction results. Deep learning-based method: in recent years, deep learning-based privacy statement content integrity detection methods have developed rapidly, mainly using pre-trained language models (such as BERT, Legal-BERT) to enhance semantic understanding capabilities, combining attention mechanisms and multi-task learning to optimize clause identification and compliance verification. Researchers solve the problems of labeled data scarcity and model interpretability through small sample learning, data augmentation, and explainable AI techniques, and explore cross-language and cross-regulation automated detection.

[0004] Current research on privacy statement ambiguity detection mainly focuses on readability quantification analysis and generalization expression identification. In terms of readability quantification analysis, language indicators such as FKGL formula and SMOG index are commonly used to evaluate the reading difficulty of privacy statements. In recent years, some research has begun to combine syntactic complexity (such as clause nesting depth) and lexical professionalism (such as legal terminology density) to build a multi-dimensional readability evaluation model to more accurately quantify the ambiguity tendency of text. In terms of generalization expression identification, early research mainly relies on keyword rules (such as "may" and "if necessary"). With the development of natural language processing technology, deep learning-based semantic analysis methods (such as BERT and legal domain fine-tuning models) have gradually become mainstream, which can effectively identify expressions with implicit avoidance intentions (such as "sharing data within a reasonable range").

[0005] Although some progress has been made in the current research on website privacy statement content compliance detection, there are still several key problems to be solved. First, in terms of legal regulation adaptability, existing research mainly builds detection frameworks based on international general regulations such as GDPR, lacking specific consideration of local regulations such as China's Personal Information Protection Law and Information Security Technology-Personal Information Security Specification. This "one-size-fits-all" research paradigm ignores the differences in privacy protection requirements across different jurisdictions, leading to potential biases in detection results in actual application scenarios, and failing to accurately reflect the true compliance status of privacy statements. Second, existing methods face the core bottleneck of insufficient data samples. Due to the need for professional legal knowledge in privacy statement labeling, high-quality labeled samples are costly and limited in quantity. This data scarcity makes machine learning-based detection methods prone to overfitting, with poor generalization ability. Deep learning-based detection models still lack modeling of professional terms and compliance rules, with limited dynamic adaptation ability, requiring deep integration of legal knowledge and efficient online learning or incremental learning mechanisms to adapt to new clauses and accurately understand the logical relationships between clauses. Meanwhile, rule-based methods rely too much on preset keyword libraries and are difficult to handle complex semantic expressions and emerging privacy practices in privacy statement texts. Finally, existing research has limitations in understanding ambiguity detection. Although some studies have introduced readability quantification indicators, they mainly focus on surface features such as syntactic complexity. In fact, the ambiguity of privacy statements is reflected not only in vocabulary selection but also in text structure and information organization. Current detection methods often separate these two dimensions, which may lead to missed detection of some hidden ambiguous expressions, affecting the accuracy of overall compliance assessment.

[0006] In summary, existing methods have biases in legal regulation adaptability, face the core bottleneck of insufficient data samples, and fail to deeply analyze the readability and ambiguity of privacy statements, thereby affecting the accuracy of compliance assessment. SUMMARY

[0007] To solve the above technical problems, the website privacy statement compliance detection method based on the continued pre-training strategy is adopted, which includes: obtaining the privacy statement text to be detected, inputting the privacy statement text to be detected into the trained integrity detection model, obtaining the detection result, and calculating the integrity score according to the detection result; the integrity detection model includes a language model and a classification model; the training process of the integrity detection model includes:

[0008] S1, obtain the privacy statement text and legal regulation documents, preprocess the privacy statement text and legal regulation documents to obtain a training data set; build an MLM task data set and an NSP task data set according to the training data set;

[0009] S2, continue pre-training a language model according to the MLM task dataset and the NSP task dataset, to obtain the language model after the continue pre-training;

[0010] The continue pre-training of the language model comprises:

[0011] S21, structure perception and structure mask enhancement are performed on the MLM task dataset respectively, to obtain a structure perception dataset and a structure mask enhancement dataset;

[0012] S22, the structure perception dataset, the structure mask enhancement dataset and the NSP task dataset are input into the language model, a loss function value of the MLM task is calculated according to the output of the structure perception dataset and the structure mask enhancement dataset in the language model, and a loss function value of the NSP task is calculated according to the output of the NSP task dataset in the language model;

[0013] S23, a total loss function value is calculated according to the loss function value of the MLM task and the loss function value of the NSP task, the language model is updated according to the total loss function value, and when the total loss function value is the minimum, the language model after the continue pre-training is obtained;

[0014] S3, a classification label system of the website privacy statement is constructed, labels are marked on the training dataset according to the classification label system, and the language model after the continue pre-training and the classification model are fine-tuned and trained according to the training dataset with the marked labels, to obtain the trained integrity detection model.

[0015] Beneficial effects:

[0016] 1. The website privacy statement professional field training dataset is constructed, the general language model is subjected to the field adaptation continue pre-training, the performance of the model in the legal text feature extraction and semantic understanding is significantly improved, and the adaptability of the language model is improved; further, the structure perception mask and the structure mask enhancement strategy facing the privacy statement scene are introduced in the continue pre-training stage, and are jointly optimized with the NSP task, the representation ability of the model to the clause structure, the field term and the condition / parallel relationship is strengthened, and thus the detection effect is improved; 2. The core clauses of the legal regulations in the data security field are systematically combed, the hierarchical multi-level multi-label classification system is constructed, and the privacy statement text is marked with labels based on the label classification system, the voice model after the continue pre-training is fine-tuned and trained according to the privacy statement text with the marked labels, the automatic accurate identification and integrity detection of the privacy statement clauses can be realized by using a small amount of annotation samples, the legal coverage and the clause relevance of the detection standard are improved, and the problem of insufficient data samples is solved; 3. The sentence readability and the sentence ambiguity evaluation method are innovatively introduced, the ambiguous expressions possibly existing in the privacy statement are effectively identified, and a quantitative basis is provided for the readability and the ambiguity detection of the website privacy statement. Attached Figure Description

[0017] Figure 1 A flowchart illustrating a website privacy statement compliance detection method based on a continued pre-training strategy provided in an embodiment of the present invention;

[0018] Figure 2 A flowchart illustrating the continued pre-training of the privacy declaration domain based on a language model, as provided in an embodiment of the present invention.

[0019] Figure 3 A flowchart for privacy statement content compliance detection provided in this embodiment of the invention;

[0020] Figure 4 This is a structural diagram of a website privacy statement compliance detection device based on a continued pre-training strategy, provided in an embodiment of the present invention. Detailed Implementation

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

[0022] like Figure 1 As shown, the present invention employs a website privacy statement compliance detection method based on a continued pre-training strategy, comprising: acquiring the privacy statement text to be detected, inputting the privacy statement text to be detected into a trained integrity detection model, obtaining the detection result, and calculating the integrity score based on the detection result;

[0023] The detection results include the predicted privacy category for each sentence in the privacy statement text to be detected; the calculation of the integrity score includes: assuming the privacy statement text P consists of n sentences, counting the number of privacy categories among the predicted privacy categories for all sentences in the privacy statement text P. Then the integrity score Where C represents the total number of privacy categories in the classification and labeling system.

[0024] Integrity detection models include: language models and classification models; the training process of integrity detection models includes:

[0025] S1. Obtain the privacy statement text and legal documents, preprocess the privacy statement text and legal documents to obtain the training dataset; construct the MLM task dataset and NSP task dataset based on the training dataset;

[0026] Preprocessing of privacy statement texts and legal documents includes: segmenting and dividing the privacy statement texts and legal documents into sentences to obtain a set of sentences from the privacy statement texts and legal documents; cleaning the sentence set of the privacy statement texts and legal documents to obtain a training dataset.

[0027] Since website privacy statements are normative texts with rights and obligations as their core content, they have a high degree of correspondence with relevant laws and regulations in terms of conceptual system and terminology. Therefore, adding laws and regulations related to privacy statements can enable the pre-trained model to learn both the "expression of privacy statements" and the "normative expression required by regulations", thus solving the problems of sample scarcity and semantic bias. Furthermore, laws and regulations have strong structural signals, such as "chapter-article-clause", which can effectively support the structure masking (SMA) task.

[0028] Data cleaning includes: standardizing encoding and removing redundant characters and special symbols.

[0029] The MLM task dataset includes: cleaned privacy statement texts and sentence sets from legal and regulatory documents, which form the training dataset.

[0030] The NSP task dataset includes multiple pairs of positive and negative sentence samples; each pair of positive and negative sentence samples consists of two sentences, labeled... (1 indicates that the two sentences are consecutive sentences in the original text, and 0 indicates that the two sentences are not consecutive / randomly paired across documents). The core of the NSP task is to train the model to determine whether two sentences are consecutive sentences (positive samples) or non-consecutive sentences (negative samples) in the original text.

[0031] S2. Continue to pre-train the language model based on the MLM task dataset and the NSP task dataset to obtain the language model after further pre-training.

[0032] like Figure 2 As shown, further pre-training of the language model includes:

[0033] S21. Perform structure-aware and structure-masking enhancement on the MLM task dataset to obtain the structure-aware dataset and the structure-masking enhanced dataset.

[0034] The structure-aware processing of the MLM task dataset includes: performing structured text processing on each sentence in the MLM task dataset to obtain the domain core terms and structural features of each sentence; and masking the domain core terms and structural features of each sentence in the MLM task dataset to obtain a structure-aware dataset.

[0035] Structured text processing of sentences in the MLM task dataset includes:

[0036] Obtain the term table in the field of privacy protection and data security, extract terms in the sentence, match the extracted terms with the term table, and take the matched terms as core terms.

[0037] Among them, there are many public term tables in the field of privacy protection and data security, which can be directly obtained; the terms include personal information, sensitive personal information, processing purpose, legality basis, retention period, etc.

[0038] Identify structural features in the sentence to generate a set Each structural feature is represented by ; wherein, , , , Sentence ID, start token, end token and structural feature type of the structural feature, respectively;

[0039] The structural feature type includes clause number anchor (analyzing the hierarchical number and hierarchical path), enumeration / list item (“-”“•”“(a)(b)”“①②”“i)ii)” or continuous similar prefix), time and period (“from… to / not less than… days / retention period…” and standardized as start-stop / period) and the like.

[0040] The structural mask enhancement of the MLM task data set comprises: performing structured text processing on each sentence in the MLM task data set to obtain the main component (such as subject-predicate-object), parallel structure (such as “and”, “and” and the like) and conditional structure (such as “as long as…, then…” “as soon as…, then…” and the like) of each sentence, and setting the masking probability of the main component, parallel structure and conditional structure of each sentence to , and setting the masking probability of the remaining words to , According to the masking probability, each sentence in the MLM task data set is masked to obtain a structural mask enhancement data set.

[0041] S22, input the structure perception (sa) data set, the structure mask enhancement (sma) data set and the NSP task data set into the language model, calculate the loss function value of the MLM task according to the output of the structure perception data set and the structure mask enhancement data set in the language model, and calculate the loss function value of the NSP task according to the output of the NSP task data set in the language model;

[0042] The loss function value of the MLM task:

[0043]

[0044]

[0045]

[0046] wherein, , are the loss functions corresponding to the structure-aware dataset and the structure-masked augmented dataset respectively, is the weight, denotes the masked input sequence (i.e., the sentences in each dataset), is the true value of the token at position of the masked input sequence , denotes the conditional probability that the language model predicts the true value at position given the masked input sequence , is the probability that the value of the token at position output by the language model is the true value , is the probability that the value of the token at position output by the language model is the word v on the vocabulary V.

[0047] The loss function of the NSP task is calculated as follows: the input of the language model is “[CLS] A [SEP] B [SEP]”, where A and B are two sentences of a positive and negative sentence pair sample, [CLS] and [SEP] are two special tokens, the language model will take the final hidden state corresponding to [CLS] as the global semantic representation of the entire sentence pair, and [SEP] is a Separator Token used to separate single sentences or multiple sentences; the feature at the position of [CLS] in the output of the language model is scored through a linear layer and the probability of a continuous relationship is obtained through Sigmoid , and the loss function is calculated according to the probability:

[0048]

[0049] wherein, N is the number of samples of the NSP dataset, is the continuous label of sample n.

[0050] The structure-aware dataset is used to strengthen the model’s perception of the structure of compliant terms and clauses, and the structure-masked augmented dataset is used to highlight the syntactic backbone and conditional / parallel relationship and as a regularization means, and the combination of the two can improve the model’s semantic and structural modeling ability on the privacy statement corpus.

[0051] S23, calculate an overall loss function value according to the loss function value of the MLM task and the loss function value of the NSP task, update the language model according to the overall loss function value, and obtain the language model after the continued pre-training when the overall loss function value is the minimum.

[0052] the overall loss function value ; wherein, is the loss function of the MLM task, is the loss function of the NSP task, , is the weight.

[0053] To enhance the semantic modeling ability of the model to the privacy statement domain corpus and effectively suppress the risk of overfitting, the hyperparameters for training are set as follows: BatchSize (batch size) is 32, Epochs (training rounds) is 3, the initial learning rate is set to , the optimizer is AdamW, the Weight Decay (weight decay) coefficient is 0.01, and the generalization ability of the model is improved. At the same time, the Warm-up and Linear Decay learning rate scheduling strategies are introduced. Specifically, in the first 10% of the training steps, the learning rate is linearly increased from 0 to the initial set value, and then gradually linearly decreased to 0. This strategy helps the model to achieve rapid convergence in the early training stage and maintain stable optimization in the later training stage, avoiding oscillation or falling into local optimum. After the continued pre-training is completed, the model parameters (including weights and configurations) obtained by training are saved.

[0054] In one embodiment, the language model is a RoBERTa-base model.

[0055] S3, build a classification label system of website privacy statements, label the training data set according to the classification label system, fine-tune the language model and the classification model after the continued pre-training according to the training data set with labeled labels, and obtain the trained integrity detection model;

[0056] Building a classification label system includes: based on 13 laws and regulations closely related to personal information processing activities such as the Personal Information Protection Law of the People's Republic of China, the App Illegal and Irregular Collection and Use of Personal Information Self-Assessment Guide, and the Information Security Technology-Personal Information Security Specification, the content that the website should disclose in the whole life cycle of personal information is disassembled into clauses, and a "primary label + secondary label" website privacy statement classification label system is built. The primary category is used to depict the business link to which the disclosed content belongs, and the secondary label is used to depict the specific information points that should be disclosed in this link.

[0057] In this embodiment, the classification label system is shown in Table 1.

[0058] Table 1 Website privacy statement classification label system

[0059]

[0060] According to the classification label system, the privacy statement text is marked with labels, including:

[0061] The privacy statement text is segmented to obtain a sentence-level sample For each sentence According to the pre-constructed classification label system, it is judged whether the sentence covers one or more labels to form a label set of the sentence For example:

[0062] Sentence A: “We will only collect your mobile phone number within the scope of providing account registration and login services for the purpose of achieving.”

[0063] Labeling result: 2.1 type of collected personal information, 2.2 purpose of collection and use, and 2.4 explanation of core business function required information.

[0064] Sentence B: “Except in cases where the law or rules are followed or your individual consent is obtained, we will not provide your personal information to any third party.”

[0065] Labeling result: 4.2 conditions for transferring (providing) personal information to third parties.

[0066] In this step, not all sentences in the training data set are labeled, only part of the sentences are labeled, and the partially labeled sentences are used for fine-tuning training.

[0067] According to the labeled training data set, the fine-tuning training of the language model and the classification model after continuing pre-training includes: inputting the sentences in the labeled training data set into the language model after continuing pre-training, taking the [CLS] of each sentence output by the language model as a sentence vector, inputting the sentence vector of each sentence into the classification model to obtain a label probability score vector of each sentence, the label probability score vector including the probability that the sentence belongs to each label; the label corresponding to the maximum probability in the label probability score vector of each sentence is taken as the predicted privacy category of the corresponding sentence; the binary cross entropy (BCE) loss is calculated according to the label probability score vector of each sentence and the real label indication vector, and the parameters of the classification model are updated according to the loss, and when the loss reaches the minimum value, the training completed integrity detection model is obtained.

[0068] Specifically, the classification model includes multiple full connection layers, and the sentence vector is sequentially input to an output layer through full connection layers with ReLU activation and Dropout regularization, the output layer is a full connection layer, the output dimension (i.e., num_labels) parameter is set to 34, corresponding to the number of secondary labels, and Sigmoid is applied to each output unit to obtain a 34-dimensional label probability score vector.

[0069] In one embodiment, the training parameter is set as: the batch size is 32, the training round is 5, the initial learning rate is 2e-5, the AdamW optimizer is used, and the weight decay coefficient is 0.01. Linear learning rate decay strategy is adopted, and the first 10% steps are the warmup stage.

[0070] In one embodiment, as shown in Figure 3 readability detection and ambiguity detection are performed on the privacy statement text to be detected;

[0071] The readability detection on the privacy statement text to be detected includes:

[0072] The language complexity and NLP-based complexity of the privacy statement text to be detected are calculated; wherein the language complexity includes: CnText language complexity, Chen Shimin language complexity index, and Lu Jianming readability, and the NLP-based complexity is language model perplexity.

[0073] Considering the deep level and multiple terms of the privacy right document, the present application makes changes closer to the characteristics of the privacy right statement: first, the CnText language complexity is increased to measure the "level of depth", to distinguish between "long template but clear" and "structure nesting leading to unreadable", and to reduce the misjudgment caused by judging only by the number of words; second, the calculation of the Chen Shimin language complexity index is moved from "word" to "word level", which comprehensively considers the part of speech, word length and hierarchy of word components, and specifically punishes excessive legalization / rare word stacking, while not misjudging the small amount of necessary terms; third, the Lu Jianming readability formula is extended from the number of "formal verbs" to calculate the information density and conjunction density to calculate the complexity, so as to more easily find the places of clause jumping and logical redundancy; fourth, the perplexity PPL of the language model is used as a semantic predictability index to avoid the bias caused by long text and templating.

[0074] The Cntext library itself can obtain the lexical difficulty and syntactic complexity. However, there are large sections, small sections, and small points in the privacy statement document, so the structure nesting depth needs to be calculated to quantify readability, so as to distinguish between "long template but clear" and "structure nesting leading to unreadable", and to reduce the misjudgment caused by judging only by the number of words. Therefore, the CnText language complexity The results are calculated by weighting lexical difficulty, syntactic complexity, and structural nesting depth. Lexical difficulty refers to the number of words in the privacy statement text that match in the glossary (including legal and computer science terms). Syntactic complexity is calculated using the readability() metric from the CnText library, based on the average number of words per sentence and the proportion of conjunctions / adverbs in the privacy statement text. Structural nesting depth refers to the degree of nesting of hierarchical structures such as chapters and lists in the privacy statement text (e.g., maximum / average nesting levels). The formula is shown below:

[0075]

[0076] in, , , For weights.

[0077] Chen Shimin's original language complexity index calculated readability levels by weighing sentence length and the number of syllables per word. Essentially, this is word-level complexity. However, given the high concentration of technical terms (legal, computer-related) in privacy policies, it needs to be modified to a word-level complexity. Therefore, this invention's Chen Shimin language complexity index... By combining the statistics of word length, part-of-speech complexity, and the hierarchy of part-of-speech components, we can specifically penalize excessive use of legalistic or rare terms, while not inadvertently penalizing the rare occurrence of necessary terms.

[0078] The calculation of the Chen Shimin language complexity index of the privacy statement text to be detected includes: dividing the privacy statement text to be detected into sentences to obtain S sentences; calculating the word length, part-of-speech complexity, and part-of-speech component level of each sentence s; and weighting and combining the word length, part-of-speech complexity, and part-of-speech component level of all sentences to obtain the Chen Shimin language complexity index of the privacy statement text to be detected.

[0079] The formula is shown below:

[0080]

[0081] in, , , For weights.

[0082] Word length refers to the length of a sentence (i.e., the number of words); part-of-speech complexity refers to the types of parts of speech in a sentence. Based on HanLP, the parts of speech of sentences within the same window are labeled, and the number of different parts of speech categories is counted. The more parts of speech categories there are, the more diverse the syntactic combinations are represented, and the higher the understanding cost.

[0083] The calculation process for the hierarchical structure of the parts of speech in sentence s includes:

[0084] Sentence s is segmented using a part-of-speech tagging tool (i.e., sentence s is tagged with part-of-speech tags, and sentence s is segmented into phrase blocks based on the tagged part-of-speech tags), resulting in a phrase sequence of sentence s. The nesting depth of each phrase in the phrase sequence of sentence s is calculated, and the level of the part-of-speech components of sentence s is calculated based on the nesting depth of each phrase in the phrase sequence of sentence s.

[0085] In one embodiment, the nesting depth of each phrase in the phrase sequence of sentence s is calculated by using a stack-like scan from left to right to calculate the nesting depth of each phrase in the phrase sequence of sentence s. That is, when a phrase is encountered, it is pushed onto the stack, popped off the stack at punctuation or coordinating conjunctions, and the subordinate layer is opened at conditional / causal conjunctions and closed at the end of the corresponding clause, so as to quantify the complexity of phrase nesting and subordinate structure.

[0086] Taking sentence Q as an example: "If users do not agree to the updated privacy policy, we will only retain necessary log information to the extent permitted by law and for security auditing purposes.", the calculation process of its part-of-speech components includes:

[0087] First, the sentence is segmented using a part-of-speech tagging tool, and adjacent words are combined into phrase blocks such as noun phrases (NP), verb phrases (VP), and prepositional phrases (PP) according to their parts of speech, resulting in an illustrative phrase sequence: {[if]_COND;[user]_NP;[disagree]_VP;[updated privacy policy]_NP;[,]_PUNC;[we]_NP;[only]_ADV;[within the limits permitted by law]_PP;[reserved]_VP;[necessary log information]_NP;[,]_PUNC;[and]_COOR;[for]_VP;[security audit]_NP;[。]_PUNC};

[0088] Then, perform a stack-based scan of the phrase sequence from left to right:

[0089] (1) Phrase stack

[0090] When a phrase start point (such as NP, VP, PP) is encountered, the phrase is pushed onto the stack. The phrase stack depth is... Add 1; when encountering the end position corresponding to the phrase (such as comma, period, etc.), clear the phrase stack; when encountering a coordinating conjunction (such as "and", "and", "and", "as well as", etc.), treat it as a coordinating boundary, pop the relevant phrase (the phrase before the coordinating conjunction) from the stack, so that the coordinating phrases are at the same level.

[0091] (2) Subordinate layer

[0092] When encountering conditional / causal conjunctions (such as "if," "because," "therefore," etc.), activate the subordination level and subordination depth. Increment by 1; when the end position of the subordinate clause is scanned (such as the corresponding comma or period), the subordinate depth Decrease by 1 and close this subordinate layer.

[0093] (3)Word-level component depth

[0094] For the i-th phrase in sentence T, define its nesting depth as .

[0095] Taking Q as an example, the depths of some words are shown in Table 2.

[0096] Table 2 Depth table of some words

[0097]

[0098] Then the level of the词性成分 (lexical components) of sentence Q is:

[0099]

[0100] Among them, assume that the sentence has T phrases in total, and denote the maximum nesting depth of all phrases in this sentence as , and normalize the nesting depths of all phrases in this sentence: , and are the coefficients of weighted average and maximum value.

[0101] Lu Jianming's readability formula originally calculated the sentence complexity by calculating "form verbs" such as "jiayi" (加以) and "jinxing" (进行) in Chinese. So essentially, linking verbs drive the increase in sentence difficulty. In view of the characteristic that privacy policies have many conjunctions, the Lu Jianming readability formula of this invention then quantitatively evaluates the text organizational structure based on information density and logical connection density.

[0102] Calculating the Lu Jianming readability of the detected privacy statement text includes: calculating the information density and logical connection density of the detected privacy statement text, and performing weighted combination on the information density and logical connection density to obtain the Lu Jianming readability of the detected privacy statement text; the formula is as follows:

[0103]

[0104] Among them, , are weights.

[0105] The calculation process of information density is as follows:

[0106] First, divide the privacy statement text into sentences to obtain S sentences, and perform word segmentation on each sentence s. After word segmentation, the length of each sentence s is The i-th word is denoted as ;

[0107] Obtain a stop word list. Stop words are typically: function words (without actual lexical meaning) that mainly serve a grammatical purpose; and extremely high-frequency words (which appear in almost all documents). These words appear frequently in the text but contribute little to semantic understanding, topic modeling, or classification tasks, and may even introduce noise. There are many publicly available stop word lists that can be obtained directly.

[0108] Based on the part-of-speech tagging results, words whose part of speech is any one of noun, verb, adjective, or adverb, as well as words not in the stop word list, are categorized. Treat each word as a content word; calculate each word. Content word indicator coefficient ;

[0109] Obtain a glossary of terms in the field of privacy protection and data security, and find the terms in the glossary of terms in the field of privacy protection and data security. Identify it as a domain term; calculate each word Domain terminology indicator coefficient Glossaries in the field of privacy protection and data security include personal information, sensitive personal information, processing purpose, legal basis, retention period, etc. There are many publicly available glossaries that can be directly obtained.

[0110] Inverse document frequency of each word is calculated based on a large-scale corpus. Then normalize it to [0,1] to get each word Normalized inverse document frequency :

[0111]

[0112] in, , The maximum and minimum inverse document frequencies in sentence s, respectively. .

[0113] For sentence s, its information density Defined as:

[0114]

[0115] in, is a weighting parameter used to control the contribution of term hit and vocabulary rarity to information density.

[0116] Calculate the information density of all sentences The average value is used to obtain the information density of the privacy statement text to be detected.

[0117] Logical connection density is calculated as follows:

[0118] The privacy statement text to be tested is segmented into S sentences. Each sentence s is then further segmented at punctuation and conjunctions to obtain the remaining sentence s. The clauses are as follows: ;

[0119] For any pair of adjacent clauses in each sentence s If clause If there are explicit conjunctions of the types such as causality, conditionality, contrast, parallelism, progression, or concession between the clauses, then the clauses are related to... Valid logical links; otherwise, marked as no link. Correspondingly defined:

[0120]

[0121] Count the number of clause pairs with effective logical links in each sentence s, and calculate the logical connection density of each sentence s based on the number of clause pairs with effective logical links. Specifically defined as:

[0122]

[0123] The logical connection density of the privacy statement text to be detected is obtained by averaging the logical connection densities of all sentences.

[0124] Language model perplexity (PPL) is a metric for calculating the performance of generative models. A higher PPL indicates a more perplexing model and worse performance. Therefore, it can be applied to evaluating privacy statements, quantifying the predictability of a text's language to the reader: readable, straightforward clauses correspond to low PPL; lengthy, deeply nested clauses correspond to high PPL. Language model perplexity characterizes "circumventing statements / clichés" based on semantic predictability, avoiding the naturally high PPL of long texts.

[0125] Computational language model perplexity The process includes: segmenting the privacy statement text using a pre-trained language model (transformer encoder) to obtain the conditional probability of each word in its context; secondly, taking the natural logarithm of the conditional probabilities of all words and averaging them to obtain the cross-entropy value; and finally, performing an exponential operation on the cross-entropy value to obtain the perplexity value of the privacy statement text. The calculation formula is as follows:

[0126]

[0127] Where N represents the total number of words in the privacy statement text, Indicates the i-th word, This represents the conditional probability of the current word i predicted by the language model.

[0128] Finally, by assigning weights to the above indicators and summing them up, the formula is obtained, where the sum of each weight is 1; the formula is shown below:

[0129]

[0130] in, , , , For weights.

[0131] Finding ambiguity in a website's privacy statement includes:

[0132] The fuzzy types encompass four aspects: conditional constraints, generalized expressions, fuzzy quantifiers, and possibility expressions. For the first three fuzzy types, a keyword matching method is used to identify the conditional constraint words, generalized words, and fuzzy quantifiers corresponding to each sentence in the privacy statement text, and sentences containing any one of these three words are extracted. For possibility expressions, part-of-speech tagging technology is used to locate modal verbs (such as can, may, can, possible, etc.) in the privacy statement text, and sentences without a negation word before the modal verb are identified as possibility expressions, and these possibility expressions are extracted. The extracted sentences are then deduplicated to obtain a fuzziness score. Among them, conditional constraint words are words that express premises, restrictions, boundaries, or dependencies, used to limit the conditions or scope for the statement to be true, such as conditional conjunctions; generalized words are words that express universality, broad applicability, or abstract generalization, such as generic nouns and abstract generalization verbs; fuzzy quantifiers are words that express imprecise quantities or degrees, with unclear semantic boundaries, and depend on context for understanding, such as small amount, low frequency, etc.

[0133] The fuzziness detection is based on summarizing the detection results of four types of fuzziness, and finally generating an overall fuzziness score R for the document, which serves as the comprehensive result of the fuzziness detection. The formula is shown below:

[0134]

[0135] Where N represents the total number of sentences in the document, It is a binary value (0 or 1) indicating whether the i-th sentence contains any of the above fuzzy types. If the sentence contains any type, then... ,otherwise .

[0136] The compliance test results are a comprehensive report that includes integrity testing, readability testing, and ambiguity testing.

[0137] like Figure 4As shown, another aspect of the present invention employs an apparatus based on the above-described website privacy statement compliance detection method, comprising:

[0138] The preprocessing module is used to preprocess the privacy statement text and legal documents to obtain the training dataset;

[0139] The training module is used to train the integrity detection model based on the training dataset to obtain the trained integrity detection model;

[0140] The detection module is used to calculate the integrity score, readability score, and ambiguity score of the privacy statement text to be detected based on the trained integrity detection model.

[0141] The preprocessing module includes: a segmentation and sentence segmentation module, a data cleaning module, and an input construction module. The segmentation and sentence segmentation module is used to segment and segment the text into sentences, the data cleaning module is used to clean the sentences to obtain the training dataset, and the input construction module is used to construct the datasets for the MLM task and the NSP task based on the training dataset.

[0142] The training module includes: a pre-training continuation module, a classification label system construction module, and a fine-tuning training module. The pre-training continuation module is used to continue pre-training the language model based on the MLM task dataset and the NSP task dataset. The classification label system construction module is used to construct a classification label system. The fine-tuning training module is used to label the training dataset according to the classification label system and to fine-tune the language model and classification model after further pre-training based on the labeled training dataset.

[0143] The detection module includes: an integrity detection module, a readability detection module, and a fuzziness detection module. The integrity detection module is used to calculate the integrity score based on the detection results of the privacy statement text to be detected output by the integrity detection model. The readability detection module is used to calculate the readability score of the privacy statement text to be detected. The fuzziness detection module is used to calculate the fuzziness score of the privacy statement text to be detected.

[0144] The above-described embodiments further illustrate the purpose, technical solution, and advantages of the present invention. It should be understood that the above-described embodiments are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made to the present invention within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for website privacy policy compliance detection based on continue pre-training strategy, characterized in that, The method comprises the following steps: obtaining a privacy statement text to be detected, inputting the privacy statement text to be detected into a trained integrity detection model, obtaining a detection result, and calculating an integrity score according to the detection result; The integrity detection model comprises a language model and a classification model; the training process of the integrity detection model comprises: S1, obtaining a privacy statement text and a legal document, preprocessing the privacy statement text and the legal document to obtain a training data set; constructing an MLM task data set and an NSP task data set according to the training data set; S2, continuing pre-training the language model according to the MLM task data set and the NSP task data set to obtain a language model after continuing pre-training; continuing pre-training the language model comprises: S21, performing structure perception and structure mask enhancement on the MLM task data set respectively to obtain a structure perception data set and a structure mask enhancement data set; S22, inputting the structure perception data set, the structure mask enhancement data set and the NSP task data set into the language model respectively, calculating a loss function value of the MLM task according to the output of the structure perception data set and the structure mask enhancement data set in the language model, and calculating a loss function value of the NSP task according to the output of the NSP task data set in the language model; S23, calculating a total loss function value according to the loss function value of the MLM task and the loss function value of the NSP task, updating the language model according to the total loss function value, and obtaining the language model after continuing pre-training when the total loss function value is the minimum; S3, constructing a classification label system of a website privacy statement, labeling the training data set according to the classification label system, and fine-tuning the language model after continuing pre-training and the classification model according to the training data set with labeled labels to obtain a trained integrity detection model.

2. The method of claim 1, wherein the method further comprises: The preprocessing of the privacy statement text and the legal document comprises segmenting and segmenting the privacy statement text and the legal document to obtain a sentence set of the privacy statement text and the legal document, and cleaning the data of the sentence set of the privacy statement text and the legal document to obtain the training data set.

3. The method of claim 1, wherein the method further comprises: The structure perception of the MLM task data set comprises: performing structured text processing on each sentence in the MLM task data set to obtain the domain core terms and structural features of each sentence; and performing masking processing on the domain core terms and structural features of each sentence in the MLM task data set to obtain the structure perception data set.

4. The method of claim 1, wherein the method further comprises: The structure mask enhancement on the MLM task data set comprises: performing structured text processing on each sentence in the MLM task data set to obtain a main component, a parallel structure and a conditional structure of each sentence; setting a mask probability of the main component, the parallel structure and the conditional structure of each sentence as , setting mask probabilities of the remaining words as , , and performing mask on each sentence in the MLM task data set according to the mask probability to obtain a structure mask enhancement data set.

5. The method for website privacy statement compliance detection based on continue pre-training strategy according to claim 1, characterized in that, The detection result comprises a predicted privacy category of each sentence in the privacy statement text to be detected; Computing the integrity score comprises counting the number of privacy categories among the privacy categories predicted for all sentences of the privacy statement text then the integrity score ; wherein C is the total number of privacy categories in the classification label system.

6. The method for website privacy statement compliance detection based on continue pre-training strategy according to claim 1, characterized in that, It also includes readability detection of the privacy statement text to be detected; the readability detection comprises calculating CnText language complexity, Chen Shimen language complexity index, Lu Jiaming readability and language model perplexity of the privacy statement text to be detected; and combining the CnText language complexity, Chen Shimen language complexity index, Lu Jiaming readability and language model perplexity by weighting to obtain a readability score of the privacy statement text to be detected.

7. The method of claim 6, wherein the method further comprises: The method comprises the following steps: performing sentence segmentation on the to-be-detected privacy statement text to obtain S sentences; calculating the word length, part-of-speech complexity and part-of-speech component level of each sentence s; and combining the word length, part-of-speech complexity and part-of-speech component level of all sentences by weighting to obtain the Chen Shimin language complexity index of the to-be-detected privacy statement text; wherein the word length of each sentence s is the sentence length; the part-of-speech complexity of each sentence s is the number of types of parts of speech contained in the sentence; the calculation of the part-of-speech component level of each sentence s comprises the following steps: performing word segmentation on the sentence s by using a part-of-speech tagging tool to obtain a phrase sequence of the sentence s; and calculating the part-of-speech component level of the sentence s according to the nesting depth of each phrase in the phrase sequence of the sentence s.

8. The method of claim 6, wherein the method further comprises: The Lu Jianming readability of the detected privacy statement text is calculated by: calculating the information density and the logical connection density of the detected privacy statement text, and combining the information density and the logical connection density by weighting to obtain the Lu Jianming readability of the detected privacy statement text. The information density calculation process comprises the following steps: The privacy declaration text to be detected is segmented into S sentences, each sentence s is segmented into words, and the number of words in each sentence s is obtained ; wherein i is the index of the word;​ Obtaining a stop word list, words with any of the following parts of speech: noun, verb, adjective, adverb, and words not in the stop word list regarded as content words, calculate the content word indicator coefficient of each word content word ; Obtain a glossary of terms in the field of privacy protection and data security, and find the terms in the glossary of terms in the field of privacy protection and data security. Treat each word as a domain term and calculate its meaning. Domain terminology indicator coefficient ; Compute the inverse document frequency of each word and normalize it to get the normalized inverse document frequency of each word Compute the inverse document frequency of each word and normalize it to get the normalized inverse document frequency of each word Compute the inverse document frequency of each word and normalize it to get the normalized inverse document frequency of each word The information density of each sentence s is: The information density of each sentence s is: wherein is a weight parameter; calculating the average of the information density of all sentences to obtain the information density of the privacy declaration text to be detected; The logical connection density calculation process comprises the following steps: segmenting a privacy declaration text to be detected into S sentences, segmenting each sentence s at punctuation and conjunctions to obtain a plurality of clauses of each sentence s ; wherein j is an index of a clause For any pair of adjacent clauses in each sentence s If clause If there are explicit conjunctions between the clauses, then the clauses are... Valid logical links; The number of valid logical link sub-clause pairs of each sentence s is counted, and the logical connection density of each sentence s is calculated according to the number of valid logical link sub-clause pairs of each sentence s. The average value of the logical connection densities of all sentences is calculated to obtain the logical connection density of the to-be-detected privacy statement text.

9. The method of claim 1, wherein the method further comprises: The method further comprises the following steps: adopting a keyword matching method to identify the conditional constraint words, generalization words and fuzzy quantifiers in each sentence of the to-be-detected privacy statement text, and extracting the sentences containing any of the conditional constraint words, generalization words and fuzzy quantifiers; identifying the modal verbs in the to-be-detected privacy statement text by using a part-of-speech tagging technology, and extracting the possibility expression sentences by determining the sentences not accompanied by negative words before the modal verbs; and calculating the fuzziness score of the privacy statement text according to the extracted sentences.

10. Apparatus for website privacy statement compliance detection according to any one of claims 1 to 9, characterized in that, The method comprises the following steps: The preprocessing module is configured to preprocess the privacy statement text and the legal regulation document to obtain a training data set; The training module is configured to train the integrity detection model according to the training data set to obtain a trained integrity detection model; The detection module is configured to calculate the integrity score, the readability score and the fuzziness score of the to-be-detected privacy statement text according to the trained integrity detection model.