Minimum evidence span alignment and accurate reference generation method and system

By employing direct access via number, semantic similarity retrieval, span-level evidence alignment, and counterfactual boundary learning, this approach addresses the issues of coarse evidence granularity, unstable boundaries, and unverifiable citations in information retrieval systems. It achieves precise evidence location and verifiable citations, thereby improving the efficiency and reliability of compliant question-and-answer systems.

CN121579640APending Publication Date: 2026-02-27GUANGZHOU CITY UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511754022.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

In existing information retrieval enhancement generation and compliance question answering systems, the coarse granularity of evidence, the unstable boundaries, the unverifiable citations, and the lack of adaptive supplementary evidence mechanisms lead to problems such as redundant information, omission of key information, and inaccurate citations in answer generation.

Method used

The candidate retrieval method combines direct access by number with semantic similarity recall, and integrates sequence labeling with span-level evidence alignment that can be explained and attributed. It generates standardized citations through counterfactual boundary learning and minimum evidence set selection, and triggers re-retrieval and supplementary evidence operations when evidence is insufficient.

Benefits of technology

It achieves precise evidence location and robust boundaries, verifiable generated citations, improves the completeness of answers and the reliability of the system, reduces illusion phenomena, and improves the efficiency of compliance Q&A and audit review.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579640A_ABST
    Figure CN121579640A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information retrieval and natural language processing, and particularly discloses a minimum evidence span alignment and accurate reference generation method and system. According to the method, candidate terms are obtained through direct numbering and semantic recall, Span-level evidence alignment is achieved through fusion of sequence labeling and interpretable attribution, the boundary robustness is optimized in combination with anti-fact boundary learning, closed-loop mending is triggered based on the minimum span coverage rate, and finally checkable reference with a standardized RefTag is output. According to the method, the problems of coarse evidence granularity, boundary drift and unreviewable reference of a traditional method are effectively solved, the generation illusion is remarkably reduced, and the auditing traceability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of information retrieval and natural language processing technology, specifically relating to a method and system for minimum evidence span alignment and precise citation generation for reading comprehension of regulations and clauses, compliance question answering, and retrieval enhancement. Background Technology

[0002] In current information retrieval-enhanced generation and compliance question-answering systems, mainstream methods typically use entire clauses or paragraphs as the smallest unit of retrieval and evidence. After semantic retrieval and reordering, the entire text is concatenated and input into the generation model. While this coarse-grained approach to evidence usage is convenient for engineering implementation, it inevitably introduces a large amount of contextual information irrelevant to the answer. This increases the space for the generation model to make assumptions and fabrications, leading to prominent "fact illusion" problems. Furthermore, the generated answers often cite inaccurately, directly using entire paragraphs or clauses as evidence sources, making precise locating difficult.

[0003] To alleviate evidence redundancy, some existing solutions attempt to extract key sentences based on neural network attention heatmaps or heuristic rules. However, the boundary determination of these methods is easily affected by model noise and document layout structure, resulting in insufficient stability. Especially when evidence spans multiple sentences, tables, or pages, it is difficult to accurately align the smallest text fragments that truly support the answer, often leading to the extracted evidence being either "too wide" (containing redundant information) or "too narrow" (omitting key information).

[0004] On the other hand, most existing generative models output free text or loosely structured citation prompts, lacking a unified, machine-readable citation syntax centered on verifiable anchor points such as "clause number—line number—period—start and end positions." This poses significant challenges to subsequent auditing, fact-checking, and manual comparison.

[0005] Furthermore, existing systems generally lack an adaptive closed-loop mechanism that uses "minimum evidence coverage" as the criterion. When the evidence retrieved initially is insufficient to support a complete answer, the system cannot automatically trigger a re-retrieval or targeted supplementary evidence, making it difficult to balance the completeness of the answer and the accuracy of the evidence within a fixed context length budget.

[0006] Therefore, there is an urgent need in this field for a technical solution that can accurately align the minimum evidence span, generate verifiable citations, and adaptively supplement evidence to overcome the above-mentioned deficiencies. Summary of the Invention

[0007] The purpose of this invention is to overcome the shortcomings of existing technologies, such as coarse evidence granularity, unstable boundaries, unverifiable citations, and lack of adaptive supplementary evidence mechanisms, and to provide a method and system for minimum evidence span alignment and precise citation generation. It aims to achieve stable and interpretable positioning of the minimum evidence span supporting the answer under a fixed context budget, and output auditable and traceable standardized citations, thereby significantly reducing the illusion phenomenon of the generated model and improving the efficiency and reliability of compliance Q&A and audit review.

[0008] To solve the above-mentioned technical problems, the present invention is implemented as follows: This invention provides a method for minimum evidence span alignment and precise citation generation, comprising the following steps: Step 1: Candidate retrieval and index establishment. By combining direct access by number and semantic similarity retrieval, a set of candidate clauses is obtained from the legal text database. A mapping relationship between token and line number and period is established for each candidate clause, and the clause number and location information are persistently saved. Step 2: Span-level evidence alignment. A combination of sequence labeling and interpretable attribution is used to determine candidate evidence fragments. Sequence labeling uses the BIO classifier to predict token labels, and interpretable attribution includes integral gradient and test removal attribution. The token support strength is obtained by fusion, and the boundary is fine-tuned by sliding window and dynamic programming to form a set of candidate evidence fragments. Step 3: Counterfactual boundary learning. Construct counterfactual segments with excessively wide or narrow spans and noise substitutions around the span of positive example evidence, and introduce boundary interval loss and length regularization term to form a comprehensive training objective to suppress evidence boundary drift. Step 4: Minimal evidence set selection. Based on feature coverage and redundancy penalty, construct an objective function and select a subset of evidence that covers the key features of the query and answer and is subject to length budget constraints through submodular optimization. Step 5: Minimum span coverage determination and re-retrieval / supplementary certification. Calculate the minimum span coverage. When the coverage is lower than the threshold, trigger re-retrieval and supplementary certification operations such as synonym expansion, direct access by number, or targeted query until the coverage requirement is met or the budget limit is reached. Step Six: Controlled Citation Generation. For the final selected evidence span, standardized citation tags containing clause numbers, line numbers, periods, and start and end positions are generated according to the predefined citation syntax. Hard constraints are added to the generator to ensure that key assertions are accompanied by citation anchors. Step 7: Quality Scoring and Output. Combine retrieval score, span score, and coverage to calculate confidence. Output a complete response containing controlled citations, or output a conservative suggestion when evidence is insufficient.

[0009] Furthermore, in step two, the sequence labeling specifically includes: Encode the input query and the terms text to obtain a token representation; The BIO classifier is used to predict the label of each token. The label with the highest probability is taken and the consecutive "BI" segments are merged to obtain the initial set of candidate evidence segments.

[0010] Furthermore, in step two, the explainable attribution specifically includes: Calculate the integral gradient attribution score and remove the test attribution score; The token support strength is obtained by weighted fusion, where the fusion weight is an adjustable parameter.

[0011] Furthermore, in step two, the span-level evidence alignment also includes: Define a span scoring function that integrates token support strength, BM25 similarity, and semantic embedding cosine similarity; Within the neighborhood of the BIO annotation results, the boundaries are fine-tuned using sliding windows and dynamic programming to form the final set of candidate evidence fragments.

[0012] Furthermore, in step three, the counterfactual boundary learning specifically includes: Construct overly wide segments, overly narrow segments, and noise-replacement segments; Apply the boundary margin loss function to constrain the score margin between positive example segments and counterfactual segments; By combining the IoU alignment loss and the length regularization term, a comprehensive training objective is formed.

[0013] Furthermore, in step four, the selection of the minimum set of evidence specifically includes: Construct an objective function that aims to maximize feature coverage and uses redundancy and length as penalty terms. The submodal greedy algorithm is used to approximate the solution, selecting a subset of evidence that covers both query and answer elements and satisfies the budget constraint.

[0014] Furthermore, in step five, the formula for calculating the minimum span coverage rate is: MCR = (Number of tokens covered by evidence in the answer) / (Total number of tokens in the answer); When the MCR is lower than the preset threshold, a re-retrieval and supplementary verification operation is triggered.

[0015] Furthermore, in step six, the format of the standardized reference tag is as follows: [§ClauseID|line=LineID|sent=SentID|start=l|end=r|eff=Date|exp=Date]; Where ClauseID is the clause number, LineID is the line number, SentID is the period, l and r are the start and end positions of the span, and eff and exp are optional effective and expiration dates.

[0016] Furthermore, in step seven, the quality scoring specifically includes: It integrates retrieval margin, span score, coverage, and citation integrity metrics; When the references are incomplete or the coverage is insufficient, output a conservative conclusion and explicitly indicate the uncovered elements.

[0017] The present invention also provides a system for implementing the method, comprising: The retrieval module is used to perform candidate searches and index building; The alignment module is used to perform span-level evidence alignment and counterfactual boundary learning; The selection module is used to perform minimum evidence set selection and coverage judgment; The generation module is used to perform controlled reference generation and quality score output; The storage module is used to persist clause numbers, location information, and mapping relationships.

[0018] Compared with the prior art, the advantages of this invention are as follows: (1) More precise and minimal evidence localization: By integrating sequence labeling and interpretable attribution, the transition from "coarse-grained paragraphs" to "fine-grained segments" is achieved, which greatly reduces redundant information input to the generation model and reduces the risk of hallucinations from the source.

[0019] (2) More robust evidence boundaries: The innovative counterfactual boundary learning mechanism makes the model more robust to boundary noise and complex text structures (such as cross-sentence and cross-table) by allowing the model to explicitly compare negative samples that are “too wide / too narrow” during training, thereby improving the accuracy of localization.

[0020] (3) Verifiable and traceable citation format: The mandatory generated standardized RefTag tags provide a precise anchor point for each piece of evidence that is machine-readable and manually verifiable, completely solving the problem of loose and difficult-to-audit traditional free text citation formats.

[0021] (4) Possesses self-healing ability of evidence quality: Through the closed-loop supplementary evidence mechanism driven by the minimum span coverage rate index, the system can actively correct and supplement itself when insufficient evidence is found, which significantly improves the completeness of the answer and the reliability of the system in complex scenarios. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, wherein: Figure 1 A flowchart illustrating the method for minimum evidence span alignment and precise citation generation provided by this invention; Figure 2 A structural block diagram of the system generated for minimum evidence span alignment and precise citation provided by this invention; Figure 3 This is one of the hardware structure diagrams of the electronic device provided in the embodiments of the present invention; Figure 4 This is the second schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present invention. Detailed Implementation

[0023] 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, not all, of the embodiments of the present invention. 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.

[0024] The terms "first," "second," etc., used in this specification are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, without limiting the number of objects; for example, the first object can be one or more. Furthermore, in the specification, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0025] Please see Figure 1 As shown, this embodiment of the invention provides a method for minimum evidence span alignment and precise citation generation, including the following steps: Step S101: Candidate retrieval and index establishment. By combining direct access by number and semantic similarity retrieval, a set of candidate clauses is obtained from the regulatory text database. A mapping relationship between token and line number and period is established for each candidate clause, and the clause number and location information are persistently saved. Step S102: Span-level evidence alignment. Candidate evidence fragments are determined by combining sequence labeling and interpretable attribution. Sequence labeling uses the BIO classifier to predict token labels, and interpretable attribution includes integral gradient and removal of test attribution. The token support strength is obtained by fusion, and the boundary is fine-tuned by sliding window and dynamic programming to form a set of candidate evidence fragments. Step S103: Counterfactual boundary learning. Construct counterfactual segments with excessively wide, narrow, and noise substitutions around the span of positive example evidence, and introduce boundary interval loss and length regularization term to form a comprehensive training objective to suppress evidence boundary drift. Step S104: Minimum evidence set selection. Based on feature coverage and redundancy penalty, construct an objective function and select a subset of evidence that covers the key features of the query and answer and is subject to length budget constraints through submodular optimization. Step S105: Minimum span coverage determination and re-retrieval / supplementary certification. Calculate the minimum span coverage. When the coverage is lower than the threshold, trigger the re-retrieval and supplementary certification operations of synonym expansion, direct access by number, or targeted query until the coverage requirement is met or the budget limit is reached. Step S106: Controlled citation generation. For the final selected evidence span, generate standardized citation tags containing clause number, line number, period, and start and end positions according to the predefined citation syntax, and add hard constraints to the generator to ensure that key assertions are accompanied by citation anchors. Step S107: Quality scoring and output, calculate confidence by fusing retrieval score, span score and coverage, output a complete response containing controlled citations, or output a conservative suggestion when evidence is insufficient.

[0026] In step S101, the direct access retrieval by number specifically includes: The query will directly locate the corresponding clause text if the clause number is explicitly referenced in the query. Semantic similarity recall uses the Sentence-BERT model to convert the query and terms text into vectors, and then uses cosine similarity to recall Top-K candidates.

[0027] The semantic similarity recall part uses the Sentence-BERT semantic encoding model to perform queries. With each clause text ( The set of terms to be retrieved is segmented and embedded into sub-terms, and both are input into an encoder with shared parameters. This yields the fixed-length sentence vector representation. , Sentence vectors can be generated by processing the output of the encoding layer. The position value is obtained by either positional selection or average pooling; then... and L2 normalization was performed, and cosine similarity was used. : ; Calculate the semantic similarity between the query and each clause, based on All clauses are sorted from highest to lowest score, and the top-K clauses are selected as semantic similarity recall results and merged with the clauses hit by "direct access by number".

[0028] In step S102, the sequence labeling specifically includes: Encode the input query and the terms text to obtain a token representation; The BIO classifier is used to predict the label of each token. The label with the highest probability is taken and the consecutive "BI" segments are merged to obtain the initial set of candidate evidence segments.

[0029] The explainable attributions specifically include: Calculate the integral gradient attribution score and remove the test attribution score; for the query With clause code sequence Let the baseline sequence be . Token-level support strength is calculated using a combination of integral gradient and removal testing. Integral gradient attribution. Defined as: ; in, For querying the terms scoring function, For along to A linear interpolation sequence. Remove test attribution. for: ; in, Indicates the first The sequence of tokens set to zero or replaced with placeholders is obtained by weighted merging of the two: ; And the entire sequence Perform linear normalization so that the attribution score falls within the range of [missing information]. The interval is used for subsequent selection of evidence span and training.

[0030] The token support strength is obtained by weighted fusion, where the fusion weight is an adjustable parameter.

[0031] Furthermore, the span-level evidence alignment also includes: Define a span scoring function that integrates token support strength, BM25 similarity, and semantic embedding cosine similarity; In this embodiment, the initial fragment obtained from BIO annotation Let its corresponding original text be denoted as Based on token-level support strength The single-span alignment score is defined as: ; in, Indicates in fragment text With query The relevance score is calculated based on the word segmentation results using the standard BM25 formula. , To utilize the same semantic encoder as the retrieval phase A fixed-length vector obtained by encoding the fragment and the query. Then in Using sliding window and dynamic programming within the neighborhood Fine-tune the left and right boundaries, search for the local maximum score, and summarize them to form a set of candidate evidence fragments. .

[0032] In step S103, the counterfactual boundary learning specifically includes: Construct overly wide segments, overly narrow segments, and noise-replacement segments; Apply the boundary margin loss function to constrain the score margin between positive example segments and counterfactual segments; By combining the IoU alignment loss and the length regularization term, a comprehensive training objective is formed.

[0033] In this embodiment, for each labeled positive example span Expand or shrink several tokens along the left and right boundaries to construct overly wide fragments. Too narrow a segment The text near the boundary is replaced with semantically similar but irrelevant text, resulting in noisy fragments. This is based on a span scoring function. Define boundary margin loss : ; Constraints show that positive examples score significantly higher than counterfactual examples. For position sequences with labeled or pseudo-labeled elements, a soft IoU alignment loss is introduced. : ; in, To predict the coverage probability, For the corresponding tags; and use length regularization. : ; Suppress unnecessary excessively long spans. Finally, combine the above factors with the BIO sequence labeling loss. The overall training objective is obtained by combining the weighted coefficients: .

[0034] In step S104, the selection of the minimum set of evidence specifically includes: Construct an objective function that aims to maximize feature coverage and uses redundancy and length as penalty terms. The submodal greedy algorithm is used to approximate the solution, selecting a subset of evidence that covers both query and answer elements and satisfies the budget constraint.

[0035] For the set of candidate evidence fragments Select a subset from it As the final set of explanations. First, for the query... With the answer Perform structured analysis to obtain the element set. This includes equipment name, voltage level, action predicate, value, and number. Define the objective function to maximize feature coverage, suppress redundancy, and control length under budget constraints: ; in:

[0036] The first measure is the coverage of query / answer elements, and the second measure uses predefined fragment similarity. To suppress content duplication, the third step penalizes excessively long segments based on length and budget. Building upon this, a submodal greedy approximation algorithm is employed, selecting candidate segments sequentially based on decreasing marginal gain. This, combined with a lazy update strategy, yields a subset of evidence that satisfies the budget constraint and provides sufficient coverage. .

[0037] In step S105, the formula for calculating the minimum span coverage rate is: MCR = (Number of tokens covered by evidence in the answer) / (Total number of tokens in the answer); When the MCR is lower than the preset threshold, a re-retrieval and supplementary verification operation is triggered.

[0038] In step S106, the format of the standardized reference tag is as follows: [§ClauseID|line=LineID|sent=SentID|start=l|end=r|eff=Date|exp=Date]; Where ClauseID is the clause number, LineID is the line number, SentID is the period, l and r are the start and end positions of the span, and eff and exp are optional effective and expiration dates.

[0039] In step S107, the quality scoring specifically includes: It integrates retrieval margin, span score, coverage, and citation integrity metrics; When the references are incomplete or the coverage is insufficient, output a conservative conclusion and explicitly indicate the uncovered elements.

[0040] In this embodiment, the system obtains a subset of evidence. Then, by comprehensively considering the retrieval margins, span scores, and citation completeness, the answer is evaluated. The level of support is assessed. First, the minimum span coverage is defined: ; And give the element-level form: ; in, It is a collection of structured elements such as equipment, voltage, predicates, values, and numbers. When When the time comes, a re-retrieval and supplementary evidence mechanism is triggered: on the one hand, synonym expansion and direct access to numbering are used to fill in missing clauses; on the other hand, targeted queries are generated for uncovered elements, and evidence retrieval and span extraction processes are iteratively executed; if the coverage rate still does not reach the threshold within the preset round or budget, a conservative conclusion is output, and the key elements not covered by evidence and possible applicable premises are explicitly indicated in the results.

[0041] Combined Figure 2 As shown, the present invention also provides a system for implementing the method, including a retrieval module 101, an alignment module 102, a selection module 103, a generation module 104, and a storage module 105.

[0042] The retrieval module 101 is used to perform candidate retrieval and index creation.

[0043] The alignment module 102 is used to perform span-level evidence alignment and counterfactual boundary learning.

[0044] The selection module 103 is used to perform minimum evidence set selection and coverage determination.

[0045] The generation module 104 is used to perform controlled citation generation and quality score output.

[0046] The storage module 105 is used to persist the clause number, location information, and mapping relationship.

[0047] The preferred embodiments of the present invention will now be described in detail. The specific details described herein are for ease of understanding and not intended to limit the scope of protection of the invention.

[0048] System Architecture and Process Overview The overall process of the method provided by this invention is as follows: Figure 1 As shown. After receiving a user query, the system sequentially performs candidate retrieval and index building, Span-level evidence alignment, counterfactual boundary learning, minimum evidence set selection, coverage assessment and loop closure supplementary evidence, controlled citation generation, and quality scoring and output. The key steps are explained in detail below.

[0049] Step 1: Candidate Search and Index Building The system receives user queries Then, a search is performed from the regulatory text database. The search process employs a dual-path strategy of "direct access by number" and "semantic recall".

[0050] Direct access by number: Analysis and query The clause number explicitly mentioned in the document (such as "according to Article N of the XX Law") directly leads to the corresponding clause text.

[0051] Semantic recall: Using pre-trained semantic embedding models (such as Sentence-BERT) to retrieve queries The text of the terms in the database is converted into vectors, and the top-K most relevant candidate terms are recalled by calculating vector similarity (such as cosine similarity).

[0052] The results from the two paths are merged, and after deduplication, a set of candidate terms is obtained. .

[0053] Subsequently, for each candidate clause Establish a fine-grained index mapping table Specifically, the terms text is segmented into words and sentences, and recorded for each token: Its row number : ; The sentence number it belongs to : ; Simultaneously, the unique identifier of the clause (clause_id) and its page or table location information in the document are persistently stored. This mapping table is the core basis for subsequently generating precise reference anchors.

[0054] Step 2: Span-level blending and alignment This step aims to identify all possible text segments (spans) from the candidate clauses that could support the answer.

[0055] Sequence labeling (BIO): will query With the terms and conditions spliced ​​as Then, the token is input into a pre-trained language model (such as BERT or RoBERTa) for encoding to obtain the contextual representation of each token. Subsequently, a fully connected layer classifier is used for BIO sequence labeling to predict the label for each token. The probability is calculated as follows: ; in, and For classifier parameters, For category indexing, an initial set of candidate evidence fragments is obtained by taking the label with the highest probability and merging consecutive "BI" sequences. In particular, For the first Each token belongs to the category The predicted probability reflects the confidence level of the sequence labeling model for each category; by taking the label corresponding to the highest probability and merging consecutive "B-I" segments, an initial set of candidate evidence segments can be obtained. .therefore, Not composed of multiple The probability is not directly composed, but rather is a set of continuous text spans extracted from the probability label sequence.

[0056] Explainable attribution: To compensate for potential biases in sequence labeling models, two attribution scores are calculated in parallel: Integral gradient: For query-term combined input, let the query text be denoted as It is represented as a vector sequence by the same encoder (still denoted as ). The term token vector sequence is The baseline sequence is For the first tokens Calculate the integral gradient attribution score Measure its impact on the model's performance on input. Predicted score The contribution is defined as ; in This indicates that the query vector sequence will be used in the sequence dimension. Interpolation sequence with clauses cascade These are the path parameters along the baseline to the actual input. For query-term scoring or answer prediction models.

[0057] Remove test: Calculate each token LoO attribution score This refers to the degree of decrease in the model's predicted score after removing the token. The attribution score is one of these factors. Calculated by the following formula: ; in, The original predicted score; This means removing the token. The predicted scores are then fused to obtain the support strength; Represents removal from the sequence Subsequently, the two attribution scores are weighted and fused to obtain the support strength for each token. : ; in, The fusion weight is adjustable and ranges from [0,1], typically 0.5.

[0058] Boundary fine-tuning and score calculation: In Within the neighborhood of each initial segment, more candidate spans are generated using a sliding window. For any candidate span z= (Starting and ending token indices), calculate its span score. : ; in, , These are weighting coefficients; The span is the BM25 similarity to the query; Cosine similarity is used for semantic embedding. Finally, a dynamic programming algorithm is used to select the non-overlapping or minimally overlapping segments with the highest scores, forming a refined set of candidate evidence. .

[0059] Step 3: Counterfactual boundary learning (model training phase) This step is a crucial part of model training and is used to improve the robustness of boundary localization.

[0060] For each span of real evidence in the training set Construct three types of counterfactual samples: Overly wide segments: It intentionally includes potentially irrelevant text outside the boundaries.

[0061] Too narrow a segment: Key text within the boundaries was deliberately omitted.

[0062] in, and These represent the left and right boundary positions of the positive example span, respectively, which usually correspond to the start and end indices of the evidence fragments on which the answer is based in the original text; , The non-negative integer used to expand the boundary outward indicates that several additional tokens are introduced on the left or right side to construct an "overly wide segment," thereby artificially adding potentially irrelevant content outside the boundary. , The non-negative integers used to shrink the boundaries inward are used to construct "overly narrow segments" by shaving tokens near the left and right boundaries, simulating the omission of key information. Using the different offsets mentioned above, counterfactual segments containing irrelevant text or missing important text can be systematically generated to train the model to distinguish between real evidence and perturbative segments.

[0063] Noise replacement segment: In The text near the boundary is randomly replaced with similar but unrelated text.

[0064] During training, in addition to the standard sequence labeling loss... And IoU alignment loss with the true span In addition, boundary spacing loss is introduced. : ; This loss function requires the true span. The score is at least higher than that of the overly wide segment. The score is higher than that of a narrow segment. At the same time, add a length regularization term. To encourage moderate span lengths, among which, The regularization coefficient is... For span length, This represents the total number of tokens for the text. Among them, This is a segment span scoring function used to measure the effectiveness of a given text segment in supporting query semantics and answer elements. The score integrates multiple information such as the support strength of tokens within the segment, the term relevance between the segment and the query, and semantic similarity, to reflect the credibility of the segment as evidence. This is achieved by comparing... , and This allows the model to learn that genuine evidence should have higher overall support strength, while counterfactual fragments containing noise or missing key information should receive lower scores. The total training loss of the model is: ; in, , , These are weighting coefficients. This process suppresses the phenomenon of evidence spanning too wide or too narrow. Step 4: Selection of the minimum evidence set To address situations where an answer may be supported by multiple pieces of evidence, this step involves refining the candidate set. Select an optimal subset from The problem is modeled as optimizing the following objective function. : ; in, , These are the sets of elements for the query and the answer, respectively. For element weights; For indicator functions, if elements Appearing in the span The inner value is 1; Similarity between two spans; , To adjust the parameters; This is the budget ceiling. Among them, This represents a segment of candidate evidence (also known as a "span"), corresponding to a continuous range of tokens in the text, typically indexed by its left and right boundaries. A unique identifier reflects the location and content of a fragment within the original text. After the aforementioned retrieval, span extraction, and boundary fine-tuning steps, the system will obtain multiple such candidate fragments, forming a candidate set. .

[0065] gather This indicates that the subset of evidence selected from the candidate fragments is ultimately used to support the query. With the answer The set of explainable evidence. The objective function of this invention. That is, used to evaluate a subset of a segment. Overall quality: It requires both coverage of key elements in the query and answer, and avoidance of redundancy between fragments, while also meeting budget constraints. The amount of evidence is kept moderate under constraints such as total length or number of tokens. Finally, the optimal subset of evidence is approximated using a submodal greedy algorithm. .

[0066] By using optimization methods such as the submodular greedy algorithm, an approximate optimal solution to this NP-hard problem can be obtained efficiently. .

[0067] Step 5: Minimum span coverage and closed-loop supplementary certification Calculate the current subset of evidence Check the answers Minimum span coverage: MCR = (Number of tokens covered by evidence in the answer) / (Total number of tokens in the answer); in, This reflects the sufficiency of the evidence in supporting the answer. A threshold is set. ,like If the evidence is insufficient, the system will automatically trigger a re-search and supplementary evidence process. Synonym expansion: using the answer New query terms are generated from key elements that are not covered in the query.

[0068] Direct access by number: If the answer hints at other terms, try to locate them directly.

[0069] Targeted Query: Constructing precise queries for uncovered features. Subsequently, the system iteratively executes steps one through four, incorporating newly retrieved evidence into the candidate set and reselecting, until... Or it may reach the preset limit for the number of iterations (budget).

[0070] Step Six: Controlled Reference Generation For each of the ultimately selected evidence spans Based on the mapping table established in step one Generate its precise reference anchor. : ; The system predefines a structured reference tag template, in which, The final selected evidence span indicates the starting position of the segment in the original clause text. and end position Both are token-level indexes. Based on the mapping table constructed in step one. This allows mapping the token location back to the structured hierarchy of the terms: This indicates that a certain range of tokens (e.g.) will be used. The corresponding row number is usually the smallest or main row number covered by that range; This indicates that the token range is mapped to the corresponding sentence number. Parameter This serves as the unique identifier for the clause. This allows for the formation of structured reference anchors, such as: [§ClauseID | line=LineID | sent=SentID | start=l | end=r | eff=Date | exp=Date].

[0071] During the text generation stage (e.g., when using a large language model), constraint decoding or template filling techniques force the model to immediately insert the corresponding citation tag after outputting each key fact assertion. If an assertion cannot be linked to any evidence, the generator triggers a citation rejection fallback mechanism, outputting a conservative statement such as "According to general rules, but specific terms are subject to verification."

[0072] Step Seven: Quality Scoring and Output The system comprehensively utilizes retrieval score, span score, and coverage rate to calculate confidence level, applies a weighted score to the answer, and outputs a complete response including controlled citations. When evidence is insufficient, the system will explicitly indicate missing information, ensuring the interpretability and auditability of the output.

[0073] like Figure 3 As shown, this embodiment of the invention also provides an electronic device 600, which includes a processor 601, a memory 602, and a program or instructions stored in the memory 602 and executable on the processor 601. When the program or instructions are executed by the processor 601, they implement the various processes of the above-described method embodiment for minimum evidence span alignment and precise reference generation, and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0074] It should be noted that the first electronic device in the embodiments of the present invention includes the mobile electronic device and the non-mobile electronic device described above.

[0075] Figure 4 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present invention.

[0076] The electronic device 700 includes, but is not limited to, components such as: radio frequency unit 701, network module 702, audio output unit 703, input unit 704, sensor 705, display unit 706, user input unit 707, interface unit 708, memory 709, and processor 710.

[0077] Those skilled in the art will understand that the electronic device 700 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 710 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0078] It should be understood that, in this embodiment of the invention, the input unit 704 may include a graphics processing unit (GPU) 7041 and a microphone 7042. The GPU 7041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 706 may include a display panel 7061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 707 includes a touch panel 7071 and other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here. The memory 709 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 710 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understandable that the aforementioned modem processor may not be integrated into the processor 710.

[0079] This invention also provides a readable storage medium storing a program or instructions that, when executed by a processor, implement the various processes of the above-described method embodiments for minimum evidence span alignment and precise reference generation, and achieve the same technical effect. To avoid repetition, these will not be described again here.

[0080] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0081] This invention also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described method embodiments for minimum evidence span alignment and precise reference generation, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0082] It should be understood that the chip mentioned in the embodiments of the present invention may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0083] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0084] Furthermore, it should be noted that the scope of the methods and systems in the embodiments of the present invention is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.

[0085] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the scope of protection of the present invention, and all of these forms are within the protection scope of the present invention.

Claims

1. A method for minimum evidence span alignment and precise citation generation, characterized in that, Includes the following steps: Step 1: Candidate retrieval and index establishment. By combining direct access by number and semantic similarity retrieval, a set of candidate clauses is obtained from the legal text database. A mapping relationship between token and line number and period is established for each candidate clause, and the clause number and location information are persistently saved. Step 2: Span-level evidence alignment. A combination of sequence labeling and interpretable attribution is used to determine candidate evidence fragments. Sequence labeling uses the BIO classifier to predict token labels, and interpretable attribution includes integral gradient and test removal attribution. The token support strength is obtained by fusion, and the boundary is fine-tuned by sliding window and dynamic programming to form a set of candidate evidence fragments. Step 3: Counterfactual boundary learning. Construct counterfactual segments with excessively wide or narrow spans and noise substitutions around the span of positive example evidence, and introduce boundary interval loss and length regularization term to form a comprehensive training objective to suppress evidence boundary drift. Step 4: Minimal evidence set selection. Based on feature coverage and redundancy penalty, construct an objective function and select a subset of evidence that covers the key features of the query and answer and is subject to length budget constraints through submodular optimization. Step 5: Minimum span coverage determination and re-retrieval / supplementary certification. Calculate the minimum span coverage. When the coverage is lower than the threshold, trigger re-retrieval and supplementary certification operations such as synonym expansion, direct access by number, or targeted query until the coverage requirement is met or the budget limit is reached. Step Six: Controlled Citation Generation. For the final selected evidence span, standardized citation tags containing clause numbers, line numbers, periods, and start and end positions are generated according to the predefined citation syntax. Hard constraints are added to the generator to ensure that key assertions are accompanied by citation anchors. Step 7: Quality Scoring and Output. Combine retrieval score, span score, and coverage to calculate confidence. Output a complete response containing controlled citations, or output a conservative suggestion when evidence is insufficient.

2. The method according to claim 1, characterized in that, In step two, the sequence labeling specifically includes: Encode the input query and the terms text to obtain a token representation; The BIO classifier is used to predict the label of each token. The label with the highest probability is taken and the consecutive "BI" segments are merged to obtain the initial set of candidate evidence segments.

3. The method according to claim 1, characterized in that, In step two, the explainable attribution specifically includes: Calculate the integral gradient attribution score and remove the test attribution score; The token support strength is obtained by weighted fusion, where the fusion weight is an adjustable parameter.

4. The method according to claim 1, characterized in that, In step two, the span-level evidence alignment also includes: Define a span scoring function that integrates token support strength, BM25 similarity, and semantic embedding cosine similarity; Within the neighborhood of the BIO annotation results, the boundaries are fine-tuned using sliding windows and dynamic programming to form the final set of candidate evidence fragments.

5. The method according to claim 1, characterized in that, Step three, specifically, includes the learning of counterfactual boundaries: Construct overly wide segments, overly narrow segments, and noise-replacement segments; Apply the boundary margin loss function to constrain the score margin between positive example segments and counterfactual segments; By combining the IoU alignment loss and the length regularization term, a comprehensive training objective is formed.

6. The method according to claim 1, characterized in that, Step four, the selection of the minimum set of evidence, specifically includes: Construct an objective function that aims to maximize feature coverage and uses redundancy and length as penalty terms. The submodal greedy algorithm is used to approximate the solution, selecting a subset of evidence that covers both query and answer elements and satisfies the budget constraint.

7. The method according to claim 1, characterized in that, In step five, the formula for calculating the minimum span coverage rate is: MCR = (Number of tokens covered by evidence in the answer) / (Total number of tokens in the answer); When the MCR is lower than the preset threshold, a re-retrieval and supplementary verification operation is triggered.

8. The method according to claim 1, characterized in that, In step six, the format of the standardized reference tag is as follows: [§ClauseID|line=LineID|sent=SentID|start=l|end=r|eff=Date|exp=Date]; Where ClauseID is the clause number, LineID is the line number, SentID is the period, l and r are the start and end positions of the span, and eff and exp are optional effective and expiration dates.

9. The method according to claim 1, characterized in that, In step seven, the quality scoring specifically includes: It integrates retrieval margin, span score, coverage, and citation integrity metrics; When the references are incomplete or the coverage is insufficient, output a conservative conclusion and explicitly indicate the uncovered elements.

10. A system for implementing the minimum evidence span alignment and precise citation generation of the method according to any one of claims 1-9, characterized in that, include: The retrieval module is used to perform candidate searches and index building; The alignment module is used to perform span-level evidence alignment and counterfactual boundary learning; The selection module is used to perform minimum evidence set selection and coverage judgment; The generation module is used to perform controlled reference generation and quality score output; The storage module is used to persist clause numbers, location information, and mapping relationships.