Method for extracting and verifying association relationship between main body and privacy for unstructured text

By combining a two-stage collaborative architecture with discriminative and generative models, the problems of accuracy and computational cost in attributing privacy information to subjects in unstructured text are solved, achieving efficient and interpretable privacy association identification.

CN122021899APending Publication Date: 2026-05-12BEIJING UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING UNIV OF TECH
Filing Date
2026-01-29
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately identify the subject attribution of privacy information in complex unstructured text, especially in scenarios involving cross-sentence semantic dependencies and multiple subject co-occurrences, resulting in implicit privacy underreporting, illusion risks, and high computational costs.

Method used

It adopts a two-stage collaborative + probabilistic fusion architecture, combining discriminative and generative models. The discriminative model extracts explicit associations and generates a potential candidate set, while the generative model performs controlled inference verification. The probabilistic fusion strategy outputs high-precision and interpretable subject-privacy association results.

Benefits of technology

It achieves high-precision, low-cost subject-privacy association identification, solves the bottleneck of implicit privacy mining, suppresses the risk of illusion, optimizes computational efficiency and multi-subject attribution accuracy, and is suitable for industrial-scale large-scale data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122021899A_ABST
    Figure CN122021899A_ABST
Patent Text Reader

Abstract

The invention provides an unstructured text-oriented subject and privacy association relationship extraction and verification method, which relates to the technical field of privacy protection, and comprises the following steps: receiving an input unstructured text document, a subject set and a privacy value candidate fragment set; an explicit subject-privacy association triple is extracted based on a discriminant model, potential privacy attributes of the subject are predicted, an explicit triple set and a candidate set to be verified are generated, the explicit triple set comprises associations directly appearing in the unstructured text document, and the candidate set to be verified comprises potential associations based on global semantic prediction; performing semantic reasoning verification and implicit attribute completion on the candidate set to be verified based on the generative model to generate a reasoning verification result; and based on a probability fusion strategy, fusing the explicit triple set and the reasoning verification result, and outputting a high-precision and interpretable subject-privacy association triple list. According to the method, the multi-subject affiliation accuracy is optimized, and an interpretable and high-robustness solution is provided for privacy compliance application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of privacy protection technology, and in particular to a method for extracting and verifying the relationship between subjects and privacy in unstructured text. Background Technology

[0002] With the deepening of digital transformation, fields such as healthcare, legal proceedings, and financial auditing have accumulated massive amounts of natural language text data, a significant portion of which consists of unstructured documents containing complex contextual information. These texts (such as electronic medical records, judgments, and chat logs) typically exhibit cross-sentence semantic dependencies and multi-subject co-occurrence (e.g., patients, family members, medical staff, parties involved, witnesses, etc.). Under the requirements of data compliance (such as GDPR and personal information protection laws), simply identifying "which sensitive words are contained in the text" is insufficient. Practical applications urgently need to address the problem of "subject-privacy attribution association," that is, in documents containing multiple individuals, accurately determining which subject a piece of privacy information (such as "diagnosed with depression") belongs to, thereby constructing a structured privacy profile.

[0003] Currently, research on the identification of privacy-related relationships in text subjects mainly involves technical means such as sensitive information detection, document-level relationship extraction, and large-scale model applications.

[0004] The first category is sensitive information detection technology based on pattern matching and sequence labeling, which is also the most widely used solution in the industry. It mainly relies on regular expressions to match characters of specific formats, or uses named entity recognition models such as BERT-CRF to label private information as specific entities.

[0005] The second category is general-domain document-level relation extraction techniques. These methods use graph neural networks or fully connected attention mechanisms to capture the semantic dependencies between entity pairs in a document, with the aim of extracting the semantic relationship between two entities from the document.

[0006] The third category is end-to-end generation technology based on large language models, which involves constructing prompt words to allow the generative model to read the entire text and directly outputting structured results in a sequence generation mode.

[0007] The shortcomings of existing technologies: While existing solutions provide theoretical basis and methodological support for this invention, the following significant technical bottlenecks still exist in complex subject-privacy related tasks, especially in document-level contexts: First, traditional discriminative models lack deep semantic reasoning capabilities: they cannot understand privacy attributes that are not explicitly mentioned in the text but are logically implied (such as inferring identity based on behavioral descriptions), resulting in a large number of implicit privacy underreporting.

[0008] Second, generative large models are prone to illusion risks and have high implementation costs: directly using end-to-end large models can easily generate non-existent associations, especially when dealing with document-level inputs, they face context window limitations and high computing power costs, making it difficult to meet the needs of industrial-grade large-scale data processing.

[0009] Third, challenges arise from cross-sentence semantic dependencies and multi-subject confusion: In complex texts with cross-sentence references and multi-subject co-occurrence, existing methods struggle to handle long-distance semantic dependencies, making it easy for erroneous associations to occur.

[0010] To address the shortcomings of the existing technologies, the technical problem this invention aims to solve is: how to construct a hybrid architecture that can leverage the efficiency of discriminative models to achieve comprehensive coverage of explicit privacy, while also utilizing the reasoning capabilities of generative models to uncover implicit privacy and eliminate erroneous associations, thereby achieving high-precision, low-cost, and interpretable subject-privacy association identification. Summary of the Invention

[0011] To address the problems in the background technology, this invention provides a method for extracting and verifying subject-privacy associations in unstructured text. By introducing an innovative architecture of "two-stage collaboration + probabilistic fusion", it combines the high accuracy of discriminative models with the deep semantic understanding capabilities of generative models, breaking through the bottleneck of traditional methods in implicit privacy mining, suppressing the risk of illusion, optimizing computational efficiency and multi-subject attribution accuracy, and providing an interpretable and highly robust solution for privacy-compliant applications.

[0012] To achieve the above objectives, this invention provides a method for extracting and validating subject-privacy associations in unstructured text. For ease of explanation, the subject-privacy association task processed by this invention can be formalized into the following mathematical model: Let the input document be denoted as... ,in For the first There are 10 sentences. The set of subjects appearing in the text is denoted as _____. The predefined set of privacy attribute types is denoted as The objective of this invention is to obtain the documentation. Extract all valid subject-privacy triples. ,in In order to be with the main body and attribute type The associated privacy attribute value string, For document The set of potential privacy value candidate fragments. If For document If a certain substring is defined, then the triple is called "explicit" privacy; if If privacy is not derived from the context but from deterministic reasoning based on the context, it is called "implicit" privacy.

[0013] The method of the present invention includes: The input consists of an unstructured text document, a set of subjects, and a set of candidate privacy value segments, wherein the document is document-level text containing cross-sentence semantic dependencies; The first stage of processing based on the discriminative model involves extracting explicit subject-privacy association triples from the unstructured text document based on the subject set and the privacy value candidate fragment set, and generating an explicit triple set and a candidate set to be verified based on the latent privacy attributes of the subject predicted by the full-text semantics of the unstructured text document. The explicit triple set includes associations that appear directly in the unstructured text document, and the candidate set to be verified includes latent associations based on global semantic prediction. The second stage of processing based on the generative model involves performing semantic reasoning verification and implicit attribute completion on the candidate set to be verified based on the unstructured text document, and generating reasoning verification results. The generative model uses knowledge injection and thought chain mechanisms for controlled reasoning. Based on the probabilistic fusion strategy of development set calibration, the explicit triple set and the inference verification results are fused to output a high-precision, interpretable subject-privacy association triple list, and each result is accompanied by a fusion score and source tag.

[0014] As a further improvement of the present invention, the first-stage processing based on the discriminative model includes two sub-tasks executed in parallel: Subtask A: Calculate the association probability between each subject in the subject set and each privacy value candidate fragment in the privacy value candidate fragment set based on the document-level relation extraction model, extract explicit subject-privacy association triples, and generate the explicit triple set. Subtask B: Based on a multi-label classification model, predict the types of privacy attributes that each subject in the subject set may be involved in under the global context, and generate the candidate set to be verified; Subtask A and subtask B share the same depth context encoder and are synchronously optimized using a joint loss function.

[0015] As a further improvement of the present invention, the document-level relation extraction model adopts the ATLOP or DREEAM architecture to capture cross-sentence semantic dependencies in the document-level context; the multi-label classification model adopts a fully connected layer or a bilinear classifier to output the probability distribution of the subject's potential privacy attribute types.

[0016] As a further improvement of the present invention, the second-stage processing based on the generative model includes: The generative model adopts a lightweight large model and uses efficient parameter fine-tuning technology to transfer the model capabilities of the lightweight large language model, so that the lightweight large oracle model can be adapted to the privacy domain. The generative model receives the candidate set to be verified, reads the metadata configuration of the attribute for each subject-attribute candidate value to be verified, extracts the inference permission flag, standard value format and few sample examples, and dynamically assembles and generates injection instructions based on the inference permission flag. If the inference permission is True, an injection instruction is generated that allows logical inference based on contextual implicit clues. If the inference permission is False, an injection instruction is generated that strictly limits the extraction of only explicit textual evidence. The distributed inference template is hard-coded into the instruction. Before the model outputs the inference verification result based on the instruction, it generates a natural language inference path and performs restricted decoding to ensure that the output conforms to the predefined JSON Schema. The JSON Schema includes at least existence, privacy value, evidence fragment, and inference analysis fields.

[0017] As a further improvement of the present invention, the lightweight large language model is a generative model with a parameter count of 0.6B to 7B, selected from the Qwen3 series or Llama 3 series; the parameter fine-tuning adopts QLoRA technology, training only the low-rank adapter weights; the inference stage uses the vLLM inference framework, and optimizes memory management through PagedAttention technology.

[0018] As a further improvement of the present invention, the probabilistic fusion strategy includes: Calculate the statistical prior probability of the first stage, and map the explicit sampling results to continuous probability values ​​based on the precision prior and the underreport prior on the development set. The multi-dimensional indicators output in the second stage are analyzed, including existence indicators, format compliance indicators, and candidate set hit indicators. The reasoning confidence is obtained by weighted summation. The scores from the first and second stages are fused using a linear weighted formula to obtain a fused score. Then, a conditional backoff logic is executed based on the global decision threshold, prioritizing the results from the second stage with higher confidence, and backoffing to the explicit results from the first stage.

[0019] As a further improvement of the present invention, a conditional backoff logic is executed based on a global decision threshold, prioritizing the adoption of the high-confidence stage two result and backoffing to the explicit result of stage one, including: Let the global decision threshold be... Record the privacy values ​​given in the first and second phases respectively. , ; When the fusion score F(t) ≥ δ and the privacy value of the second-stage output When, adopt ; When the fusion score F(t) < δ and the privacy value output in the first stage When, adopt Otherwise, the association is deemed non-existent.

[0020] As a further improvement of the present invention, the linear weighting formula is defined as follows: For any candidate triplet t in the explicit triplet set and the inference verification result, the final fusion score F(t) = αr(t) + (1-α)q(t), where r(t) represents the statistical prior probability of the first stage, q(t) represents the comprehensive confidence of the second stage, and α is the global weight parameter calibrated on the development set.

[0021] As a further improvement of the present invention, a privacy knowledge base is also included, which stores metadata of privacy attributes in JSON format, including inference permission flags, standard value formats, and few-sample examples; the inference permission flags are used to control the inference boundary of the generative model, and allow operation types including extraction only and extraction and inference.

[0022] As a further improvement of the present invention, each result in the output subject-privacy associated triple list is marked as originating from explicit extraction or inference completion, and a fusion score and inference path are provided to support auditing and interpretability.

[0023] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention achieves significant advantages over existing technologies by introducing an innovative architecture of "two-stage collaboration + probabilistic fusion". This architecture first uses a discriminative model to efficiently extract explicit associations from documents and predict latent attributes, generating a candidate set with high coverage. Then, it uses a generative model for controlled inference verification, effectively combining the high accuracy of the discriminative model with the deep semantic understanding capability of the generative model. This breaks through the bottleneck of traditional methods in implicit privacy mining, suppresses the risk of illusion, and optimizes computational efficiency and multi-subject attribution accuracy through a probabilistic fusion mechanism. It provides an interpretable and highly robust solution for industrial-grade privacy compliance applications.

[0024] Compared with traditional document-level relation extraction methods (ATLOP, DREEAM) and simple large-model end-to-end extraction methods, this invention has the following substantial differences in overall process and key steps: First, it adopts a two-stage sequential process of "explicit extraction – inference verification". In the first stage, a candidate set to be verified is generated first, and in the second stage, only the candidate set is verified / completed item by item, rather than performing end-to-end full enumeration extraction of the entire text; Second, in the inference verification stage, controlled prompts and output constraints of "allowed operation type (extraction only / extraction and inference) + knowledge base standard value format + thought chain inference path" are introduced, rather than relying solely on fixed prompt words and free generation; Third, in the decision-making stage, a unified decision-making mechanism of "development set statistical prior + three-index analytical confidence + linear weighted fusion + conditional backoff" is adopted, rather than simply superimposing model scores or fixed rule priority.

[0025] This invention overcomes the bottleneck of traditional extraction models in mining implicit privacy attributes: existing document-level relation extraction techniques mainly rely on the explicit co-occurrence features of entity pairs in text, failing to handle privacy attributes that are not directly mentioned but logically implicit. This invention introduces a stage-two generative reasoning module, leveraging the deep semantic understanding and thought chain mechanism of large language models to infer implicit privacy attributes based on pronoun references, behavioral descriptions, and common-sense logic, much like human experts. This dual guarantee of "explicit evidence + implicit reasoning" significantly improves the completeness and recall of privacy mining, filling the gap in implicit information processing in traditional models.

[0026] This invention effectively solves the illusion risk and confidence calibration problems brought about by relying solely on generative models: directly using large models for end-to-end extraction easily leads to erroneous associations (illusions) that arise from nothing, and the confidence levels of their output are often unreliable. This invention provides high-confidence explicit evidence as prior constraints through a discriminative model in stage one, and limits the model's inference boundaries through knowledge-injected prompts in stage two. More importantly, this invention designs a probabilistic fusion strategy based on statistical priors from the development set, which can dynamically adjust the decision weights of the discriminative and generative models according to attribute type (explicit / implicit). This mechanism, while preserving the fidelity of the original text in stage one, utilizes logical error correction in stage two, effectively suppressing model illusions and ensuring the extremely high accuracy required for privacy compliance audits.

[0027] This invention achieves engineering-level optimization of computational cost and extraction efficiency in document-level context: When processing document-level text, using a large model for full-scale scanning and inference faces enormous computational consumption and time latency. This invention utilizes the lightweight latent attribute prediction branch (task B) in stage one as a "filter" to quickly identify the range of attributes that the subject may be involved in, thereby significantly pruning the candidate space that needs to be verified in stage two. This cascaded architecture of "coarse-fine combination" avoids blind inference on all possible "subject-attribute" pairs. Compared with the full-scale large model solution, it significantly reduces memory usage and inference latency while maintaining the current best performance level, making it feasible for implementation on industrial-scale large-scale data.

[0028] This invention improves the accuracy of attributing relationships in complex multi-subject contexts: In legal documents or meeting minutes involving multiple individuals, existing technologies are prone to misattribution due to textual proximity. This invention constructs a structured context containing a specific subject and all its referential forms in Phase Two, forcing the model to focus on the semantic space of that specific subject for verification. Combined with the "reasoning path" output by the thought chain, the system can clearly distinguish which subject the privacy value belongs to, effectively solving the multi-subject confusion problem and providing traceable logical evidence for each extraction result, greatly enhancing the system's interpretability. Attached Figure Description

[0029] Figure 1 This is a diagram illustrating the overall logical architecture of a method for extracting and verifying subject-privacy relationships in unstructured text, as disclosed in one embodiment of the present invention. Figure 2 This is an algorithm flowchart of a method for extracting and verifying subject-privacy associations in unstructured text, as disclosed in one embodiment of the present invention. Detailed Implementation

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

[0031] The present invention will now be described in further detail with reference to the accompanying drawings: This invention provides a method for extracting and verifying subject-specific and privacy-preserving relationships in unstructured text. Addressing the challenges of sparse explicit evidence distribution, implicit attribute-dependent reasoning, and severe multi-subject confusion in document-level contexts, it proposes a unique "two-stage collaborative + probabilistic fusion" overall architecture, distinct from existing document-level relationship extraction and end-to-end large-scale model solutions. This innovatively combines the efficient filtering capabilities of discriminative models with the deep reasoning capabilities of generative large-scale models. The "document-level text" (or document-level context) of this invention refers to a text sequence containing multiple natural sentences or paragraphs, where semantic dependencies cross the boundaries of a single sentence. Compared to sentence-level text, its significant characteristics lie in the existence of long-distance cross-sentence references and the co-occurrence of multiple subjects across different paragraphs.

[0032] like Figure 1 As shown, the logical architecture of this invention mainly includes an input layer, an explicit association coarse screening layer, an inference verification enhancement layer, and a decision fusion output layer. In the overall process, the method first receives the input text and candidate fragments of privacy values ​​detected from the upstream identified subject and privacy information. That is, the input includes at least: document text. , main body set Privacy value candidate fragment set The system outputs a list of (subject, privacy category, privacy value) triples, with a fusion score and source tag (explicit extraction / inference completion) for each result. Phase one utilizes a multi-task document-level relation extraction model based on a discriminative encoder. This phase employs pluggable document-level relation extraction, but its output is fixed as a set of explicit triples. With the set of candidate pairs to be verified To ensure reproducible integration with the subsequent Phase 2 fusion module, Phase 2 introduces a generative validator based on a lightweight large language model. Utilizing efficient parameter fine-tuning (QLoRA) and CoT (CoT) techniques, it performs deep semantic logic verification and implicit attribute completion on the subject-attribute type candidate set from Phase 1. Finally, through a probabilistic fusion mechanism with development set calibration, it dynamically integrates the prediction confidence from both phases, outputting a high-precision, interpretable list of (subject, privacy category, privacy value) triples.

[0033] like Figure 2 As shown, the specific steps of this invention include: S1. Receive input unstructured text document, subject set, and privacy value candidate fragment set, wherein the document is document-level text containing cross-sentence semantic dependencies; Among them, unstructured text documents are denoted as ,in For the first A set of sentences; the set of subjects appearing in an unstructured text document is denoted as . Furthermore, the predefined set of privacy attribute types is denoted as The objective of this invention is to obtain documents Extract all valid subject-privacy triples. ,in In order to be with the main body and attribute type The associated privacy attribute value string, For document The set of potential privacy value candidate fragments. If For document If a certain substring of v appears in D, then the triple is called explicit privacy; if v does not appear directly in D, but is obtained through deterministic reasoning based on the context, then it is called implicit privacy.

[0034] S2. The first stage of processing based on the discriminative model extracts explicit subject-privacy association triples from unstructured text documents based on the subject set and the privacy value candidate fragment set. Based on the full-text semantic prediction of the subject's potential privacy attributes, an explicit triple set and a candidate set to be verified are generated. The explicit triple set includes associations that appear directly in the unstructured text documents, and the candidate set to be verified includes potential associations based on global semantic prediction. The first stage of processing, based on the discriminative model, includes two subtasks executed in parallel: Subtask A: Calculate the association probability between each subject in the subject set and each privacy value candidate segment in the privacy value candidate segment set based on the document-level relation extraction model, extract explicit subject-privacy association triples, and generate an explicit triple set. Subtask B: Based on a multi-label classification model, predict the types of privacy attributes that each subject in the subject set may be involved in under the global context, and generate a candidate set to be verified. Subtask A and subtask B share the same deep context encoder and are synchronously optimized using a joint loss function.

[0035] Furthermore, the document-level relation extraction model employs the ATLOP or DREEAM architecture to capture cross-sentence semantic dependencies in the document-level context; the multi-label classification model uses a fully connected layer or a bilinear classifier to output the probability distribution of the subject's potential privacy attribute types.

[0036] Specifically, the first stage aims to address the issues of rapid extraction of explicit evidence from text and pruning of the latent search space, significantly narrowing the candidate range in complex scenarios with cross-sentence semantic dependencies. This module is built on a shared deep context encoder and executes two core subtasks in parallel: First, the explicit triple extraction branch (Task A) is responsible for calculating the relationship probability between all given "subject-explicit privacy value" pairs. In a lightweight implementation, this branch can use a simple fully connected layer or a bilinear classifier as the relationship classification head, directly concatenating or operating on the feature vectors of the subject and privacy value output by the encoder to quickly determine whether a specific privacy relationship exists. In a high-performance implementation, advanced document-level relationship extraction model architectures, such as the ATLOP or DREEAM models, can be integrated. Leveraging the advantages of these models in local context aggregation and adaptive thresholding, explicit semantic dependencies across sentences in the document-level context can be captured more accurately. This result serves as both an "explicit evidence source" for the final fusion and a high-confidence candidate input for the next stage.

[0037] Secondly, the latent attribute prediction branch (Task B) is responsible for profiling the "subject" from a global perspective. This branch uses a multi-label classification head and, based on the semantic information of the entire document, predicts "what types of privacy attributes the subject may be involved in" in the current context (e.g., predicting the subject involves "medical and health" attributes, but not "financial asset" attributes). This task outputs a list of latent attributes of the subject, i.e., (subject, latent privacy category). This list serves as the "candidate set to be verified" in Phase Two, effectively filtering out irrelevant relationships and avoiding blind inference by the large model about all relationships.

[0038] These two subtasks are trained synchronously using a joint loss function, sharing the underlying semantic understanding capabilities, thereby achieving interactive enhancement of local relation judgment and global attribute prediction in the feature space. Formally, let the shared encoder parameters be... For each subject-candidate value pair The explicit triplet extraction branch (Task A) outputs the probability distribution of each attribute type (including NA): in A classification scoring function based on the encoder output. Let... like and Then the output is an explicit triplet. ,in This is the text corresponding to the candidate value fragment.

[0039] For each subject The latent attribute prediction branch (Task B) is based on the subject's global semantic vector. Give the posterior probability for each attribute type: when At that time, Add to the "Candidate Set to be Verified". The threshold for Task B is included. Candidates can be selected from the development set based on the target recall rate to ensure that the candidate set covers the attribute types required for implicit inference. The joint loss of the two subtasks is defined as: ,in For the multi-label cross-entropy loss of task A, For the multi-label cross-entropy loss of task B, Hyperparameters for controlling the relative weights of the two tasks.

[0040] S3. The second stage of processing based on the generative model involves semantic reasoning verification and implicit attribute completion based on unstructured text documents to generate reasoning verification results. The generative model uses knowledge injection and thought chain mechanisms for controlled reasoning. The second-stage processing based on the generative model includes: Generative models employ lightweight large models and utilize efficient parameter fine-tuning techniques to transfer the capabilities of lightweight large language models, enabling lightweight large oracle models to adapt to the privacy domain. The generative model receives the candidate set to be verified, reads the metadata configuration of the attribute for each subject-attribute candidate value to be verified, extracts the inference permission flag, standard value format and few sample examples, and dynamically assembles and generates injection instructions based on the inference permission flag. If the inference permission is True, the injection instruction that allows logical inference based on contextual implicit clues is generated; if the inference permission is False, the injection instruction that strictly limits the extraction of only explicit textual evidence is generated. The distributed inference template is hard-coded into the instruction, which forces the model to generate a natural language inference path before outputting the inference verification result based on the instruction, and performs restricted decoding to ensure that the output conforms to the predefined JSON Schema. The JSON Schema contains at least existence, privacy value, evidence fragment, and inference analysis fields.

[0041] Furthermore, the lightweight large language model is a generative model with 0.6B to 7B parameters, selected from the Qwen3 series or Llama 3 series; efficient parameter fine-tuning adopts QLoRA technology, training only low-rank adapter weights; the inference stage uses the vLLM inference framework, and memory management is optimized through PagedAttention technology.

[0042] This invention also includes a privacy knowledge base that stores metadata of privacy attributes in JSON format, including inference permission flags, standard value formats, and few-sample examples; the inference permission flags are used to control the inference boundaries of the generative model, allowing operation types including extraction only and extraction and inference.

[0043] Specifically, Phase Two is dedicated to addressing the difficulties of implicit privacy mining and the model illusion problem. Its innovation lies in superimposing a combined mechanism of "dynamic prompt construction driven by a configurable privacy knowledge base + inference permission flag control + forced thought chain reasoning path" on top of a fine-tuned generative large language model. This module does not directly process the entire text; instead, it uses the candidate set output by Module One as a basis for deep semantic verification using a large language model. Specifically, Phase Two... As the smallest verification unit, each item is checked to determine whether the subject has the attribute and its corresponding privacy value, and candidates that do not meet the rules or lack evidence are rejected.

[0044] In terms of model selection and optimization, this invention preferably uses lightweight large model bases (such as the Qwen3 series, Llama3 series, etc., with 0.6B to 7B parameters) to balance inference capability and deployment cost. To adapt the general-purpose model to the specific needs of the privacy domain, this invention employs the QLoRA technique for efficient parameter fine-tuning. While keeping the base model parameters frozen, only the low-rank adapter weights are trained, thus achieving professional transfer of model capabilities on consumer-grade GPUs. Simultaneously, high-throughput inference frameworks such as vLLM are introduced during the inference phase, and PagedAttention technology is used to optimize memory management, significantly improving concurrency efficiency during large-scale text processing.

[0045] In the specific implementation of the reasoning mechanism, this invention designs a "dynamic context-aware prompt word construction algorithm", which includes the following specific execution steps: Knowledge Base Indexing and Retrieval: The system maintains a structured privacy knowledge base (JSON format) with privacy relationship types as keys. When receiving candidate values ​​of the subject-attribute to be verified from the output of Phase 1, the system first reads the metadata configuration of the attribute and extracts the "inference permission flag", "precise definition of the attribute", "standard value format (or format example)" and "few-shot inference example".

[0046] Dynamic instruction assembly: The system dynamically generates system-level instructions based on the "inference permission flag". If the flag is True, an instruction to "allow logical inference based on contextual implicit clues" is injected; if the flag is False, an instruction to "strictly restrict the extraction of only explicit textual evidence" is injected. This step suppresses the generation of illusions in the model from the source through rule constraints. The "inference permission flag" corresponds to the allowed operation type for each attribute, including at least "extract only" and "extract and infer". The system prohibits generative models from performing inferences that are inconsistent with the allowed operation types.

[0047] Context window reconstruction: To avoid noise interference from a large amount of irrelevant context, the system uses a sliding window algorithm to truncate text fragments containing the subject and its pronouns. This means the text fragments must at least cover all known mentions / references of the subject in the document, and the truncation is centered on the subject's mention location. The window length and stride are configurable parameters. All explicit privacy value fragments passed in the input are formatted as strings and concatenated into the "task details" area of ​​the instruction, forcing the model to focus its attention on the semantic space of a specific subject.

[0048] Forced guidance of the thought chain: At the end of the instructions, a step-by-step inference template is hard-coded, mandating that the model must first generate a natural language inference path including "rule self-check," "evidence location," and "logical judgment" before outputting the final JSON result. This step transforms the "black box" prediction process into a traceable logical deduction process. Specifically, the output of stage two adopts a predefined JSON schema, which includes at least the fields: exist (existence), value (privacy value or empty), evidence (evidence fragment / location), and analysis (inference path). Constrained decoding / restricted decoding is used in the inference stage to ensure that the output strictly conforms to the JSON schema, facilitating subsequent automatic parsing and fusion.

[0049] S4. Based on the probabilistic fusion strategy of development set calibration, the explicit triple set and inference verification results are fused to output a high-precision, interpretable subject-privacy association triple list, and each result is accompanied by a fusion score and source label.

[0050] The probabilistic fusion strategies include: Calculate the statistical prior probability of the first stage, and map the explicit sampling results to continuous probability values ​​based on the precision prior and the underreport prior on the development set. The multi-dimensional indicators output in the second stage are analyzed, including existence indicators, format compliance indicators, and candidate set hit indicators. The reasoning confidence is obtained by weighted summation. The scores from the first and second stages are merged using a linear weighted formula to obtain a merged score. Then, a conditional backoff logic is executed based on the global decision threshold, prioritizing the results from the second stage with higher confidence, and backoffing to the explicit results from the first stage.

[0051] Furthermore, conditional rollback logic is executed based on the global decision threshold, including: Let the global decision threshold be... Record the privacy values ​​given in the first and second phases respectively. , ; When the fusion score F(t) ≥ δ and the privacy value of the second-stage output When, adopt ; When the fusion score F(t) < δ and the privacy value output in the first stage When, adopt Otherwise, the association is deemed non-existent.

[0052] Each result in the output subject-privacy associated triple list is tagged as originating from explicit extraction or inference completion, and a fusion score and inference path are provided to support auditing and interpretability.

[0053] Specifically, because discriminative models (stage one) tend to rely on statistical features, while generative models (stage two) rely on semantic logic, their confidence distributions differ. Probabilistic fusion achieves accurate decision-making through the following steps: (1) Calculate the statistical prior probability of Phase 1. The system pre-calculates the extraction performance of the Phase 1 model on the development set to obtain two key probability values: one is the "accuracy prior," which is the historical probability that a certain association is true when Phase 1 predicts its existence; the other is the "missing prior," which is the background probability that a certain association still exists when Phase 1 does not predict it. In the actual inference process, the system traverses all triples to be verified. If the triple has been extracted by Phase 1, its initial score is assigned to the "accuracy prior"; if it has not been extracted (i.e., only mined by Phase 2), it is assigned the "missing prior." This step realizes the transformation of the discrete extraction results of Phase 1 into continuous probability values. Among them, the "accuracy prior" is the proportion of "true when Phase 1 judges it to exist," and the "missing prior" is the proportion of "true when Phase 1 judges it to not exist."

[0054] (2) Multidimensional verification metrics for Phase 2 aggregation. The system does not directly use the raw probabilities output by the large model, but instead analyzes the text output of Phase 2 and calculates the comprehensive confidence score from three dimensions: first, the "existence metric," which checks whether the model provides a positive existence conclusion; second, the "format compliance metric," which uses regular expressions to verify whether the extracted privacy values ​​conform to the format specifications defined by the knowledge base; and finally, the "candidate set hit metric," which determines whether the extracted values ​​fall within the candidate range provided in Phase 1. The system performs a weighted summation of the above three metrics to obtain the normalized confidence score for Phase 2. For each candidate triplet to be determined... Let the three indicators obtained from the second stage of analysis be as follows: , representing "existence indicator", "format compliance indicator", and "candidate set hit indicator", respectively. The system assigns non-negative weights to the three indicators. (This can be obtained through grid search or empirical settings on the validation set), satisfying... The overall confidence level for stage two is defined as follows: .

[0055] (3) Perform linear weighted fusion calculation. To balance the judgment weights in the two stages, the system uses linear interpolation to calculate the final fusion score. On the development set, let be... For any candidate triplet The statistical prior for stage one is defined as follows: in Let be the set of triples output from Phase 1. Let the global fusion weight be . The final fusion score is defined as follows: .

[0056] (4) Execution conditional fallback decision logic. The system sets a global decision threshold and executes hierarchical judgment logic based on the final fusion score. Let the global decision threshold be... The privacy values ​​given in Phase 1 and Phase 2 are recorded respectively. (If not specified, it is marked as empty). The final decision rule of this invention can be formalized as: That is, when the fusion score is high and a valid value is given in stage two, the result of stage two is adopted first; when the fusion score is insufficient but explicit extraction has been performed in stage one, the result of stage one is reverted to; if neither stage supports it, the association is considered to be non-existent.

[0057] Advantages of this invention: This invention provides a two-stage collaborative subject-privacy association extraction architecture of "explicit extraction-inference verification," protecting a processing flow for unstructured text, especially document-level context. Unlike existing schemes that only employ a single discriminative or generative model, this invention decouples the complex extraction task into two cascaded stages: the first stage uses a multi-task model based on a discriminative encoder to extract explicit triples through document-level relation extraction technology and simultaneously predict the latent attribute categories of the subject, thereby constructing a high-coverage candidate set containing explicit evidence and potential hypotheses; the second stage uses an inference verifier based on a generative large language model to perform deep semantic logic judgment and implicit attribute completion on this candidate set. This architecture solves the problem of single models struggling to balance accuracy and recall by combining the efficient capture capability of discriminative models for explicit information with the inference capability of generative models for implicit information. Its key feature is that the first stage outputs at least a (subject, attribute) candidate set to be verified, and the second stage only verifies / completes each item in this candidate set, rather than performing end-to-end full extraction of the entire text.

[0058] This invention, based on a shared encoder-based explicit association and latent attribute joint prediction mechanism, protects the core multi-task structure in Phase 1. Its key feature is the construction of a shared deep context encoder, upon which two complementary subtasks are executed in parallel: Task A employs a document-level relation extraction architecture to calculate the association matrix between the subject and text fragments, directly extracting explicitly present privacy triples from the text; Task B employs a multi-label classification architecture to predict a list of potential privacy attribute categories based on the subject's global semantic features. Both tasks share the underlying semantic representation and are jointly optimized. The prediction results of Task B guide the search scope in subsequent stages, effectively reducing computational redundancy in the system.

[0059] This invention, based on a dynamic reasoning verification method using knowledge injection and thought chains, protects the prompting engineering and reasoning logic in Phase Two. Its key feature is the design of a context-aware dynamic prompt word construction algorithm. This algorithm retrieves the corresponding "inference permission flag," attribute definition, and few-sample examples from a privacy knowledge base based on the attribute type of the triple to be verified, and dynamically assembles structured prompt words in conjunction with the original text context. If the permission flag allows inference, a logical deduction instruction is injected; otherwise, a strict extraction instruction is injected. Simultaneously, the model is forced to generate a natural language "reasoning path" containing rule checks, evidence searches, and logical verification before outputting a conclusion, thereby uncovering implicit privacy attributes and eliminating erroneous associations caused by text proximity. Unlike existing large-model extraction methods that rely solely on fixed prompt words or simple few-sample examples, this invention introduces the "inference permission flag" and a manually maintainable privacy knowledge base into the prompt construction and reasoning process, making the reasoning boundaries and knowledge sources of the generative model explicit as configurable parameters, thus forming a controllable and auditable generative verification mechanism. Its features also include: the inference permission flag corresponds to a "permitted operation type," which includes at least "extract only" and "extract and infer," and the inference boundary of the generative model is hard-constrained by this permitted operation type. Furthermore, the output of the generative validator follows a predefined JSON schema, and the output fields and types are guaranteed to satisfy the schema through restricted decoding / constraint decoding to support subsequent automatic parsing and auditing.

[0060] This invention proposes a dynamic probability fusion strategy based on explicit prior and inference confidence. In its final decision-making logic, it adopts a fusion strategy distinct from existing single-model scoring methods. Its key feature is the introduction of a confidence calibration mechanism based on statistical features of the development set. This mechanism first maps the explicit extraction results of Stage 1 Task A to statistical prior probabilities based on precision and false negative rates. Second, it analyzes the multi-dimensional indicators of the generated text in Stage 2 to calculate the comprehensive inference confidence. Finally, it fuses the scores from both stages using a linear weighted formula. The fusion employs global weight parameters and a single global decision threshold, both uniformly calibrated and determined on the development set to avoid the unreproducibility and overfitting caused by setting multiple thresholds for different attribute types. The system dynamically adjusts the weights according to the attribute type (explicit / implicit) and executes conditional backoff logic: when the inference confidence is high, the generated results are adopted; when the inference confidence is low but the explicit prior is high, the original results from Stage 1 are retained, thereby maximizing the recall of implicit information while ensuring no loss of explicit information.

[0061] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for extracting and verifying subject-privacy associations in unstructured text, characterized in that, include: The input consists of an unstructured text document, a set of subjects, and a set of candidate privacy value segments, wherein the document is document-level text containing cross-sentence semantic dependencies; The first stage of processing based on the discriminative model involves extracting explicit subject-privacy association triples from the unstructured text document based on the subject set and the privacy value candidate fragment set, and generating an explicit triple set and a candidate set to be verified based on the latent privacy attributes of the subject predicted by the full-text semantics of the unstructured text document. The explicit triple set includes associations that appear directly in the unstructured text document, and the candidate set to be verified includes latent associations based on global semantic prediction. The second stage of processing based on the generative model involves performing semantic reasoning verification and implicit attribute completion on the candidate set to be verified based on the unstructured text document, and generating reasoning verification results. The generative model uses knowledge injection and thought chain mechanisms for controlled reasoning. Based on the probabilistic fusion strategy of development set calibration, the explicit triple set and the inference verification results are fused to output a high-precision, interpretable subject-privacy association triple list, and each result is accompanied by a fusion score and source tag.

2. The method for extracting and verifying subject-privacy association relationships in unstructured text according to claim 1, characterized in that, The first-stage processing based on the discriminative model includes two subtasks executed in parallel: Subtask A: Calculate the association probability between each subject in the subject set and each privacy value candidate fragment in the privacy value candidate fragment set based on the document-level relation extraction model, extract explicit subject-privacy association triples, and generate the explicit triple set. Subtask B: Based on a multi-label classification model, predict the types of privacy attributes that each subject in the subject set may be involved in under the global context, and generate the candidate set to be verified; Subtask A and subtask B share the same depth context encoder and are synchronously optimized using a joint loss function.

3. The method for extracting and verifying subject-privacy association relationships in unstructured text according to claim 2, characterized in that, The document-level relation extraction model uses the ATLOP or DREEAM architecture to capture cross-sentence semantic dependencies in the document-level context; the multi-label classification model uses a fully connected layer or a bilinear classifier to output the probability distribution of the subject's potential privacy attribute types.

4. The method for extracting and verifying subject-privacy association relationships in unstructured text according to claim 1, characterized in that, The second-stage processing based on the generative model includes: The generative model adopts a lightweight large model and uses efficient parameter fine-tuning technology to transfer the model capabilities of the lightweight large language model, so that the lightweight large oracle model can be adapted to the privacy domain. The generative model receives the candidate set to be verified, reads the metadata configuration of the attribute for each subject-attribute candidate value to be verified, extracts the inference permission flag, standard value format and few sample examples, and dynamically assembles and generates injection instructions based on the inference permission flag. If the inference permission is True, an injection instruction is generated that allows logical inference based on contextual implicit clues. If the inference permission is False, an injection instruction is generated that strictly limits the extraction of only explicit textual evidence. The distributed inference template is hard-coded into the instruction. Before the model outputs the inference verification result based on the instruction, it generates a natural language inference path and performs restricted decoding to ensure that the output conforms to the predefined JSON Schema. The JSON Schema includes at least existence, privacy value, evidence fragment, and inference analysis fields.

5. The method for extracting and verifying subject-privacy association relationships in unstructured text according to claim 4, characterized in that, The lightweight large language model is a generative model with 0.6B to 7B parameters, selected from the Qwen3 series or Llama 3 series; the parameters are efficiently fine-tuned using QLoRA technology, training only the low-rank adapter weights; the inference stage uses the vLLM inference framework, and memory management is optimized through PagedAttention technology.

6. The method for extracting and verifying subject-privacy association relationships in unstructured text according to claim 1, characterized in that, The probability fusion strategy includes: Calculate the statistical prior probability of the first stage, and map the explicit sampling results to continuous probability values ​​based on the precision prior and the underreport prior on the development set. The multi-dimensional indicators output in the second stage are analyzed, including existence indicators, format compliance indicators, and candidate set hit indicators. The reasoning confidence is obtained by weighted summation. The scores from the first and second stages are fused using a linear weighted formula to obtain a fused score. Then, a conditional backoff logic is executed based on the global decision threshold, prioritizing the results from the second stage with higher confidence, and backoffing to the explicit results from the first stage.

7. The method for extracting and verifying subject-privacy association relationships in unstructured text according to claim 6, characterized in that, Based on the global decision threshold, the conditional backoff logic is executed, prioritizing the adoption of the high-confidence Phase 2 result and backoffing to the explicit result of Phase 1, including: Let the global decision threshold be... Record the privacy values ​​given in the first and second phases respectively. , When the fusion score F(t) ≥ δ and the privacy value of the second-stage output When, adopt ; When the fusion score F(t) < δ and the privacy value output in the first stage When, adopt Otherwise, the association is deemed non-existent.

8. The method for extracting and verifying subject-privacy association relationships in unstructured text according to claim 6, characterized in that, The linear weighting formula is defined as follows: For any candidate triplet t in the explicit triplet set and the inference verification result, the final fusion score F(t) = αr(t) + (1-α)q(t), where r(t) represents the statistical prior probability of the first stage, q(t) represents the comprehensive confidence of the second stage, and α is the global weight parameter calibrated on the development set.

9. The method for extracting and verifying subject-privacy association relationships for unstructured text according to claim 1, characterized in that: It also includes a privacy knowledge base that stores metadata of privacy attributes in JSON format, including inference permission flags, standard value formats, and few-sample examples; the inference permission flags are used to control the inference boundaries of the generative model, allowing operation types including extraction only and extraction and inference.

10. The method for extracting and verifying subject-privacy association relationships for unstructured text according to claim 1, characterized in that, Each result in the output subject-privacy associated triple list is tagged as originating from explicit extraction or inference completion, and a fusion score and inference path are provided to support auditing and interpretability.