Legal evidence black box element extraction method and system
By normalizing multi-format evidence into a unified format and combining it with a multimodal model to extract key fields, the problem of low efficiency and insufficient accuracy in extracting evidence document elements in existing technologies is solved, realizing an end-to-end automated pipeline that is suitable for batch litigation business.
Patent Information
- Application Number
- CN202510934538.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-08
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-07-08
AI Technical Summary
In the litigation process, existing technologies are inefficient and inaccurate in extracting elements from evidence documents. In particular, when dealing with diverse and non-standardized evidence documents, automated tools cannot adapt and require human intervention, forming a semi-automation bottleneck.
We employ a black-box element extraction method for legal evidence. By normalizing multi-format evidence into a list of images/text, we combine visual and text models to analyze key fields, and use a re-ranking model to associate elements with evidence slices. We iteratively eliminate low-confidence results to ensure high-confidence extraction.
It achieves adaptive processing of multi-format evidence, significantly improving extraction accuracy and efficiency, increasing processing speed by 50 times, reducing error rate by more than 80%, and meeting the traceability requirements of legal procedures.
Smart Images

Figure CN120688482B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of evidence processing technology, and in particular to a method for extracting elements from a black box of legal evidence. Background Technology
[0002] In the litigation process, extracting essential elements of evidence (such as party information, time, amount, key facts, etc.) is a core step in case handling, but currently it mainly relies on manual operation, which presents the following pain points:
[0003] Inefficiency: Batch-type personal business (such as financial loan disputes, labor disputes, etc.) requires processing a large number of evidences in different formats (contracts, bills, transaction records, etc.), and manual extraction of each item is time-consuming and labor-intensive.
[0004] High accuracy requirements: Legal scenarios have extremely low tolerance for errors in element extraction. Even minor errors can lead to the failure of litigation strategies or procedural delays, with high subsequent repair costs.
[0005] Limitations of existing technology:
[0006] General OCR / NLP technology can only achieve text recognition or simple field extraction, but cannot understand legal semantics, requiring secondary manual verification, and has limited efficiency improvement.
[0007] Fixed pipeline systems rely on preset templates or structured input (such as tables in specific formats), making it difficult to adapt to diverse and non-standardized evidence documents (such as handwritten notes, scanned copies, and mixed-format documents).
[0008] Therefore, existing solutions cannot simultaneously address both adaptive processing of black-box evidence and high-precision feature verification: manual processing is flexible but inefficient; automated tools are limited by format or semantic understanding capabilities and require manual intervention, forming a "semi-automation" bottleneck. Summary of the Invention
[0009] The present invention aims to solve at least one of the technical problems existing in the prior art, and proposes a method and system for extracting elements of legal evidence from a black box.
[0010] In a first aspect, the present invention provides a method for extracting elements from a black box of legal evidence, the method comprising:
[0011] Obtain a legal evidence black box and a list of elements; wherein, the legal evidence black box includes multi-format files, and the list of elements is a list of element names corresponding to the type of litigation;
[0012] The aforementioned legal evidence black box is normalized into a list of images and a list of text.
[0013] Generate element relationship groups based on the element list; where each group contains logically related elements;
[0014] The element relationship group is converted into a reordered prompt word list, and the confidence level of each evidence unit with the element relationship group is output, while the highest confidence level result is retained;
[0015] The element relationship groups are respectively converted into a list of visual cue words for a visual language model or a list of language cue words for a text language model;
[0016] Based on the visual cue word list and the language cue word list and the corresponding evidence units, the extracted elements corresponding to the final element relationship combination are obtained;
[0017] Iterate through each element in the element list, collect the extraction results for that element from all relation groups, and construct a candidate result set;
[0018] Based on the confidence reordering algorithm, the candidate result set with the lowest confidence is iteratively eliminated from the candidate result set until each element retains only a unique high-confidence result, thus obtaining the target element set;
[0019] Output the target element set and the corresponding original evidence slices.
[0020] In some possible embodiments, the legal evidence black box includes image files, PDF files, video files, and audio files, and the normalization of the legal evidence black box into an image list and a text list includes:
[0021] The audio file is converted into text using the Whisper model;
[0022] The video file is de-framed using FFmpeg, and an image list is extracted.
[0023] The PDF file was converted into an image using the Fitz library.
[0024] In some possible embodiments, converting the element relationship group into a reordering cue word list, outputting the confidence score of each evidence unit with respect to the element relationship group, and retaining the highest confidence score result includes:
[0025] The reordering suggestion list is obtained by applying the following relation to the element relationship group:
[0026] f(related_key) = pmpt_rerank
[0027] Where f(related_key) is the system's entry function, which processes the user-input sequence related_key = [k1,k2,...,kn], where k1,k2,...,kn are the keys input by the user through natural language interaction, each key corresponds to an evidence cutting window, and pmpt_rerank is the input prompt word for the reranking model, used to locate relevant pages;
[0028] The reordering prompt word list is reordered to obtain the confidence level of each evidence unit and the element relationship group, and the highest confidence level result is retained.
[0029] In some possible embodiments, the step of converting the element relationship group into a list of visual cue words for a visual language model or a list of language cue words for a text language model includes:
[0030] The element relationship group is converted into a list of visual cue words for the visual language model using the following relation: f(clues) = pmpt_vlm, where f(clues) is a branch processing function that selects the visual model or language model path based on the cue words, and pmpt_vlm is the cue word template for the visual language model.
[0031] The feature relationship group is converted into a list of language cue words for a text language model using the following relation: f(clues) = pmpt_llm_json, where pmpt_llm_json is a list of language cue words for converting unstructured text into JSON.
[0032] In some possible embodiments, the method further includes verification and archiving steps:
[0033] Input the black box key value list of evidence corresponding to each defendant whose element extraction has been completed into the embed model to generate the embedding vector matrix A;
[0034] In this matrix, the first column is used for batch verification, which verifies the matching of the number m of black boxes by calculating the integer value of the determinant of the n x m matrix; the second column of matrix A is used for cluster archiving, which obtains the automatic classification result of the current batch of black boxes by SVD orthogonal decomposition and k-means clustering algorithm after dimensionality reorganization.
[0035] Secondly, embodiments of the present invention provide a legal evidence black-box element extraction system, the system comprising:
[0036] The acquisition module is used to acquire a legal evidence black box and an element list; wherein, the legal evidence black box includes multi-format files, and the element list is a list of element names corresponding to the litigation type;
[0037] The normalization module is used to normalize the legal evidence black box into a list of images and a list of text.
[0038] The generation module is used to generate element relationship groups based on the element list; wherein each group contains logically related elements;
[0039] The conversion module is used to convert the feature relationship group into a reordering prompt word list, output the confidence level of each evidence unit with the feature relationship group and retain the highest confidence level result;
[0040] The conversion module is also used to convert the element relationship group into a visual cue word list of a visual language model or a language cue word list of a text language model, respectively.
[0041] The generation module is also used to obtain the extracted elements corresponding to the final element relationship combination based on the visual cue word list and the language cue word list and the corresponding evidence unit;
[0042] The traversal module is used to traverse each element in the element list, collect the extraction results of the element in all relation groups, and construct a candidate result set;
[0043] The iterative module is used to iteratively eliminate the candidate result set with the lowest confidence based on the confidence re-ranking algorithm, until each element retains only a unique high-confidence result, thus obtaining the target element set;
[0044] The output module is used to output the target element set and the corresponding original evidence slices.
[0045] In some possible embodiments, the legal evidence black box includes image files, PDF files, video files, and audio files, and the normalization module is further used for:
[0046] The audio file is converted into text using the Whisper model;
[0047] The video file is de-framed using FFmpeg, and an image list is extracted.
[0048] The PDF file was converted into an image using the Fitz library.
[0049] In some possible embodiments, the conversion module is further configured to:
[0050] The re-ranking prompt word list is obtained by applying the following formula to the element relationship group: f(related_key) = pmpt_rerank, where f(related_key) is the system's entry function, which processes the user-input sequence of related keys related_key = [k1,k2,...,kn], where k1,k2,...,kn are keys input by the user through natural language interaction, each key corresponds to an evidence cutting window, and pmpt_rerank is the input prompt word of the re-ranking model, used to locate relevant pages; the re-ranking prompt word list is then re-ranked to obtain the confidence level of each evidence unit with respect to the element relationship group, and the highest confidence level result is retained.
[0051] In some possible embodiments, the conversion module is further configured to:
[0052] The feature relationship group is converted into a list of visual cue words for a visual language model using the following relation: f(clues) = pmpt_vlm, where f(clues) is a branching function that selects either a visual model or a language model path based on the cue words, and pmpt_vlm is a cue word template for the visual language model; and the feature relationship group is converted into a list of language cue words for a text language model using the following relation: f(clues) = pmpt_llm_json, where pmpt_llm_json is a language model cue word that converts unstructured text into JSON.
[0053] In some possible embodiments, a verification and archiving module is also included, for:
[0054] Input the black box key value list of evidence corresponding to each defendant whose element extraction has been completed into the embed model to generate the embedding vector matrix A;
[0055] In this matrix, the first column is used for batch verification, which verifies the matching of the number m of black boxes by calculating the integer value of the determinant of the n x m matrix; the second column of matrix A is used for cluster archiving, which obtains the automatic classification result of the current batch of black boxes by SVD orthogonal decomposition and k-means clustering algorithm after dimensionality reorganization.
[0056] Thirdly, the present invention provides an electronic device, characterized in that it comprises:
[0057] One or more processors;
[0058] A storage unit for storing one or more programs that, when executed by one or more processors, enable the one or more processors to implement the method described above.
[0059] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, enables the implementation of the method described above.
[0060] The beneficial effects of the legal evidence black-box element extraction method and system of this invention are as follows:
[0061] 1. Overcome format limitations and achieve black-box adaptive processing.
[0062] By normalizing multi-format evidence (images, PDFs, videos, audio) into a unified format (image / text list), the strong dependence of traditional OCR / NLP technology on input format is resolved.
[0063] It can handle complex unstructured evidence in real-world situations (such as handwritten contracts and blurry scans) and is suitable for various litigation scenarios (such as financial lending and labor disputes).
[0064] 2. Multimodal collaborative extraction improves semantic understanding accuracy.
[0065] By combining the visual model (Qwen-VL) and the text model (Qwen-LLM), key fields in images and structured information in text are analyzed respectively, and elements and evidence slices are associated through the reranking model (Jina-Reranker).
[0066] It avoids the limitations of single-modality models (such as the inability of plain text models to identify the authenticity of signatures) and significantly improves the accuracy of feature extraction.
[0067] 3. Dynamic confidence verification ensures the reliability of results.
[0068] Iteratively eliminates low-confidence results, ensuring that each element ultimately retains only a unique and logically consistent high-confidence value. This reduces the cost of manual review (e.g., 90% of elements in batch cases can be automatically verified and approved), and the error rate is reduced by more than 80% compared to manual extraction.
[0069] 4. End-to-end automation significantly improves efficiency.
[0070] The entire process, from evidence input to element output, is automated, supporting parallel processing of batch cases (such as processing 100+ loan contracts simultaneously). Processing speed is 50 times faster than manual extraction, making it suitable for high-throughput scenarios such as courts and law firms.
[0071] 5. Legal compliance guarantee
[0072] The output includes a slice of the original evidence (such as a screenshot of the contract signature area), meeting the requirements for evidence tracing in legal proceedings. This avoids breaks in the chain of evidence due to technical processing and complies with regulations such as the "Regulations on Electronic Evidence".
[0073] In summary, this invention, through its two core technologies—multimodal fusion extraction and dynamic confidence verification—solves the industry challenge of achieving both efficiency and accuracy in legal evidence processing, making it particularly suitable for batch litigation. Its technical benefits include: end-to-end automated pipeline, increasing processing speed by 50 times; reducing the error rate to below 1%, significantly lowering legal risks; and reducing manual review workload by more than 80%. Attached Figure Description
[0074] Figure 1 This is a schematic diagram of the structure of an example electronic device for a method of extracting elements from a black box of legal evidence according to an embodiment of the present invention;
[0075] Figure 2 This is a flowchart of a method for extracting elements of legal evidence from a black box, according to another embodiment of the present invention.
[0076] Figure 3 This is a schematic diagram of the structure of a legal evidence black-box element extraction system according to another embodiment of the present invention. Detailed Implementation
[0077] The technical solution of the present invention will now be clearly and completely described 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.
[0078] Figure 1 This is a schematic diagram of an example electronic device used to implement a method for extracting black-box elements of legal evidence, according to an embodiment of the present invention. Figure 1 As shown, the electronic device 100 includes one or more processors 110, one or more storage devices 120, one or more input devices 130, one or more output devices 140, etc., and these components are interconnected via a bus system 150 and / or other forms of connection mechanisms. It should be noted that... Figure 1 The components and structures of the electronic devices shown are merely exemplary and not limiting; other components and structures may be used as needed.
[0079] The processor 110 may be a central processing unit (CPU), or may be a processing unit consisting of multiple processing cores, or other forms of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 100 to perform desired functions.
[0080] Storage device 120 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, which a processor may execute to implement the client functions (implemented by the processor) in the embodiments of this disclosure described below, and / or other desired functions. Various applications and various data may also be stored in the computer-readable storage medium, such as various data used and / or generated by the applications.
[0081] The input device 130 may be a device used by a user to input commands, and may include one or more of a keyboard, mouse, microphone, and touch screen.
[0082] The output device 140 can output various information (such as images or sounds) to the outside (e.g., a user) and may include one or more of a display, a speaker, etc.
[0083] Figure 2 This is a flowchart illustrating a method for extracting black-box elements of legal evidence according to another embodiment of the present invention. Figure 2 As shown, a method for extracting elements from a black box of legal evidence includes the following steps S201 to S209:
[0084] Step S201: Obtain the legal evidence black box and the element list; wherein, the legal evidence black box includes multi-format files, and the element list is a list of element names corresponding to the litigation type.
[0085] Step S202: Normalize the legal evidence black box into an image list and a text list.
[0086] Specifically, in this step, the legal evidence black box includes image files, PDF files, video files, and audio files. Normalizing the legal evidence black box into an image list and a text list includes: converting the audio file into text using the Whisper model; deduplicating frames from the video file and extracting the image list using FFmpeg; and converting the PDF file into images using the Fitz library.
[0087] In some embodiments, the legal evidence black box is normalized by a preprocessing module into a list of images (encoded in base64) v_img = [url1,...,url_n] and a list of text v_text = [str1,...,str_n].
[0088] Step S203: Generate element relationship groups based on the element list; wherein each group contains logically related elements.
[0089] Specifically, in this step, the evidence elements can be expressed as keys = [clue1,clue2,...,clue_n], and the combination of element relationships can be expressed as related_keys = [(clue1,clue3,clue6),(clue1,clue3),(clue2,clue7)].
[0090] Step S204: Convert the element relationship group into a reordering prompt word list, output the confidence level of each evidence unit with the element relationship group, and retain the highest confidence level result.
[0091] Specifically, in this step, converting the element relationship group into a re-ranking prompt word list, outputting the confidence level of each evidence unit with the element relationship group, and retaining the highest confidence level result includes: obtaining the re-ranking prompt word list from the element relationship group using the following formula: f(related_key) = pmpt_rerank, where f(related_key) is the system's entry function, processing the user-input sequence of related keys related_key = [k1,k2,...,kn], where k1,k2,...,kn are keys input by the user through natural language interaction, each key corresponds to an evidence segmentation window, and pmpt_rerank is the input prompt word of the re-ranking model, used to locate relevant pages; re-ranking the re-ranking prompt word list to obtain the confidence level of each evidence unit with the element relationship group and retaining the highest confidence level result.
[0092] Specifically, the `related_key` is entered by the end user through the interactive interface using natural language. Each key is entered one at a time, and the next key is entered after submission, resulting in `related_key` = [k1, k2, ..., kn]. The internal order of `related_key` or the expression of words with the same meaning will affect the final result to some extent. `related_key` is the only interaction between the end user and the system; all other steps are completed iteratively by the system. The end user can easily adjust the content of `related_key` based on the result.
[0093] The related_key is directly related to the cutting window of the black-box evidence. For example, if the default cutting window of an image is an A4 size, then a related_key is the set of identifiers and clues on this image, and the next page contains another related_key.
[0094] A clue refers to a term whose content will be extracted. For example, if a clue is 'date', the result will be 'December 31, 2025'.
[0095] Identifiers are non-key characters on the same page, such as characters in obvious titles or stamps on the page. They do not need to be identified, but can help the reordering model locate characters on the page.
[0096] pmpt_rerank = f"{'f{identifiers}':str(clues)}", a string generated by the interpolation function.
[0097] The results returned after pmpt_rerank submits the reranker model include page index and probability.
[0098] The list of indices and probabilities returned by the model is shown in Table 1 below:
[0099] Table 1
[0100]
[0101] In some embodiments, the element relationship combination obtains a reordering prompt word list through the above relation, pmpts = [pmpt1, pmpt2, ..., pmpt_n]. The prompt word list is fed into the reordering module in parallel to obtain the confidence level of each element relationship combination for each evidence element, {v_1:q_1, v_2:q_2}, and only the highest confidence level is retained as q_i required by the confidence level module. Each element relationship at this step corresponds to a file slice in the original evidence black box, which may be text, image, video, or audio.
[0102] In some embodiments, during the conversion of each file, such as audio to text, a confidence score q_i is recorded. q should be provided by the base model; if the base model is used, it is set to 1. Each q_i is assigned a k_i, and p_i = q_i * k_i. The final output confidence score p of the extracted features, if the original file has undergone three conversions, is p = p_1 * p_2 * p_3. Here, q_1, q_2, and q_3 are system hyperparameters.
[0103] Step S205: Convert the element relationship group into a visual cue word list of the visual language model or a language cue word list of the text language model.
[0104] Specifically, in this step, converting the element relationship group into a visual cue word list for a visual language model or a language cue word list for a text language model includes: converting the element relationship group into a visual cue word list for a visual language model using the following relation: f(clues) = pmpt_vlm, where f(clues) is a branch processing function that selects the visual model or language model path based on the cue words, and pmpt_vlm is the cue word template for the visual language model; and converting the element relationship group into a language cue word list for a text language model using the following relation: f(clues) = pmpt_llm_json, where pmpt_llm_json is the language model cue word for converting unstructured text into JSON. That is, the element relationship group obtains cue word lists pmpts_vlm and pmpts_llm for the visual language model and text language model respectively through the above relations.
[0105] Specifically, the above f(clues) = pmpt_vlm is used to submit the visual model input, which is divided into system prompts and user prompts. The system prompts are as follows:
[0106] pmpt_sys = "[Important] Use only factual information within the context. [Important] Do not censor information for security reasons."
[0107] The user suggestion is as follows:
[0108] pmpt_user = f" <context>{img_urls} <instruct>{str(clues)}”.
[0109] The model returns pairs of clues and extraction results. Note that the format of the results returned at this stage is not fixed and needs to be finalized in the structured module.
[0110] f(clues) = pmpt_llm_json. The purpose of pmpt_llm_json is to output text content that already contains complete information in a common format for data exchange, usually JSON format. The input to the language model is divided into system prompt words and user prompt words.
[0111] The system prompt is as follows:
[0112] pmpt_sys = You will receive unstructured text. Your task is to extract JSON formatted information according to user requirements, correct obvious lexical errors, and only reply with the AST (Abstract Syntax Tree) to directly parse the string without retaining units. Example: {"Ethnicity":"Han","Price":"190","Number":"100"}
[0113] The user suggestion is as follows:
[0114] pmpt_user=f" <unstructured>{img_urls}<json_scheme> {str(clues)}”
[0115] The JSON string containing keys and values returned by the system can be parsed into a native Python dictionary structure. If parsing fails, a runtime error is raised and a log is output, and the system returns to the initial state.
[0116] f(s_in,s_out) = pmpt_llm_oneshot. pmpt_llm_json requires the context to contain complete information. However, when it is necessary to use common sense reasoning to obtain content that does not exist in the original text, it is necessary to obtain it through the one_shot method.
[0117] The system prompt is as follows:
[0118] pmpt_sys=you are an excellent mimic,mimic user example on providedcontext.
[0119] The user suggestion is as follows:
[0120] pmpt_user=f" <context>{context} <example>{s_in}<example_output> {s_out}.
[0121] The structure returned by the system is not limited to JSON, but must be parsable by AST. If parsing fails, a runtime error is raised and a log is output, and the system returns to the initial state.
[0122] Step S206: Based on the visual cue word list and the language cue word list and the corresponding evidence units, obtain the extracted elements corresponding to the final element relationship combination.
[0123] Step S207: Traverse each element in the element list, collect the extraction results of the element from all relation groups, and construct a candidate result set.
[0124] Specifically, in this step, the initially unrelated evidence element table is traversed, and a relation group and extraction result dictionary for each element are constructed. The loop is started with the condition that the extraction result for each element is not empty. Taking name as an example: {relation group 1:[(Zhang San:0.87667), relation group 3:(Zhang Si:0.41231), relation group 4:(Zhang San:0.37667)} etc.
[0125] Step S208: Based on the confidence reordering algorithm, iteratively remove the candidate result set with the lowest confidence from the candidate result set until each element retains only a unique high confidence result, thus obtaining the target element set.
[0126] Specifically, in this step, a confidence re-ranking algorithm is used to re-rank the results of individual feature extraction: first, the results are re-ranked by confidence level; then, the results of the first extracted element (i.e., the highest confidence) are checked in rounds. If the results are inconsistent, they are placed at the end of the ranking. After the ranking is completed, the last group is the relation group with the lowest confidence, and all extraction results of this relation group are removed. If the extraction result of a certain feature is empty after extraction, then this relation group cannot be removed. Finally, the target feature set is obtained.
[0127] Step S209: Output the target element set and the corresponding original evidence slices.
[0128] The legal evidence black-box element extraction method of this invention, through multimodal fusion and dynamic verification mechanism, achieves efficient and accurate extraction of legal evidence elements, and has the following significant advantages:
[0129] 1. Overcome format limitations and achieve black-box adaptive processing.
[0130] By normalizing multi-format evidence (images, PDFs, videos, audio) into a unified format (image / text list), the strong dependence of traditional OCR / NLP technology on input format is resolved.
[0131] It can handle complex unstructured evidence in real-world situations (such as handwritten contracts and blurry scans) and is suitable for various litigation scenarios (such as financial lending and labor disputes).
[0132] 2. Multimodal collaborative extraction improves semantic understanding accuracy.
[0133] By combining the visual model (Qwen-VL) and the text model (Qwen-LLM), key fields in images and structured information in text are analyzed respectively, and elements and evidence slices are associated through the reranking model (Jina-Reranker).
[0134] It avoids the limitations of single-modality models (such as the inability of plain text models to identify the authenticity of signatures) and significantly improves the accuracy of feature extraction.
[0135] 3. Dynamic confidence verification ensures the reliability of results.
[0136] Iteratively eliminates low-confidence results, ensuring that each element ultimately retains only a unique and logically consistent high-confidence value. This reduces the cost of manual review (e.g., 90% of elements in batch cases can be automatically verified and approved), and the error rate is reduced by more than 80% compared to manual extraction.
[0137] 4. End-to-end automation significantly improves efficiency.
[0138] The entire process, from evidence input to element output, is automated, supporting parallel processing of batch cases (such as processing 100+ loan contracts simultaneously). Processing speed is 50 times faster than manual extraction, making it suitable for high-throughput scenarios such as courts and law firms.
[0139] 5. Legal compliance guarantee
[0140] The output includes a slice of the original evidence (such as a screenshot of the contract signature area), meeting the requirements for evidence tracing in legal proceedings. This avoids breaks in the chain of evidence due to technical processing and complies with regulations such as the "Regulations on Electronic Evidence".
[0141] In summary, this invention, through its two core technologies of multimodal fusion extraction and dynamic confidence verification, solves the industry challenge of achieving both efficiency and accuracy in legal evidence processing, making it particularly suitable for batch litigation. Its technical effects are manifested in: end-to-end automated pipelines, increasing processing speed by 50 times; reducing the error rate to below 1%, significantly lowering legal risks; and reducing manual review workload by more than 80%.
[0142] In some embodiments, the method further includes verification and archiving steps:
[0143] The key-value list of evidence black boxes corresponding to each defendant whose element extraction has been completed is input into the embed model to generate an embedding vector matrix A. The first column of matrix A is used for batch verification, which verifies the matching of the number m of black boxes by calculating the integer value of the determinant of the n x m matrix. The second column of matrix A is used for cluster archiving, which obtains the automatic classification result of the current batch of black boxes by SVD orthogonal decomposition and k-means clustering algorithm after dimensionality reorganization.
[0144] Specifically, in this step, one defendant represents one piece of evidence (black box). The purpose of this system is to build a black box processing pipeline; the more black boxes processed, the more stable the system. Stability maintenance primarily relies on the verification and archiving modules. The service kernel of this module is an embedding model, such as Qwen3-Embedding-0.6B. The extracted key-value list yields an nx2 matrix A using the following formula:
[0145] embeddings=torch.tensor([data.embedding for data in self.embed.embeddings.create(input=[(str(k),str(v))for(k,v)in guy.items()],model=self.embed_name,).data]).
[0146] Let m be the number of black boxes in a batch. Take the first column of matrix A and form an n x m matrix. The determinant of this matrix should be equal to m when rounded down. Take the second column of matrix A. Let l be the default dimension of the embedded model. The second column can be reorganized into an m x l matrix. Obtain the orthogonal matrix through SVD and run the k-means clustering algorithm to obtain several clusters of this batch of black boxes.
[0147] The actual user experience is as follows:
[0148] 1. Users determine the key keywords they need to capture based on their professional knowledge.
[0149] 2. Read the random black box to initially obtain the relationships between clue entries and word expressions.
[0150] 3. Type `relate_keys` and `identifiers` in the interactive interface.
[0151] 4. The system selects a random black box for extraction and outputs the results and slices.
[0152] 5. Users adjust the expression and order of clue terms until the results of a single black box meet expectations.
[0153] 6. The system uses batch processing mode to extract all black boxes.
[0154] 7. The system sends the extracted results to the verification and archiving template, and divides the batch of black boxes into corresponding clusters.
[0155] 8. The system extracts the user-selected, parameter-tuned cluster and writes it to the database.
[0156] 9. Randomly select a black box from the next cluster and return to step 2.
[0157] 10. The remaining black boxes usually have defects such as missing pages or blurry images. After replenishing the raw materials, return to step 7.
[0158] 11. All black-box processing completed.
[0159] Based on the same inventive concept, embodiments of the present invention also provide a legal evidence black box element extraction system, which can be applied to the methods described above. For details, please refer to the relevant descriptions above, which will not be repeated here.
[0160] Figure 3 This is a schematic diagram of the structure of a legal evidence black-box element extraction system according to another embodiment of the present invention, as shown below. Figure 3 As shown, a legal evidence black box element extraction system includes: an acquisition module 301, a normalization module 302, a generation module 303, a conversion module 304, a traversal module 305, an iteration module 306, and an output module 307.
[0161] Specifically, such as Figure 3 As shown, the acquisition module 301 is used to acquire a legal evidence black box and an element list; wherein, the legal evidence black box includes multi-format files, and the element list is a list of element names corresponding to the litigation type; the normalization module 302 is used to normalize the legal evidence black box into an image list and a text list; the generation module 303 is used to generate element relationship groups based on the element list; wherein, each group contains logically related elements; the conversion module 304 is used to convert the element relationship groups into a reordering prompt word list, output the confidence score of each evidence unit with the element relationship group, and retain the highest confidence score result; the conversion module 304 is also used to convert the element relationship groups into visual language models respectively. The generation module 303 is further configured to obtain the extracted elements corresponding to the final element relationship combination based on the visual cue word list and the language cue word list and the corresponding evidence unit; the traversal module 305 is configured to traverse each element in the element list, collect the extraction results of the element in all relationship groups, and construct a candidate result set; the iteration module 306 is configured to iteratively remove the candidate result set with the lowest confidence based on the confidence re-ranking algorithm until each element retains only a unique high confidence result, thereby obtaining the target element set; the output module 307 is configured to output the target element set and the corresponding original evidence slice.
[0162] This invention, through its two core technologies—multimodal fusion extraction and dynamic confidence verification—solves the industry dilemma of the trade-off between efficiency and accuracy in legal evidence processing, making it particularly suitable for batch litigation. Its technical benefits include: an end-to-end automated pipeline, increasing processing speed by 50 times; an error rate reduced to below 1%, significantly lowering legal risks; and a reduction of over 80% in manual review workload.
[0163] In some embodiments, such as Figure 3 As shown, the legal evidence black box includes image files, PDF files, video files, and audio files. The normalization module 302 is specifically used to: convert the audio files into text using the Whisper model; deduplicate the video files and extract the image list using FFmpeg; and convert the PDF files into images using the Fitz library.
[0164] In some embodiments, such as Figure 3 As shown, the conversion module 304 is further configured to: obtain a reordering prompt word list from the element relationship group using the following relation: f(related_key) is the system's entry function, which processes the user-input sequence related_key = [k1,k2,...,kn], where k1,k2,...,kn are keys input by the user through natural language interaction, each key corresponds to an evidence cutting window, and pmpt_rerank is the input prompt word of the reordering model, used to locate relevant pages; reorder the reordering prompt word list to obtain the confidence level of each evidence unit with the element relationship group and retain the highest confidence level result.
[0165] In some embodiments, the conversion module 304 is further configured to: convert the feature relationship group into a visual cue word list of a visual language model using the following relation: f(clues) = pmpt_vlm, where f(clues) is a branch processing function that selects a visual model or language model path based on the cue words, and pmpt_vlm is a cue word template of the visual language model; and convert the feature relationship group into a language cue word list of a text language model using the following relation: f(clues) = pmpt_llm_json, where pmpt_llm_json is a language model cue word for converting unstructured text into JSON.
[0166] In some embodiments, such as Figure 3 As shown, the system also includes a verification and archiving module 308, used to: input the list of key-value pairs of the evidence black boxes corresponding to each defendant whose element extraction has been completed into the embed model to generate an embedding vector matrix A; wherein, the first column of matrix A is used for batch verification, and the matching of the number m of black boxes is verified by calculating the integer value of the determinant of the n×m matrix; the second column of matrix A is used for cluster archiving, and after dimensionality reorganization, the automatic classification result of the current batch of black boxes is obtained by SVD orthogonal decomposition and k-means clustering algorithm.
[0167] In another aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, enables the implementation of the method described above.
[0168] The computer-readable medium may be included in the apparatus, device, or system disclosed herein, or it may exist independently.
[0169] The computer-readable storage medium may be any tangible medium that contains or stores a program, and may be an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device. More specific examples include, but are not limited to, electrical connections having one or more wires, portable computer disks, hard disks, optical fibers, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0170] The computer-readable storage medium may also include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code, specific examples of which include, but are not limited to, electromagnetic signals, optical signals, or any suitable combination thereof.
[0171] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.< / example> < / context> < / unstructured> < / instruct> < / context>
Claims
1. A legal evidence black box element extraction method, characterized in that, The method comprises: obtaining a legal evidence black box and an element list; wherein the legal evidence black box comprises multi-format files, and the element list is a list of element names corresponding to a litigation type; normalizing the legal evidence black box into a picture list and a text list; generating an element relationship group according to the element list; wherein each group contains logically associated elements; converting the element relationship group into a reordering prompt word list, outputting the confidence of each evidence unit and the element relationship group and retaining the highest confidence result; converting the element relationship group into a visual prompt word list of a visual language model or a language prompt word list of a text language model respectively; based on the visual prompt word list and the language prompt word list and the corresponding evidence unit, obtaining an extracted element corresponding to a final element relationship group; traversing each element in the element list, collecting the extraction results of the element in all relationship groups, and constructing a candidate result set; based on a confidence reordering algorithm, iteratively removing the candidate result set with the lowest confidence in the candidate result set until only a unique high-confidence result is retained for each element, to obtain a target element set; outputting the target element set and the corresponding original evidence slice.
2. The legal evidence black box element extraction method of claim 1, wherein, The legal evidence black box comprises picture files, PDF files, video files and audio files, and the normalization of the legal evidence black box into a picture list and a text list comprises: converting the audio file into text through a Whisper model; de-duplicating frames of the video file through FFmpeg and extracting a picture list; converting the PDF file into pictures through a Fitz library. 3.The legal evidence black box element extraction method of claim 1, wherein, The conversion of the element relationship group into a reordering prompt word list, the output of the confidence of each evidence unit and the element relationship group and the retention of the highest confidence result comprise: the element relationship group is converted into a reordering prompt word list through the following relationship: f(related_key)=pmpt_rerank wherein f(related_key) is an entry function of the system, which processes the input of the user's associated key sequence related_key=[k1,k2,...,kn], k1,k2,...,kn are keys input by the user through natural language interaction, each key corresponds to an evidence cutting window, pmpt_rerank is an input prompt word of the reordering model, which is used to locate the relevant page; the reordering prompt word list is reordered to obtain the confidence of each evidence unit and the element relationship group and retain the highest confidence result.
4. The legal evidence black box element extraction method according to any one of claims 1 to 3, characterized in that, The conversion of the element relationship group into a visual prompt word list of a visual language model or a language prompt word list of a text language model comprises: the element relationship group is converted into a visual prompt word list of a visual language model through the following relationship: f(clues)=pmpt_vlm, wherein f(clues) is a branch processing function, which selects a visual model or a language model path according to a clue word, and pmpt_vlm is a prompt word template of the visual language model; The element relationship group is converted into a language prompt word list of a text language model by a relationship formula: f(clues)=pmpt_llm_json, where pmpt_llm_json is a language model prompt word converted from unstructured text to JSON.
5. The legal evidence black box element extraction method according to any one of claims 1 to 3, characterized in that, The method further comprises a verifying and archiving step: An evidence black box key value list corresponding to each defendant after completion of element extraction is input into an embed model to generate an embedding vector matrix A. The first column of the matrix A is used for batch verification, and the matching of the number m of black boxes is verified by calculating the determinant of the nxm matrix; the second column of the matrix A is used for clustering and archiving, and after dimension reorganization, the automatic classification result of the current batch of black boxes is obtained through SVD orthogonal decomposition and k-means clustering algorithm.
6. A legal evidence black box element extraction system characterized by, The system comprises: An acquisition module configured to acquire a legal evidence black box and an element list; wherein the legal evidence black box comprises multi-format files, and the element list is a list of element names corresponding to a litigation type; A normalization module configured to normalize the legal evidence black box into a picture list and a text list; A generation module configured to generate an element relationship group according to the element list; wherein each group contains logically associated elements; A conversion module configured to convert the element relationship group into a reordering prompt word list, output the confidence of each evidence unit with the element relationship group, and retain the highest confidence result; The conversion module is further configured to convert the element relationship group into a visual prompt word list of a visual language model or a language prompt word list of a text language model, respectively; The generation module is further configured to obtain the extracted elements corresponding to the final element relationship group based on the visual prompt word list and the language prompt word list and the corresponding evidence unit; An iteration module configured to iteratively remove the candidate result set with the lowest confidence in the candidate result set based on a confidence reordering algorithm until only a unique high-confidence result is retained for each element, thereby obtaining a target element set; An output module configured to output the target element set and the corresponding original evidence slice. The legal evidence black box comprises picture files, PDF files, video files, and audio files, and the normalization module is specifically configured to:
7. The legal evidence black box element extraction system of claim 6, wherein, convert the audio file into text through a Whisper model; remove frames and extract a picture list from the video file through FFmpeg; convert the PDF file into a picture through a Fitz library. The conversion module is specifically configured to:
8. The legal evidence black box element extraction system of claim 6, wherein, The element relationship group is reordered by a reordering prompt word list through a relationship formula: f (related_key) = pmpt_rerank, where f (related_key) is an entry function of the system, processing the associated key sequence related_key = [k1, k2,..., kn] input by the user, k1, k2,..., kn are keys input by the user through natural language interaction, each key corresponds to an evidence cut window, pmpt_rerank is an input prompt word of the reordering model, used to locate a relevant page; the reordering prompt word list is reordered to obtain the confidence of each evidence unit and the element relationship group and the highest confidence result is retained; and / or, The element relationship group is converted into a visual prompt word list of the visual language model through a relationship formula: f (clues) = pmpt_vlm, where f (clues) is a branch processing function, selecting a visual model or a language model path according to a clue word, and pmpt_vlm is a prompt word template of the visual language model; and the element relationship group is converted into a language prompt word list of the text language model through a relationship formula: f (clues) = pmpt_llm_json, where pmpt_llm_json is a language model prompt word for converting unstructured text into JSON.
9. The legal evidence black box element extraction system of any one of claims 6 to 8, wherein, The verification and archiving module is also included, which is used to: Input the evidence black box key value list corresponding to each defendant after completing the element extraction into the embed model to generate an embedding vector matrix A. The first column of the matrix A is used for batch verification, and the matching of the number m of black boxes is verified by calculating the determinant of the nxm matrix; the second column of the matrix A is used for clustering and archiving, and after dimension reorganization, the automatic classification result of the current batch of black boxes is obtained through SVD orthogonal decomposition and k-means clustering algorithm.
10. An electronic device, comprising: It includes: One or more processors; A storage unit for storing one or more programs, which when executed by the one or more processors, can cause the one or more processors to implement the legal evidence black box element extraction method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Legal element extraction method and device
CN115034199A
Knowledge-driven underground building design scheme intelligent examination method, system and equipment
CN120216671A