Method and system for extracting judgment document information based on multi-template selection model
By using a multi-template selection model to expand event type mining and template training guidance for referee text data in the extraction of referee document information, the problems of poor applicability, poor generalization ability and strong data dependence in the existing technology are solved, and more efficient and flexible information extraction effect is achieved.
Patent Information
- Application Number
- CN202411922755.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-18
AI Technical Summary
The existing technical fields of judicial document information extraction based on large model prompt learning are poor in applicability, poor generalization ability and strong data dependence.
The referee document information extraction method based on the multi-template selection model is adopted. By mining the referee text data for extended event type, the potential extended event types and corresponding extended templates are obtained, and input them into the pre-trained language model for training guidance, to improve the accuracy and efficiency of information extraction.
It improves the accuracy and efficiency of information extraction, reduces the probability of error extraction, enables the pre-trained language model to adapt to different legal texts and case types, and enhances the flexibility and adaptability of extraction tasks.
Smart Images

Figure CN119849484A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of judicial document information extraction, and in particular, to a judicial document information extraction method and system based on a multi-template selection model. Background Art
[0002] With the rapid development of society, the number of legal documents has increased dramatically, and traditional manual processing methods can no longer meet the needs of modern society for legal information processing. Automated information extraction technology can quickly process a large number of legal documents and improve work efficiency. In the era of big data, data collection, storage and analysis have become particularly important. As an important part of legal data, the automatic extraction of judicial documents is of great significance for the construction of a legal big database. In recent years, the development of artificial intelligence technology, especially natural language processing technology (NLP), has provided a technical basis for the automatic extraction of judicial document information. Machine learning, deep learning and other technologies enable computers to better understand and process natural language. The legal field is highly professional, and it is difficult for non-professionals to accurately understand and extract information from judicial documents. Automated extraction technology can reduce the interference of human factors and improve the accuracy of information extraction. By automatically extracting judicial document information, an open and transparent judicial database can be built, allowing the public to more easily obtain and understand judicial decisions, thereby improving the transparency and fairness of the judiciary.
[0003] At present, in order to improve the automation and accuracy of judicial document information extraction, existing technologies mostly use judicial document information extraction technology based on large model prompt learning to extract judicial document information, aiming to use pre-trained language models to guide the model to automatically identify and extract key information in judicial documents by designing specific prompts.
[0004] Although large-model-based prompt learning shows great potential in extracting judicial document information, there are still some shortcomings: pre-trained language models may perform well in general fields, but may require additional adjustments and training in specific legal fields. The performance of pre-trained language models depends heavily on high-quality annotated data, which may be difficult to obtain in the legal field. Although pre-trained language models have good generalization capabilities, they may still have misunderstandings when dealing with certain specific or rare legal cases. Summary of the invention
[0005] The present invention provides a method and system for extracting judicial document information based on a multi-template selection model, which solves the problems of poor applicability, poor generalization ability and strong data dependence in the existing technical field of judicial document information extraction based on large model prompt learning.
[0006] In a first aspect, an embodiment of the present invention provides a method for extracting judicial document information based on a multi-template selection model, the method comprising the following process:
[0007] Based on the multi-template selection model, the extended event type mining is performed on the referee text data to obtain potential extended event types, and corresponding extended templates are obtained according to the potential extended event types;
[0008] The extended template is input into the pre-trained language model for training guidance to obtain the legal entity and legal facts of the judgment document.
[0009] In the above embodiment, the present invention constructs a multi-template selection model, which mines the extended event types corresponding to the context of the judgment text data through the multi-template selection model, and obtains the extended templates through the extended event types, and uses the extended templates as the input of the pre-trained language model for training guidance, so that the pre-trained language model can focus on the legal entities and legal facts in specific fields in the judgment text data, thereby improving the accuracy and efficiency of information extraction and reducing the probability of erroneous extraction; and the contextual prompt learning of multiple templates allows the pre-trained language model to adapt to different legal texts and case types, making the judgment document information extraction task more flexible and adaptable.
[0010] As some optional implementation modes of the present application, the judgment text data includes event description and event context mention.
[0011] In the above embodiment, the present invention uses judicial text data as the basis for pre-training language models and expanding event type mining, which can provide more information for judicial document information extraction.
[0012] As some optional implementation methods of the present application, the extended event type mining is performed on the referee text data based on the multi-template selection model to obtain potential extended event types, and the process of obtaining the corresponding extended template according to the potential extended event type is as follows:
[0013] Based on the extended event type mining matrix, the matching degree between event context mentions and all event types is calculated to obtain the matching scores of all event types.
[0014] The extended event type with the highest matching degree is selected according to the matching score to obtain a potential extended event type, and a corresponding extended template is obtained according to the potential extended event type.
[0015] In the above embodiment, the present invention adopts the method of expanding the event type mining matrix to perform matching degree calculation, so as to quickly realize the matching calculation of all event types and event contexts, and then quickly realize the selection of expanded event types and expanded templates.
[0016] As some optional implementation methods of the present application, the process of inputting the extended template into the pre-trained language model for training guidance to obtain the legal entity and legal facts of the judgment document is as follows:
[0017] Generate a context prompt corresponding to the template according to the extended template, wherein the context prompt includes an event type description and event keywords;
[0018] The judgment text data, contextual prompts and extended templates are sequentially connected to obtain model training data, and the model training data is input into the pre-trained language model for training guidance to obtain the legal entity and legal facts of the judgment document.
[0019] In the above embodiment, the present invention connects the contextual prompts with the extended template and the judgment text data sequence, so that the model training data can be quickly and accurately recognized by the pre-trained language model.
[0020] As some optional implementation methods of the present application, the model training data is input into the pre-trained language model for training guidance process as follows:
[0021] Sequentially concatenate event context mentions and context cues to obtain a context encoding vector;
[0022] The information fusion function is used to fuse the context encoding vector and the extended event type mining matrix to achieve model training guidance.
[0023] In the above-mentioned embodiment, the present invention sequentially connects event context mentions and context prompts, so that different extended templates can correspond to different context prompts, thereby realizing multi-template selection.
[0024] As some optional implementations of the present application, the information fusion function is expressed as follows:
[0025] f a (a,h)=tan R·(h·[a;a * ;|aa * |;|a+a * |])
[0026] Among them, R represents the learnable weight matrix, h represents the context encoding vector, a represents the extended event type mining matrix, [;] represents the sequence connection operation, and * represents element-by-element multiplication.
[0027] In the above embodiment, the present invention adopts a learnable weight matrix to construct an information fusion function, so that in the process of extracting judicial document information, more minority class entities can be generated through class labels and adversarial models, reducing the difficulty of data acquisition and manual workload, and expanding the amount of data required for entity recognition, thereby better training the model and improving the accuracy of entity recognition.
[0028] In a second aspect, the present invention provides a judgment document information extraction system based on a template selection model, the system comprising:
[0029] An extended template unit, wherein the extended template unit mines the extended event type of the referee text data based on a multi-template selection model to obtain potential extended event types, and obtains corresponding extended templates according to the potential extended event types;
[0030] A model training unit is used to input the extended template into a pre-trained language model for training guidance to obtain the legal entity and legal facts of the judgment document.
[0031] In a third aspect, the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for extracting judicial document information based on a template selection model when executing the computer program.
[0032] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for extracting judicial document information based on a template selection model is implemented.
[0033] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method for extracting judicial document information based on a template selection model.
[0034] The beneficial effects of the present invention are as follows:
[0035] 1. The present invention provides specific contextual prompts for the pre-trained language model, so that the pre-trained language model can more accurately identify the legal entities and key information in the judicial documents, reduce the probability of erroneous extraction, and multi-template contextual prompt learning allows the pre-trained language model to adapt to different legal texts and case types, making the extraction task more flexible and adaptable.
[0036] 2. The present invention uses a pre-trained language model to automatically extract judicial document information. The automated information extraction process significantly reduces the time for manual reading and analysis of judicial documents, thereby improving overall work efficiency.
[0037] 3. The present invention makes the decision-making process of the pre-trained language model more transparent through the multi-template context prompt design, which helps legal professionals understand and verify the model output. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 is a schematic diagram of the computer device structure of the hardware operating environment described in the embodiment of the present invention;
[0040] Figure 2 It is a flow chart of the method for extracting judicial document information described in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0042] In order to solve the problems of poor applicability, poor generalization ability and strong data dependence in the existing judicial document information extraction technology field based on large model prompt learning. The embodiment of the present invention provides a judicial document information extraction method and system based on a multi-template selection model. Before introducing the specific technical solution of this application, the hardware operating environment involved in the embodiment of this application is first introduced.
[0043] See also Figure 1 , Figure 1 The figure is a schematic diagram of the computer device structure of the hardware operating environment involved in the embodiment of the present invention.
[0044] like Figure 1As shown, the computer device may include: a processor, such as a central processing unit (CPU), a communication bus, a user interface, a network interface, and a memory. Among them, the communication bus is used to realize the connection and communication between these components. The user interface may include a display screen (Display), an input unit such as a keyboard (Keyboard), and optionally, the user interface may also include a standard wired interface and a wireless interface. The network interface may be a wired interface or a wireless interface (such as a wireless fidelity interface). The memory may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory may optionally be a storage device independent of the aforementioned processor.
[0045] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine some components, or arrange the components differently.
[0046] like Figure 1 As shown, the memory as a storage medium may include an operating system module, a network communication module, a user interface module and a data storage module.
[0047] exist Figure 1 In the computer device shown, the network interface is mainly used for data communication with the network server; the user interface is mainly used for data interaction with the user; the processor and memory in the computer device of the present application can be set in the computer device, and the computer device calls the computer program product stored in the data storage module through the processor, and executes the judicial document information extraction method based on the multi-template selection model provided in the embodiment of the present application.
[0048] Based on the hardware environment of the aforementioned embodiment, the embodiment of the present application provides a method for extracting judicial document information based on a multi-template selection model. Figure 2 , Figure 2 The flowchart of the method for extracting judicial document information is as follows:
[0049] (1) Based on the multi-template selection model, the extended event type mining is performed on the judgment text data to obtain potential extended event types, and the corresponding extended templates are obtained according to the potential extended event types.
[0050] In an embodiment of the present invention, the judgment text data includes an event description and event context mention.
[0051] Specifically, the event description refers to a natural language description of a specific event that objectively occurs, usually a sentence or a group of sentences. Event descriptions usually include two parts: event trigger words and event elements. The event trigger words are the words in the event description that best represent the occurrence of the event and determine the category of the event. The event elements are the participants of the event and are the core part of the event. Together with the event trigger words, they constitute the entire framework of the event. The event trigger words are the key components in the event description, usually verbs or nouns, which can clearly identify the occurrence of the event. Event elements are another important component in the event description, representing the participants or related attributes of the event; the event elements can be entities (such as names of people, places, organization names, etc.), time, place, etc.
[0052] In the embodiment of the present invention, the event context mention generally refers to the mention of elements, information or entities that are directly related to the event or have a significant impact on it; mainly including the event subject, event action, event object, time information, location information, background information and related entities, etc.
[0053] Preferably, the embodiment of the present invention selects event context mentions of the judgment text data as data support for subsequent data processing, so as to provide specific context prompts for the model, which can more accurately identify the legal entities and key information in the judgment documents and reduce the probability of erroneous extraction.
[0054] In an embodiment of the present invention, the extended event type mining is performed on the referee text data based on the multi-template selection model to obtain potential extended event types, and the process of obtaining the corresponding extended template according to the potential extended event type is as follows:
[0055] (1.1) Based on the extended event type mining matrix, the matching degree between event context mentions and all event types is calculated to obtain the matching scores of all event types.
[0056] Specifically, the matching degree calculation methods include feature-based matching degree calculation, rule-based matching degree calculation, model-based matching degree calculation, etc.; wherein, the feature-based matching degree calculation is to calculate the matching degree by comparing the features of the event context and the event type, and the features may be the time, location, participants and other attributes of the event. Specifically, algorithms such as cosine similarity can be used to evaluate the similarity between the features. The rule-based matching degree calculation is to determine whether the event context matches the event type by defining a series of rules, and the rules can be formulated based on factors such as the attributes, occurrence conditions, and influence of the event; if the event context meets the conditions of a certain rule, the event type corresponding to the rule is considered to match. The model-based matching degree calculation is to calculate the matching degree between the event context and the event type through machine learning or deep learning models. The model can learn the association between the event context and the event type by training a large amount of event data, and predict and match on the new event data. Specifically, the matching degree calculation method can be selected according to the actual situation, and the embodiment of the present invention does not limit this.
[0057] (1.2) Selecting the extended event type with the highest matching degree according to the matching score to obtain a potential extended event type, and obtaining a corresponding extended template according to the potential extended event type.
[0058] Specifically, the extended event type mining matrix can be expressed as a∈R |A|×|A| ; Wherein, |A represents the number of event types. With the help of the extended event type mining matrix, the matching score between the current input context mention and all event types can be calculated, and the corresponding extended template can be obtained according to the matching score; wherein, the extended template is pre-set and is respectively associated with different extended event types.
[0059] (2) Inputting the extended template into a pre-trained language model for training guidance to obtain the legal entity and legal facts of the judgment document; wherein the pre-trained language model includes but is not limited to using a BERT model.
[0060] In an embodiment of the present invention, the process of inputting the extended template into the pre-trained language model for training guidance to obtain the legal entity and legal facts of the judgment document is as follows:
[0061] (2.1) Generate a contextual prompt corresponding to the template according to the extended template, wherein the contextual prompt includes an event type description and event keywords; specifically, the multi-template selection model uses end-to-end generation of contextual information corresponding to the extended template.
[0062] (2.2) The judgment text data, contextual prompts, and extended templates are sequentially connected to obtain model training data, and the model training data is input into the pre-trained language model for training guidance to obtain the legal entity and legal facts of the judgment document.
[0063] In an embodiment of the present invention, the model training data is input into the pre-trained language model for training guidance process as follows:
[0064] (2.21) The event context mentions and context hints are sequentially concatenated to obtain a context encoding vector.
[0065] Specifically, the context encoding vector is expressed as Among them, Qwen Encoder represents the pre-trained language model, M represents event context mention, Event keywords that represent contextual hints, The event type description representing the context hint; the context encoding vector H i It is represented by {h 0 ,h 1 ,h 2 ,…,h d-1}, d represents the vector dimension output by the pre-trained language model.
[0066] (2.22) The information fusion function is used to fuse the context encoding vector and the extended event type mining matrix to achieve model training guidance.
[0067] Specifically, the information fusion function is expressed as follows:
[0068] f a (a,h i )=tan W·(h i ·[a;a * ;|aa * |;|a+a * |])
[0069] Among them, W represents the learnable weight matrix, expressed as W∈R 4d×4d , h represents the context encoding vector, a represents the extended event type mining matrix, [;] represents the sequence connection operation, and * represents element-by-element multiplication; Specifically, information fusion is expressed as a'=f a (a,h i ).
[0070] In summary, in the existing judicial document information extraction task based on large model prompt learning, the generation process can generally be expressed as y=f(event mention; prompt), where y represents the sentence generated by the pre-trained language model, event mention represents the event description, and prompt represents the predefined prompt; in the judicial document information extraction task based on the multi-template selection model in the embodiment of the present invention, the generation process can generally be expressed as y=f(M; prompt a ; T a ), where y represents the sentence generated by the pre-trained language model, M represents the event context mention, and prompt a Indicates the contextual hint corresponding to the template generated by the extended template, T a Indicates the extended template corresponding to the potential extended event type; the embodiment of the present invention uses the predefined multi-template context prompts to guide the pre-trained language model to focus on specific legal entities and legal facts in the judgment text, thereby improving the accuracy and efficiency of information extraction, and automatically extracting key information from the input materials, such as party information, appeal requests, case facts, the first instance court's opinion, etc.
[0071] In addition, in one embodiment, based on the same inventive concept as the above embodiment, the embodiment of the present invention provides a judgment document information extraction system based on a multi-template selection model, and the system corresponds one-to-one to the method of embodiment 1, and the system includes:
[0072] An extended template unit, wherein the extended template unit mines the extended event type of the referee text data based on a multi-template selection model to obtain potential extended event types, and obtains corresponding extended templates according to the potential extended event types;
[0073] A model training unit is used to input the extended template into a pre-trained language model for training guidance to obtain the legal entity and legal facts of the judgment document.
[0074] It should be noted that each unit in the judicial document information extraction system based on the template selection model in this embodiment corresponds one-to-one to each step in the judicial document information extraction method based on the template selection model in the aforementioned embodiment. Therefore, the specific implementation manner and technical effects achieved by this embodiment can refer to the implementation manner of the judicial document information extraction method based on the template selection model mentioned above, and will not be repeated here.
[0075] In addition, in one embodiment, the present application also provides a computer device, which includes a processor, a memory, and a computer program stored in the memory, and the computer program implements the method in the aforementioned embodiment when executed by the processor.
[0076] In addition, in one embodiment, the present application further provides a computer storage medium, on which a computer program is stored, and the computer program implements the method in the aforementioned embodiment when executed by a processor.
[0077] In some embodiments, the computer readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories. The computer may be various computing devices including intelligent terminals and servers.
[0078] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0079] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0080] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0081] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0082] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0083] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a multimedia terminal device (which can be a mobile phone, a computer, a television receiver, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0084] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for extracting judicial document information based on a multi-template selection model, characterized in that: The method comprises the following steps: Based on the multi-template selection model, the extended event type mining is performed on the referee text data to obtain potential extended event types, and corresponding extended templates are obtained according to the potential extended event types; The extended template is input into the pre-trained language model for training guidance to obtain the legal entity and legal facts of the judgment document.
2. According to claim 1, a method for extracting judicial document information based on a multi-template selection model is characterized in that: The adjudication text data includes event descriptions and event context mentions.
3. According to claim 2, a method for extracting judicial document information based on a multi-template selection model is characterized in that: Based on the multi-template selection model, the extended event type mining is performed on the referee text data to obtain potential extended event types, and the process of obtaining the corresponding extended template according to the potential extended event type is as follows: Based on the extended event type mining matrix, the matching degree between event context mentions and all event types is calculated to obtain the matching scores of all event types. The extended event type with the highest matching degree is selected according to the matching score to obtain a potential extended event type, and a corresponding extended template is obtained according to the potential extended event type.
4. According to claim 3, a method for extracting judicial document information based on a multi-template selection model is characterized in that: The process of inputting the extended template into the pre-trained language model for training guidance to obtain the legal entity and legal facts of the judgment document is as follows: Generate a context prompt corresponding to the template according to the extended template, wherein the context prompt includes an event type description and event keywords; The judgment text data, contextual prompts and extended templates are sequentially connected to obtain model training data, and the model training data is input into the pre-trained language model for training guidance to obtain the legal entity and legal facts of the judgment document.
5. According to claim 4, a method for extracting judicial document information based on a multi-template selection model is characterized in that: The training guidance process of inputting model training data into the pre-trained language model is as follows: Sequentially concatenate event context mentions and context cues to obtain a context encoding vector; The information fusion function is used to fuse the context encoding vector and the extended event type mining matrix to achieve model training guidance.
6. According to claim 5, a method for extracting judicial document information based on a multi-template selection model is characterized in that: The information fusion function is expressed as follows: f a (a,h)=tan R·(h·[a;a * ;|a-a * |;|a+a * |]) Among them, R represents the learnable weight matrix, h represents the context encoding vector, a represents the extended event type mining matrix, [;] represents the sequence connection operation, and * represents element-by-element multiplication.
7. A judicial document information extraction system based on a template selection model, characterized in that: The system comprises: An extended template unit, wherein the extended template unit mines the extended event type of the referee text data based on a multi-template selection model to obtain potential extended event types, and obtains corresponding extended templates according to the potential extended event types; A model training unit is used to input the extended template into a pre-trained language model for training guidance to obtain the legal entity and legal facts of the judgment document.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it implements the method for extracting judicial document information based on the template selection model as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements a method for extracting judicial document information based on a template selection model as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements a method for extracting judicial document information based on a template selection model as described in any one of claims 1 to 6.